Thomas Thomas Thomas Thomas - 1 year ago 110
Android Question

Step count retrieved through Google Fit Api does not match Step count displayed in Google Fit Official App

I have developed an application that needs to display daily steps count.
To do this, I used the API available in Google Fit SDK.

All seems to be working properly, but the steps count I get does not match to the one displayed in Google Fit Official Application.

For example, I get 2308 steps when the Google Fit App display 2367 steps.

Is there a reason for this? Does anyone have the same issue?
Anyone have a clue?

Answer Source

I found the solution.

The Fit app does some additional processing on top of the steps. It estimates steps based on the activity when none are recorded.

If it can help someone : You need to use a custom DataSource of the package

DataSource ESTIMATED_STEP_DELTAS = new DataSource.Builder()

And use this in your aggregate method like this :

DataReadRequest readRequest = new DataReadRequest.Builder()
            .bucketByTime(1, TimeUnit.DAYS)
            .setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download