Android的加速度计,传感器的使用情况和功耗 [英] Android accelerometer, sensor usage and power consumption

查看:287
本文介绍了Android的加速度计,传感器的使用情况和功耗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有关于Android设备的加速度计一个快速的问题。是不是总是在/主动?鉴于加速计用于检测设备,横向或纵向的方向。

在官方文件(的SensorManager ),它指出,传感器应被关闭​​,以节省电力。但我不知道这仅适用于其他传感器,如磁场传感器,陀螺仪,光线感应器等。

我需要为省电的情况下,我不希望做的说,加速计有时被禁用的错误,而是用它来禁用其他传感器(以罗盘功能的目的应用程序)。

或者是由只与被注册为接收所述数据的应用程序,而简单地上或启用的加速度计电池的消耗是不相关的,因为它始终是?

感谢任何澄清!

解决方案
  

或者是由只与一个加速度计电池消耗   被注册用于接收数据的应用程序,而简单地上   或启用是不相关的,因为它始终是?

这是正确的。

这是你的应用程序运行的功耗结果,并注册了传感器事件。这样可以使你的应用程序运行所有的时间,保持它消耗CPU,并有可能可以保持设备进入休眠状态。

据我所知,没有办法关闭传感器。现在,这并不是说,该装置不巧妙关闭传感器,如果没有什么听他们。我不知道,但似乎有可能。无论如何,再次触发是听他们的,所以我不认为它使您的问题有所不同。

I have a quick question about the accelerometer in Android devices. Is it always on/active? Given that accelerometer is used to detect the orientation of the device, either landscape or portrait.

In the official documentation (SensorManager) it states that sensors should be turned off to save power. But I wonder if this only applies to others sensors like magnetic field sensors, gyroscope, light sensor and so on.

I need to make a case for power conservation and I don't want to make the mistake of saying that the accelerometer can at times be disabled, and instead use it for the purpose of disabling other sensors (in compass features of the application).

Or is the battery consumption by an accelerometer only related to an app being registered for receiving the data, while simply being "on" or enabled is not relevant since it always is?

Thanks for any clarification!

解决方案

Or is the battery consumption by an accelerometer only related to an app being registered for receiving the data, while simply being "on" or enabled is not relevant since it always is?

That's correct.

The power consumption results from your app running and registered for sensor events. This keeps your app running all the time, keeps it consuming CPU, and potentially can keep the device from sleeping.

As far as I know, there's no way to shut down the sensors. Now, that is not to say that the device does not smartly shut down the sensors if there's nothing listening to them. I don't know that, but it seems likely. Regardless, again, the trigger is listening to them, so I don't think it makes a difference for your question.

这篇关于Android的加速度计,传感器的使用情况和功耗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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