Thursday, July 28, 2011

Start custom Service when Android starts up

Another interesting part of the RemindMe development is considering what happens when the phone is powered up.
The Reminder service must be "woken up" for it to be useful.

The way to do this, is to create a receiver, and hook it up to the android action BOOT_COMPLETED

In the AndroidManifest.xml, declare the following receiver:

With this, every time the phone is powered up, after boot is complete, AlarmBroadcastReciever will be called, which sets up the inexactRepeatingAlarm mentioned in my previous post.

No comments:

Post a Comment