Google Fit位置资料来源

问题描述

在我的网络应用程序(python)中,我获得了用户的许可,可以使用“ https://www.googleapis.com/auth/fitness.location.read”范围。 我应该使用什么数据源从Google Fit获取历史位置数据?

例如,我的步骤数据源如下所示: STEPS_DATASOURCE =“派生的:com.google.step_count.delta:com.google.android.gms:estimated_steps”

我认为我需要的数据源的开头应类似于以下“ derived:com.google.location ......”。

解决方法

derived:com.google.location.sample

此数据类型捕获用户的位置。因为每个数据点都代表读取时用户的位置,所以仅应设置结束时间。这将用作阅读的时间戳。

但请注意

此数据只能由写入数据的应用程序读取。您的应用只能读回其写入的数据。它无法读取其他应用编写的位置样本数据。

来源https://developers.google.com/fit/datatypes/location#location_sample