1

Iam creating an iOS and an Android application that read some data from a bluetooth sensor and saves them in a db.

I want to give the ability to save the sensor's data even when the application is terminated.

fyi. I have already managed to read the sensor in both iOS and Android while the app is the background.

But my concern is on how to make the following scenario work:

-Sensor is disconnected from the phone -User terminates the application from the task manager -User connects (and pairs) the BLE sensor to the device -The application wakes-up in the background and reads the sensor's output and then goes back to sleep.

Any suggestions?

Panos
  • 7,227
  • 13
  • 60
  • 95
  • Did you find any solution for this ? I'm having similar issue. https://stackoverflow.com/questions/47813624/re-connect-bluetooth-device-when-app-is-terminated – yusufonderd Dec 19 '17 at 10:57

1 Answers1

1

For iOS this is possible as described in Apple doc Core Bluetooth Background Processing for iOS Apps.

For Android you could start a Service (by your app and also on device boot) and (re)connect to the device.

Also you could post a local notification in iOS/Android background Service - and when the user touches it, start the BLE app.

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416