The STEP COUNTER sensor logs the number of steps since the last boot of the watch. I am trying to continuously monitor the number of steps taken, but it seems that the number of steps only updates when the watch's screen turns on. I understand that continuously updating step count will eat up battery, but is it possible for it to update in the background rather than only when the screen turns on?
So far, I am running the STEP COUNTER sensor in a Foreground service:
public SensorEventListener stepListener = new SensorEventListener() {
public void onAccuracyChanged(Sensor sensor, int acc) {
}
public void onSensorChanged(SensorEvent event) {
stepCounter = String.valueOf(event.values[0]);
}
};
I continuously log the step count. On my watch (Galaxy Watch 4), I have noticed that the watch is counting steps, but the watch face only updates the step count when I look at the watch. In the log, the number of steps remains the same until I look at the watch. After looking at the watch (and the screen turning on), the log now shows a larger number.
The sensor is working in the background (I have also set up an accelerometer that keeps refreshing in the background), but the step counter does not refresh the value until the screen turns on.
Is there any way to allow the sensor to refresh in the background without turning on the watch's screen?
i use google health services to get the stepcount in the background. the new version unfortunately is even slower then the old one. it fires an update every 30 minutes most of the time. i discussed this with google on github and they told me it is to save battery. but waking the device every 30 minutes and not care about the doze intervals ... that's bad in my opinion.
so to answer your question: getting fast regular updates in the background is not possible afaik.
but the combination is okay for me.