douglasjunior / AndroidBluetoothLibrary

A Library for easy implementation of Serial Bluetooth Classic and Low Energy on Android. 💙
MIT License
224 stars 68 forks source link

Bluetooth disconnect from device when app closes #21

Closed gilgoldzweig closed 5 years ago

gilgoldzweig commented 6 years ago

The service disconnect without giving the option to control when to disconnect the device.

There is no way for me to override when you disconnect from the device.

douglasjunior commented 6 years ago

This is a default bluetooth behavior, it is not the library that decides this.

gilgoldzweig commented 6 years ago

How can I change it so that the device will not disconnect when the app close?

douglasjunior commented 6 years ago

Something like https://stackoverflow.com/q/25267753/2826279 and https://stackoverflow.com/q/49729452/2826279

gilgoldzweig commented 6 years ago

I have a service that is running in the background but how can I let the service lifecycle control the BluetoothService lifecycle?

jjrodcast commented 6 years ago

I think the service disconnect when you resume or pause your app, probably you have to make your own implementation unless I am wrong.