Access Calendar Events And Reminders In Delphi XE6 Firemonkey On Android

Delphi XE6 Firemonkey Android Calendar Events ManagerDeveloper Khalid N. contributed an Android calendar event manager class and demo for Delphi XE6 Firemonkey. The class wraps the Android calendar provider which you can find out more about here. It uses the JNI to access the information and is a good example of how to use the Content Resolver in Delphi. The content resolver is also used for accessing other things like the device contacts. In order to access the calendar you need to have read and write permissions set in your Android manifest (android.permission.READ_CALENDAR and android.permission.WRITE_CALENDAR). It has functions to get the list of available calendars, add a reminder, update a reminder, delete a reminder, and set the completed state of a reminder. The code should work with a few minor changes in Delphi XE5 and AppMethod. The content Here is a sample function from the code where it demonstrates how to use the Content Resolver:

Download the Calendar Event Manager demo for Delphi XE6 Firemonkey.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

4 Responses to Access Calendar Events And Reminders In Delphi XE6 Firemonkey On Android

  1. Yuriy says:

    This solution does not work. When you create a calendar, an error is returned:
    No calendar found on the device”

    P.S. It is tested on XE7 and android virtul device.

    • Admin says:

      The error sounds pretty clear. The virtual device has no calendar? Maybe a Calendar app has to be installed?

      • Yuriy says:

        I added the following code TCalendarEventsManager.Create at the beginning:
        fCalendarID := CreateNewCalendar;
        it worked

        P.S. I added parameters function TCalendarEventsManager.AddNewReminder:
        – isAllDay
        – BeginTime
        – EndTime

  2. Pingback: Anonymous

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Admob Interstitials Demo Source Code Using The Android JNI In Delphi XE5 Firemonkey

Developer Sadettin Polat wrote in with a link to a demo he wrote which implements AdMob interstitials in Delphi XE5...