java - Thread vs AlarmManager wich one has low battery usage -
what need in application stuff every 30 sec 18 hours per day want keep running device going sleep mode
found 2 ways:
- using timer using
alarmmanager
type ofalarmmanager.elapsed_realtime_wakeup
- using thread unfinished while-loop , sleep thread every 30 seconds.
now using timers, works fine in api versions have 1 problem , that's battery usage.
my question is, can use thread instead of timers? heard somewhere threads cannot run long times (5sec max), i'm not sure.
, if can use thread, take lower power timers?
, works api versions?
here description of question http://www.vogella.com/tutorials/androidtaskscheduling/article.html
Comments
Post a Comment