I'm new to Android development, so I might be missing something obvious. I want to launch an
Activity when the user's phone clock hits a specified time (similar to an alarm). However, I'm not sure how I would go about doing this as constant polling of the clock seems inefficient and a waste of resources. Do I need to capture broadcast events from the clock, or use
PendingIntents? If someone could point out some <strong>SDK methods/services</strong> I should read about, it would be much appreciated.
Take a look at the docs for <a href="http://developer.android.com/reference/android/app/AlarmManager.html" rel="nofollow">android.app.AlarmManager</a>.
This class allows your application to schedule PendingIntents for broadcast at specific times, which sounds like exactly what you're looking for. Just schedule a PendingIntent that launches the desired application.
Be aware that when your alarm fires, the phone will be prevented from sleeping until (and only until)
onReceive() finishes executing. If you need to keep the phone awake longer, you may need to implement your own wake lock.