How to get step count from Google Fit REST API like Google Fit app?

前端 未结 4 982
遇见更好的自我
遇见更好的自我 2020-11-28 13:04

I\'m developing a PHP application which work with Google Fit APIs to collect daily user\'s step count.

I want to get my step count from \"Jan 15 2015 00:00:00 GMT+07

4条回答
  •  一生所求
    2020-11-28 13:50

    1. Which datasource the Google Fit app use to calculate step count?

    Google Fit App uses the estimated_steps data source to calculate step counts. DataSourceId: derived:com.google.step_count.delta:com.google.android.gms:estimated_steps

    1. Why there are different between datasources's value and Google Fit value?

    Each data source represents a different device/source. I see you have a Sony Smart Watch and a HTC Desire connected to Google Fit. Each of your devices reports values to Fit which are merged together. Merge_step_deltas gives you the merged stream of all your step counters. Estimated_steps also takes into account activity, and estimates steps when there are none.

    1. How can I get the Google Fit value?

    REST API can only access data which has been synced to the backend. To get same values as Google Fit, read estimated_steps data source. It should be the same as what you see on https://fit.google.com/. The device could have latest values which are not yet synced to the server. We are working on making the syncs and the cross-platform experience more seamless.

    -- Engineer on Google Fit Team.

提交回复
热议问题