I am trying to design something with battery life in mind. I need to
trigger multiple tasks at multiple known times in the future.
Handler.postAtTime can't be used because the phone could sleep between
triggers, and the timing would then be inaccurate.

I can't add all the tasks to an AlarmManager since the intent I am
firing off is the same, they replace each other; I think I am down to
two ways to design this.

1) I can use TIME_TICK (which is how I am doing it now) and check
every minute to see if that is the time I want to perform my task, but
this seems bad for battery life. However, in testing, after 10 hours
of idle, it cost me about 10% of the used battery - I had 90% battery
life left, so I would assume that Time_Tick costs me about 1% of total
battery per 10 hours of idle, which doesn't seem too bad, but I have
no other apps to really measure it against.

2) This thought just came to me is that maybe I can use an alarm
manager to chain broadcasts; I could set an alarm for the first time I
need, then when that fires, look at the next time I need, and set an
alarm for that, and so on.

My question is, what are the trade offs? How efficient is the Alarm
Manager, and how does it work? As a general rule, are there any
suggestions someone can give me for designing for battery life?

Thanks,
 - Kenton

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to