Is there a way to make the sampling frequency of the accelerometer in Android lower than the frequency set with the SENSOR_DELAY_UI constant?
I want to make my app eat less battery, and this looks like a good way to achieve that. (I’ve already slowed things down from SENSOR_DELAY_GAME to SENSOR_DELAY_UI, and the result was quite good — the battery lasted much longer.)
Would the sensor event listener even have an impact on battery life?
Or would filtering them and avoiding further CPU heavy computations only be sufficient in this case?
Thanks
You can input a value in microseconds as well as the preset rates. Call the method like this:
registerListener(SensorEventListener listener, Sensor sensor, int rate), whererateis either a integer value specified in microseconds or one of the following constants:Example:
Source document on the Android development site.