Google Fit API Activity History

家住魔仙堡 提交于 2019-12-20 04:18:04

问题


I have an app that integrates with Google Fit. One of the requirements is display a users favorite activity (most frequent) i.e.: bicycling. I assume it would be done through the History API, but I'm not sure how to gather all activities so I can calculate the most common one.

Anybody have any idea how to go about doing that?


回答1:


You can check this documentation: Work with the Fitness History to get most frequent activity of the user. First, you need to read data from the fitness history by creating a subscription for each fitness data type you'd like to record. This enables your app to sync with data from other devices, and also allows for the passive recording of data on the device. Then create a DataReadRequest instance. You can see the sample code in the documentation.

The data request can specify multiple data types to return, effectively combining multiple data queries into one call. With this, you can compare which activity the user used most.



来源:https://stackoverflow.com/questions/39737598/google-fit-api-activity-history

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!