Thanks for ur reply =]
But what i wonder is, if i only update the battery state every 5 mins,
the update would be a bit too late.

I can see on the market there is some battery widget doing the same
(i.e. give immediate response when the phone is plugged to the AC),
how can i do the same??

for the music player, the problem is, if accidentally the service is
killed, my app will be totally crapped. I use singleton on my service
and start it when my app is started, and control the media player
through the service. So if the service is died at some point, if i
want to get the playback time or do anything with the service, my app
will not be working anymore. Are there any better implementation can
be done on my app? I feel so frustrated about it...

On Apr 9, 7:10 pm, lbendlin <l...@bendlin.us> wrote:
> for the battery monitor an alarm manager is sufficient. No need to measure
> the battery more frequent than, let's say, every five minutes.
>
> for the music app use a foreground service. That is less likely to get
> killed by the OS. Make sure it can easily be killed by the user though.

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

Reply via email to