本文介绍了如何识别手动输入或由传感器跟踪的Google Fit活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个可查询Google Fit API的Android应用程序,以检索步数,卡路里和距离"参数.我们要查询不是由用户手动输入的活动(或以某种方式标识这些活动并忽略它们).

We are working on an Android application which queries Google Fit API to retrieve Steps, Calories and Distance parameter. We want to query activities which are NOT manually entered by user (or somehow identify these kind of activity and ignore them).

用户可以手动加载步行",跑步"等活动,我们希望忽略此类活动.我们研究了History API和Activity字段,但似乎无法识别是由其他应用程序,手机传感器还是可穿戴设备手动记录还是自动添加了活动.

User's can manually load Walking, Running etc activity, and we want to ignore such activities. We looked into History APIs and Activity Fields, but it seems there is no way to identify whether activities are manually logged or automatically added by other apps OR phone sensors OR wearable devices.

有人可以知道获取用户未手动记录的活动的方法吗?

Can someone knows a way to get activities which are not manually logged by user?

更新

在Google Fit开发者社区中检查以下线程,这可能会对某人有所帮助

Check below thread on Google Fit Developer Community, it may help someone

https://plus.google.com/u/0/105650643673857572241/posts/fET6zKYFq4K

推荐答案

这可能不是识别传感器检测到的步骤的正确方法,但是经过一些测试,它几乎与我认为由传感器记录的步骤相匹配.

This may not be the correct way to identify sensor detected steps, but with some testing, it almost matches steps which I think recorded by sensor.

数据源 ds = DataPoint.getOriginalDataSource()

String dataStream = ds. getStreamIdentifier()

String dataStream = ds.getStreamIdentifier()

如果"dataStream"字符串包含soft_step_delta,则我们可以假定步骤是从电话传感器记录的.我尚未在可穿戴设备上进行过测试.

If "dataStream" string contains soft_step_delta, then we can assume that steps are recorded from phone sensor. I haven't tested it with wearable device.

这篇关于如何识别手动输入或由传感器跟踪的Google Fit活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 08:19