Closed phillipytran closed 3 years ago
There are many ways to send data to an activity. I used broadcasts in the example app just because it is simple to do.
This library is about the BLE communication itself and the example app shows a way how to integrate it into an app.
I can't tell you what is best for your usecase. You will need to figure that out yourself....
That's fair enough. Thanks for taking the time to get back to me.
My app communicates with a microcontroller and I would like the microcontroller to send a Bluetooth message to the app in response to certain events. These events are infrequent and can occur at random intervals (ie no patterns/periodicity). In the example app, I see that you create BroadcastReceivers for each Service in MainActivity and in BluetoothHandler, you broadcast an Intent whenever the Characteristic is updated. Is this the best method for what I am attempting to accomplish?