2

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!

0 Answers0