views:

52

answers:

1

What is the best way to set an long-term alert/reminder from an Android application? I'd like to display notification in a few weeks after current date. I believe there is no need to write a service for such task. Will AlarmManager do the trick? Or should application be started daily and performing check?

After countdown was started, upcoming alert should survive upgrading application from Android Market.

+1  A: 

Use AlarmManager. Here is code snippet and link to wider code example by CommonsWare.

Konstantin Burov
AlarmManager does not survive reboot :-(
tomash
Then you have to re-setup alarms on boot. Take a look here http://android.arnodenhond.com/tutorials/alarm-notification#TOC-Proximity-Alerts
Konstantin Burov
As all I need is notifying user, I will probably stick with unofficial Calendar API and create calendar events with alert.
tomash