简体   繁体   中英

what the best practice to implement and alarm and reminder in android?

I'm trying to add alarm feature to my app or reminder with notification and I found a tutorial uses Alarmmanger for that but I wonder if is a new way is better for that, is workmanger good over alarmmanger? the function of the app gonna be like that:

  • user add a note with time and date and choose which he prefers to remember the note as alarm or reminder
  • if it is alarm, the phone gets and alarm notification with ring sound and dismiss button on notification and if he clicks on the notification he get back to the app with alarm screen and he able to dismiss it or postpone
  • if it is a reminder, the phone gets a simple notification with sound with dismiss button in the notification. so what is the best practice to do that, and it would be favor if you provide with me with tutorials about how to implement that

https://developer.android.com/guide/background#recommended-solutions

Per your description, it seems you fall under:

Exact tasks

A task that needs to be executed at an exact point in time can use AlarmManager. To learn more about AlarmManager, see Schedule repeating alarms .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM