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

83,588

Solution 1

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.

Solution 2

On some very recent phones like the Nexus 5 (released in late 2013 with Android 4.4 KitKat), there is a dedicated low-power CPU core that can serve as a pedometer. Since this core consumes very little power and can compute steps by itself without the need for the entire CPU or the GPS, overall battery use is reduced greatly. On the recent iPhones, there is a similar microcontroller called the M7 coprocessor in the iPhone 5s and the M8 in the iPhone 6.

More information here:

https://developer.android.com/about/versions/kitkat.html

http://nexus5.wonderhowto.com/how-to/your-nexus-5-has-real-pedometer-built-in-heres-you-use-0151267/

http://www.androidbeat.com/2014/01/pedometer-nexus5-hardware-count-steps-walked/

Solution 3

having a 3 year old HTC OneX I can say that THERE IS NO DEDICATED HARDWARE, Google Fit just uses standard sensors in a very clever way. I come from Runtastic Pedometer: there is a clear battery consume when in use, it would be impossible to keep it on all the time as it needs the full accelerometer power. On the other side, if you stand still and shake the phone Runtastic will count the shakes, while Google Fit apparently does nothing... Still it works perfectly when you actually walk or run. Magic.

Solution 4

Google fit try to learn use pedo step pattern and try to create its own personal walking patterns and its clusters. This eliminates the need of having huge mathematics calculations on receiving sensor data every time. This makes Google fit more power efficient compared other software pedo apps. Having said that, there is compromise on accuracy factors here. Between power-accuracy trade off, google seems to be more aligned towards power factor here.

At this moment the most power efficient detection happens Samsung flagship & its other high end models. Thanks to Samsung's dedicated hardware chip! No matter how power efficient your software pedo algorithm be but its hard to beat dedicated hardware unit advantage. I also heard about Google's bringing dedicated hardware unit for Ped upcoming nexus devices.

Solution 5

I don't know for the other phones out there, but Google Fit was really draining my battery life on my Nexus 5. Disabling it definitely improved my battery life.

Share:
83,588
Russell Ladd
Author by

Russell Ladd

Android Developer since 2009.

Updated on March 03, 2021

Comments

  • Russell Ladd
    Russell Ladd over 3 years

    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.

  • Patrick
    Patrick over 8 years
    It is quite an interesting app. Using gyroscope sensor for pedestrian sounds reasonable (z peak at every step). But the cycling works also quite accurate. Is GPS information really not used for cycling? You get the distance just by usage of gyroscope sensor and software?
  • Osama Aftab
    Osama Aftab almost 8 years
    For me some of the older devices doesn't able to detect the number of steps using Google fit Api any ideas why?
  • Ahmad Hajjar
    Ahmad Hajjar over 6 years
    is this available on Android API ?
  • Devansh Maurya
    Devansh Maurya about 5 years
    But it still happens on the Google Fit app that the shaking of a device, even when no step has been taken, is counted as a step. Is there any solution to this?
  • Anirudh Ganesh
    Anirudh Ganesh almost 4 years
    Shaking the device does give you one or two steps (even rolling on the bed counts as a step!). But, then again, if you count the steps by yourself and compare it with FIT it won't be super accurate. An error margin is always present with all the devices which can't be avoided unless, maybe you use a specific device tied to your body part?!