weliem / blessed-android

BLESSED, a Bluetooth Low Energy (BLE) library for Android
MIT License
557 stars 120 forks source link

ble device is disconnected when app goes to background #188

Closed joebazoka closed 1 year ago

joebazoka commented 1 year ago

Hi. When the android app goes to background ble device is disconnected. I have tried put the getInstance of BluetoothHandler in a service but without result. There is any form top mantain the connection when app goes to background?. Sorry for my bad english.

weliem commented 1 year ago

When the app goes to the background, the device should stay connected. Only when your app is killed will the connection be disconnected.

If the connection is really disconnected when the app goes into the background it is because of your code...

joebazoka commented 1 year ago

Yes, sorry is when is killed. When the application returns to the foreground I need to recover the connection to the previously connected device but I can't find the way. Many thanks for the response weliem.