1) API interface
Android.content.ContentProvider
Android.content.ContentResolver
Android.provider.CalendarContract
In addition, when creating a calendar account (inserting a piece of data into the system's calendars table), you need to set the adapter mode to view Calendarcontract help.
2) Periodic rule string Rrule
The specific composition of rrule can be referred to RFC5545, but it should be noted that the Android system is not hundred percent support for the standard, only support the basic function of the label (the equal sign linked to the key value pair, I call it tag).
- The first day of March of every year
freq=yearly;lnterval=1; Bymonthday=1; Bymonth=3
- The last day of March every year
freq=yearly;lnterval=1; Bymonthday=-1; Bymonth=3
- Last working day of the month
freq=monthly;lnterval=1; BYDAY=MO,TU,WE,TH,FR; Bysetops=-1
- Last weekend of the month
freq=monthly;lnterval=1; Byday=su,sa; Bysetops=-1
- The 30th day of the month (if not, take the last day, Android phone does not support)
freq=monthly;lnterval=1; bymonthday=28,29,30; Bysetops=-1
- Every two weeks Friday Sunday (frequency is week mode and the interval is greater than 1 o'clock the first day of the specified week is required, the interval of the weekly frequency is greater than 1 o'clock must be specified wkst)
freq=weekly;lnterval=2; BYDAY=SU,FR; Wkst=su
3) master-Slave relationship binding of periodic recurrence schedule and its exception schedule
Set the number of 3 fields for the exception schedule:
ORIGINAL_ID, Periodic schedule of LD
Original_instance_time, the start time of the instance of the cycle schedule
Original_all_day, whether the full-day flag of the cycle schedule
4) Other details handling
The cut-off time in the rrule extends to 23 points in the day, 59 minutes, 59 seconds, 999 milliseconds, preventing the dislocation of the schedule events on individual aircraft from appearing on the following day.
Some Essentials of Android calendar sync