7-13. Interacting with the Calendar

Problem

Your application needs to interact directly with the ContentProvider exposed by the Android framework to add, view, change, or remove calendar events on the device.

Solution

(API Level 14)

Use the CalendarContract interface to read/write data to the system’s ContentProvider for event data. CalendarContract exposes the API that is necessary to gain access to the device’s calendars, events, attendees, and reminders. Much like ContactsContract, this interface defines mostly the data that is necessary to perform queries. The methods used will be the same as when working with any other system ContentProvider.

How It Works

Working with CalendarContract is very similar to working with ContactsContract ...

Get Android Recipes: A Problem-Solution Approach, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.