Search code examples
androidgpsaccelerometerandroid-sensorsgoogle-fit

How is it possible that Google Fit app measures number of steps all the time without draining battery?


The Google Fit app, when installed, measures the duration you are walking or running, and also the number of steps all the time. However, strangely, using it does not seem to drain the battery. Other apps like Moves which seems to record number of steps pretty accurately declares that it uses a lot of power because of it constantly monitoring the GPS and the accelerometer.

I imagine several possibilities:

  • Wakes up the phone every minute or so, then analyses the sensors for a few seconds and then sleeps again. However it seems that the records are pretty accurate to the minute, so the waking up must be frequent.
  • Actually turns on the accelerometer all the time, and analyzes it only after the accelerometer measurement data buffer is full. However I think the accelerometer has a small buffer to store the latest measurements.
  • Use GPS to estimate the number of steps instead of actually counting it. However this should not be the case, since it works even indoors.

The app still feels magical. Counting steps the whole time without perceptible battery drain.


Solution

  • Thanks for asking this question!

    Battery is one of our top most concerns and we work hard to optimize Google Fit's battery usage and provide a magical experience. Google Fit uses a mix of sensors(Accelerometer, Step counter, Significant Motion counter), Machine Learning and heuristics to get the data right. Our algorithm is pretty similar to your 1st option plus a little bit of magic.

    We periodically poll accelerometer and use Machine Learning and heuristics to correctly identify the activity and duration. For devices with hardware step counters, we use these step counters to monitor step counts. For older devices, we use the activity detected to predict the right number of steps. Our algorithms merge these activities, steps and sometimes location to correlate and further increase accuracy.

    We do not poll GPS to estimate steps or detect activities.

    -- Engineer on Google Fit Team.