简体   繁体   中英

Should I use an AlarmManager or a CalendarProvider

I was recently working on a reminder type app, where the user can select a future date (may be in days or months) from a calendar/date picker and will be notified about that event at the selected date.

I have come across AlarmManager & CalendarProvider .

AlarmManager , the docs say this would be cpu intensive as it would run in background. And am not sure if CalendarProvider will do the right job. Or is there some better option to implement this in android.

Thanks in advance, sorry if my question is too trivial.

The Calendar Provider is a repository for a user's calendar events. The Calendar Provider API allows you to perform query, insert, update, and delete operations on calendars, events, attendees, reminders, and so on.

The Calender Provider API can be used by applications and sync adapters. The rules vary depending on what type of program is making the calls. This document focuses primarily on using the Calendar Provider API as an application.

AlarmManager is used to set Alarm Programmatically. And it will call the Service called/catches them Trigger in the Application. Calendar Provider add Remainder to Your Calendar which can be synced with various devices using the same Google Account. Where AlarmManager will help you to set the Alarm on the Current Device Which is using Your Application.

If you are using alarm manager who has to invoke a Boot Complete Reciever Since all Alarm Managers will be dismissed during Rebooting the System

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