Google Fit Api过滤器手动添加的活动 [英] Google Fit Api filter manually added activities

查看:107
本文介绍了Google Fit Api过滤器手动添加的活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Fit 允许用户手动和以编程方式添加活动.是否可以从Android Api或REST Api中手动或以编程方式过滤掉添加的活动?

Google Fit allows users to add activities manually and programatically. Is it possible to filter out manually or programtically added activities from either the Android Api or the REST Api?

我只想查询在执行时实际跟踪和记录的活动.

I want to query for only activities that were actually tracked and recorded at the time they were performed.

推荐答案

根据文档,没有正确的方法.但是我找到了一些解决方案来识别Android API中的手动和自动跟踪的活动.

There is no proper way according to the documentation. But I found some solution to identify manual and automatic tracked activities in Android API.

DataSource ds = DataPoint.getOriginalDataSource()
String streamData = ds.getStreamIdentifier()

如果"streamData"包含"user_input",则假定活动为手动活动,或者包含详细"以表示实际传感器记录的活动.

If "streamData" contains "user_input", then it assumes the activities to be manual activities, either it contains "detailed" for actual sensor recorded activities.

这篇关于Google Fit Api过滤器手动添加的活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆