How to keep Android BLE connection via Destroy app

Basically, I want to open an Android app that I have created. Send some data to the serial port (which I am still working on), then exit the application and when I return to it; send some more data without reconnecting.

Is there some secret in the .createbond method? I know this has been done before. I have a shingle that uses the app basically only to try to connect, and then as soon as I log out I get notifications all day. How it works with a BLE device. I need a little ingisht. Thank!

+3


source to share


1 answer


You do this using a service. Create a service, connect to the device from the service, and then send whatever data you want from the app to the service to send to the device. This way, you will maintain a connection to the device regardless of the application.



+2


source







All Articles