Wednesday, 31 July 2019

BLE Connection getting lost after app is closed

I'm developing native BLE android app where I need to constantly remain connected with BLE device. Along with BLE, I also need to track GPS all the time until user doesn't logout. Here are my concerns

  1. Can we keep multiple service in foreground? In my case it has to be BLE and Location Tracking.

  2. I have seen that service getting killed though it is started using StartForeground in service onCreate. Is there any solution that can help me to keep my service alive all the time?

  3. I'm using START_STICKY in onStartCommand, though it gets killed in the background after long time.

  4. I'm writing characterstic using BluetoothGatt to send command to BLE device, I have multiple command to execute, is there any way I can know which command was executed from the response or I need to use flag variable to track the command request?

Please provide suggestions as I'm new to BLE feature.



from BLE Connection getting lost after app is closed

No comments:

Post a Comment