Calendar Provider (System Calendar) Integration into Android App

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Calendar Provider (System Calendar) Integration into Android App
Simple
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Integrating Calendar Provider (System Calendar) into Android Applications

The Android system calendar is accessible through CalendarProvider—a standard Content Provider available since API 14. Most applications use one of two scenarios: reading existing events or creating new ones. Both require runtime permissions and proper URI handling.

Permissions

For reading, use READ_CALENDAR; for writing, use WRITE_CALENDAR. Both are dangerous permissions, requested via ActivityCompat.requestPermissions() or ActivityResultContracts.RequestPermission(). Without explicit runtime requests on Android 6+, you get SecurityException.

Reading Events

Events are stored in the CalendarContract.Events table. Query via ContentResolver:

val projection = arrayOf(
    CalendarContract.Events._ID,
    CalendarContract.Events.TITLE,
    CalendarContract.Events.DTSTART,
    CalendarContract.Events.DTEND,
    CalendarContract.Events.CALENDAR_ID
)

val selection = "${CalendarContract.Events.DTSTART} >= ? AND ${CalendarContract.Events.DTEND} <= ?"
val selectionArgs = arrayOf(
    startMillis.toString(),
    endMillis.toString()
)

val cursor = context.contentResolver.query(
    CalendarContract.Events.CONTENT_URI,
    projection,
    selection,
    selectionArgs,
    "${CalendarContract.Events.DTSTART} ASC"
)

cursor?.use {
    while (it.moveToNext()) {
        val title = it.getString(it.getColumnIndexOrThrow(CalendarContract.Events.TITLE))
        val dtStart = it.getLong(it.getColumnIndexOrThrow(CalendarContract.Events.DTSTART))
        // process
    }
}

Important: use getColumnIndexOrThrow() instead of getColumnIndex()—if the column is missing from the projection, it fails immediately with a clear exception rather than ArrayIndexOutOfBoundsException somewhere in business logic.

Creating an Event

val values = ContentValues().apply {
    put(CalendarContract.Events.CALENDAR_ID, calendarId)
    put(CalendarContract.Events.TITLE, "Team Meeting")
    put(CalendarContract.Events.DTSTART, startMillis)
    put(CalendarContract.Events.DTEND, endMillis)
    put(CalendarContract.Events.EVENT_TIMEZONE, TimeZone.getDefault().id)
    put(CalendarContract.Events.DESCRIPTION, "Release v2.1 discussion")
}

val uri = context.contentResolver.insert(CalendarContract.Events.CONTENT_URI, values)
val eventId = uri?.lastPathSegment?.toLong()

EVENT_TIMEZONE is a mandatory field. Without it, the event is created in UTC, and users see incorrect times after a timezone change. This is a classic error that reaches production and manifests in users from other regions.

Adding a Reminder

val reminderValues = ContentValues().apply {
    put(CalendarContract.Reminders.EVENT_ID, eventId)
    put(CalendarContract.Reminders.MINUTES, 15)
    put(CalendarContract.Reminders.METHOD, CalendarContract.Reminders.METHOD_ALERT)
}
context.contentResolver.insert(CalendarContract.Reminders.CONTENT_URI, reminderValues)

Opening System UI

If your app doesn't need direct data access but only wants to open the standard event-creation interface, use Intent without permissions:

val intent = Intent(Intent.ACTION_INSERT).apply {
    data = CalendarContract.Events.CONTENT_URI
    putExtra(CalendarContract.Events.TITLE, "Event Title")
    putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, startMillis)
    putExtra(CalendarContract.EXTRA_EVENT_END_TIME, endMillis)
}
startActivity(intent)

This is simpler, safer, and doesn't require permissions. It suits most cases where the app doesn't maintain its own event list.

Integrating CalendarProvider takes 1–3 days depending on feature scope: reading events, creating them, synchronizing multiple accounts. Cost is calculated individually.