Home » Android » Android accelerometer, sensor usage and power consumption

Android accelerometer, sensor usage and power consumption

Posted by: admin June 15, 2020 Leave a comment

Questions:

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!

How to&Answers:

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.