Communicate in background even if the app is not running
Hi,
I would like to ask, which is the easiest way to communicate with the device sensor, even if the app is not running? Our application needs how many steps the user did, and it needs to detect if the euler axis is changed to much even if the app is not running.
Can you help me on this? Thanks.
Comments
https://developer.android.com/guide/components/services
Okay, i now this, but can you be a little more detailed?
For starting a service i need the BtleService so i need to bind my own service to it right?
How can i do it?
And i need to restart always my service when the app finishes, so the app won't stop to subscribe on changes of the sensors.
I tried to use this two links for help but i have troubles with it:
https://stackoverflow.com/questions/30525784/android-keep-service-running-when-app-is-killed
https://github.com/polyglotprogramminginc/purr_programming_shirt/blob/master/mobile/src/main/java/com/purrprogramming/purrprogrammingshirt/PurrProgrammingNotificationListenerService.kt
Can you show me a little more help? Maybe a dummy code or something?
Regards
Has anyone had any progress on this issue?