05-04-2010 08:13 AM
Recently, I've found that my application causes a lot of battery drain even when running in the background. The reason was one TimerTask running at 20 Hz. I started cancelling it when it was not needed and the problem went away.
However,I guess I went overboard while doing it as I'm cancelling the Timer as well, restarting both (Timer and TimerTask) when necessary. Would just cancelling the TimerTask solve the problem? In other words, is an active Timer without scheduled tasks a battery drain? Or is it just a Thread that is permanently blocked? I can find out myself, but if anyone has done such experiments, please let me know.
If there is no response here, I'll respond to this post with my own findings in a few days.
05-04-2010 08:26 AM
05-04-2010 08:27 AM
Can u please elaborate what kind of task your application is doing in the background..........?...........It may be ur application doing some gps , internet connection tasks after scheduled intervals .............Timer task generally (if your application not using gps,internet ) doesn't drain battery.... it just invokes specified task after some regular intervals..................But am not Knighted on this, this info is am giving only with my best of knowledge