I am collecting raw sensor data (HeartRate, accelerometer, gyroscope, etc.) with Samsung Watch 4 which has Android version 6. I need to run my data collection application continuously in the background. However, it seems the watch OS kills the application after some time. So I need to implement a foreground service to keep the application running.
Now the issue is that foreground services work above Android version 8 only.
So my question is - How can I implement a foreground service on the Android version 6, i.e., in Samsung watch 4.