行为识别API不连续工作 [英] Activity Recognition API does not work continuously

查看:208
本文介绍了行为识别API不连续工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我测试行为识别API中2的应用程序:谷歌样品code和执行这一code。在我的应用程序。

I'm testing Activity Recognition API in 2 apps : Google sample code and implementation of this code in my app.

现在的问题是这两个应用程序弟妹行为识别不错,但几个小时后,意图服务停止,我没有从他们两人中的任何行为识别。

The problem is both apps keeps getting activity recognition fine but after a few hours the intent service stops and i'm not getting any activity recognition from both of them.

任何想法,为什么即使我已经测试过地理围栏API意图的服务,它的工作永远没有停止的意图服务停止?

Any idea why the intent service stops even though i've tested geofencing api with intent service and it's working forever without stopping?

推荐答案

您IntentService可能停,我会说:睡着了,因为:

Your IntentService might "stop", I would say "fall asleep" because of:

要节省电池,活动报告时可能会停止该设备   静止的时间延长的时间。它将继续一旦设备   再次移动。这只发生在支持的设备   Sensor.TYPE_SIGNIFICANT_MOTION硬件。

To conserve battery, activity reporting may stop when the device is 'STILL' for an extended period of time. It will resume once the device moves again. This only happens on devices that support the Sensor.TYPE_SIGNIFICANT_MOTION hardware.

基本上,它应该是最符合API设备> = 20。

Basically it should be the case for most of the devices with API >= 20.

请找到更多的<一个href="https://developers.google.com/android/reference/com/google/android/gms/location/ActivityRecognitionApi"相对=nofollow>这里。

不幸的是,你只能要求活动更新,这是不可能迫使 ActivityRecognitionApi ,以不断赋予哪怕是还是一些神秘的较长一段时间内当前活动。

Unfortunately, you can only request activity updates and it is impossible to force ActivityRecognitionApi to continuously give current activity even if it is "still" for some mysterious "extended period of time".

在我看来,这会如果ActivityRecognitionApi的这一特点是配置方便多了。

In my opinion, it would much more convenient if this feature of ActivityRecognitionApi was configurable.

这篇关于行为识别API不连续工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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