Some Essentials of Android calendar sync

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.