Interacting with the Calendar
Overview
This guide outlines how to programmatically interact with a user’s calendar using intents or through the CalendarProvider.
(Needs Attention)
Using Intents to Manage the Calendar
For general usage of intents for interacting with the Calendar which is generally simpler but more limited when compared to content providers, check out this calendar intents guide and the official guide’s Calendar intents section, which notes that an app using these intents doesn’t need calendar read/write permissions because the Calendar app performs the operation.
See this tutsplus guide for details on how to add an event to the users calendar using intents.
Interacting with Calendar Content Provider
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.
You can check out the official docs for an overview. For retrieving calendars, see the guide’s “Query a calendar” section (under “Calendars table”), which shows how to get the calendars owned by a particular user; for retrieving calendar events within a time range, see its “Query the instances table” section (under “Instances table”).