I'm developing an android program in which I am using a service to capture data from the accelerometer. I used the wakelock to continue capturing data even with the screen off. Also a TimerTask to ensure that the data will be read every 50 milliseconds. I used a broadcast receiver to re-register the event listeners after a screen-off event. With the screen lit everything is ok, but when the screen goes off, there is a delay and the data are captured approximately every 800ms. Even without using the accelerometer, the delay occurs in this function TimerTask. I also tried using a hanlde and setting a delay for thread 50 ms, but the delay of the blank screen persists. I'm using a motorola razr and android jelly bean. Can anyone help me? Thanks!
Asked
Active
Viewed 295 times
2
-
You need to include sample code, specifically of the wakelock – Ryan S Jul 05 '13 at 04:07
-
I am observing the same behaviour and can't resolve it. On my Galaxy Nexus I get around 3600 updates per minute on SENSOR_DELAY_GAME, but when the screen is of the count gets down to 300-500 per minute. – Nikolay Tsenkov Aug 28 '13 at 14:37
-
Just being curious, what happens using the emulator? – M. Mimpen Dec 13 '13 at 15:05