Hi B4A community,
Using ba.raiseEventFromDifferentThread, I found numerous examples on how to call a B4A function from the java library and pass parameters. I'm looking for a way to get data back from my call to the B4A function. I found no example of this. Can you help?
The application is as follow: When a Central reads from a characteristic, it's expecting a return value. I'd like to call a B4A function that will return the data to be read and pass it to the java library. How can I modify this call to achieve this?
Could it be only to do?
One last requirement to make this practical: the return value will be an array of bytes. So how should I write this to convert my return object to an array of bytes?
Note: I'm a newbie at all this.
Thanks.
Using ba.raiseEventFromDifferentThread, I found numerous examples on how to call a B4A function from the java library and pass parameters. I'm looking for a way to get data back from my call to the B4A function. I found no example of this. Can you help?
The application is as follow: When a Central reads from a characteristic, it's expecting a return value. I'd like to call a B4A function that will return the data to be read and pass it to the java library. How can I modify this call to achieve this?
Java:
ba.raiseEventFromDifferentThread(Library.this, null, 0, eventName + "_getData", false, new Object[]{device.getAddress(), characteristic.getUuid().toString()});
Could it be only to do?
Java:
object return = ba.raiseEventFromDifferentThread...
One last requirement to make this practical: the return value will be an array of bytes. So how should I write this to convert my return object to an array of bytes?
Note: I'm a newbie at all this.
Thanks.
Last edited: