简体   繁体   English

活动识别-如何使用它

[英]Activity Recognition - how to use it

I'm looking for a solution which safes the battery in my "location based app". 我正在寻找一种解决方案,可以保护“基于位置的应用”中的电池安全。 I got a question to the Activity Recognition, which provides Google for Android. 我对活动识别提出了一个问题,该活动提供了Android版Google。 Actually I got the problem that my phone will only recognize my current "activity" when the phone is awake. 实际上,我遇到了一个问题,那就是当手机处于唤醒状态时,手机只会识别我当前的“活动”。 When screen turned off, the recognition doesn't do it's job. 当屏幕关闭时,识别不起作用。 After unlocking the phone (screen on) the recognition resumes. 解锁手机(屏幕上)后,恢复识别。 Is that normal? 那是正常的吗? I can't imagine, because the API provides activities like "riding bike" - who had ever his screen on while riding a bike?! 我无法想象,因为该API提供了诸如“骑自行车”之类的活动-骑自行车时谁曾看过他的屏幕?

Is there any other good approach how to check if somebody is driving a car? 还有什么其他好的方法可以检查是否有人在开车? Will it be possible with other sensors (like accelerometer)? 其他传感器(例如加速度计)是否有可能? Please let me know. 请告诉我。 I'm grateful for every little advice. 我很感谢每一个小建议。

Thanks in advance. 提前致谢。

In order to save user's device battery, activity recognition detection stops once the device goes to sleep. 为了节省用户设备的电池电量,一旦设备进入睡眠状态,活动识别检测就会停止。 If your application is some kind of Fitness app that user turned on (and knows that it may be draining the battery) you can keep tracking user's activity from your service using one of the following methods: Keeping the Device Awake . 如果您的应用程序是用户打开的某种Fitness应用程序(并且知道它可能正在消耗电池),则可以使用以下方法之一继续跟踪服务中用户的活动: 保持设备保持唤醒状态

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM