无法获得 Google 健身应用中显示的确切步数

Unable to get exact steps as shown on Google fit app

我尝试了适合 google 的数据源 api 中列出的所有来源。 但是,我无法准确匹配 fit 应用程序上显示的步数。 APIs 返回的响应使用起来很麻烦。本来可以更具体的,比如在什么时候使用 API。另外,我在 15 分钟前走了 91 步。但是,在发出 API 请求后,我仍然无法获取该数据。它只是显示陈旧的数据。不确定它是否支持实时。我的 wifi 连接很好,但数据似乎还没有上传到 google 云端。不过,Fit 应用程序执行了 91 步。

以下是我的 api 请求:

GET /fitness/v1/users/me/dataSources/derived:com.google.step_count.delta:com.google.android.gms:estimated_steps/datasets/1429848000000000000-1429906530000000000 HTTP/1.1

结果总和与今天在 Google Fit App

上显示的步数不匹配

在 google 文档中。说

To record fitness data, use the Recording API to create a subscription for each data type you want to record.

使用Fitness.RecordingApi.subscribe订阅数据。然后用Fitness.HistoryApi.readDataFitness.HistoryApi.readDailyTotal来读。 或者您可以使用传感器 API 来监控阶跃变化。

我遇到了同样的问题,最终通过这种方式实现解决了它。

https://developers.google.com/fit/faq#how_do_i_get_the_same_step_count_as_the_google_fit_app