Events are stored as CalendarContract.Events in the Android calendar provider. These iCalendar properties are mapped to Android fields:
LOCATION↔ event location
COLOR↔ event color (only if enabled in DAVdroid account settings)
DTSTART↔ start date/time, event timezone / all-day event
DURATION↔ end date/time, event end timezone / all-day event
CLASS↔ access level
Events are considered to be all-day events when
DTSTART is a date (and not a time). All-day events
- without end date or
- with an end date that is not after the start date
are stored with a duration of one day for Android compatibility.
VALARM components are mapped to CalendarContract.Reminders records and vice versa.
Reminder methods (
ACTION) are mapped to Android values as good as possible.
EXDATE values are stored in the respective Android event fields. The Android calendar provider uses these fields to calculcate the instances of a recurring event, which are then saved as CalendarContract.Instances so that calendar apps can access them.
Exceptions of recurring events are identified by
RECURRENCE-ID. DAVdroid inserts exceptions as separate event records with
ORIGINAL_SYNC_ID set to the
SYNC_ID of the recurring event and
ORIGINAL_TIME set to the
DAVdroid is not responsible for calculating the instances of a recurring event. It only provides
EXDATE and a list of exceptions to the Android calendar provider.
ATTENDEE properties are mapped to CalendarContract.AttendeesColumns records and vice versa.
Events with at least one attendee are considered to be group-scheduled events. Only for group-scheduled events, the
- is imported from iCalendars to the Android event so that only the organizer can edit a group-scheduled event,
- is exported from the Android event to the iCalendar.
DAVdroid is able to process events with all valid time zones (
VTIMEZONE). If a certain time zone is referenced by name but no
VTIMEZONE component is provided, DAVdroid uses the default time zone definitions from ical4j (Olson DB).
When an iCalendar references a time zone which is not available in Android, DAVdroid tries to find an available time zone with (partially) matching name. If no such time zone is found, the system default time zone is used. The original value will be shifted to the available time zone. For instance, if an event has a start time of 10:00 Custom Time Zone, DAVdroid will use the Custom Time Zone
VTIMEZONE to calculate the corresponding time in the system default time zone, let's say 12:00 Europe/Vienna, and then save the event as 12:00 Europe/Vienna.
Because the Android calendar provider can only process events with time zones which are available in Android, recurring events in time zones which are not available in Android and their exceptions may not be expanded correctly.
ACCESS_LEVEL = ACCESS_DEFAULT("server default")
ACCESS_LEVEL = ACCESS_PUBLIC("public")
ACCESS_LEVEL = ACCESS_PRIVATE("private")
ACCESS_LEVEL = ACCESS_CONFIDENTIAL(currently not supported by most calendar apps, which will reset the access level to
ACCESS_PRIVATEwhen the event is edited); additionally,
CONFIDENTIALis stored as original value
CLASSvalue (x-name or iana-token) →
ACCESS_PRIVATE; additionally, the value is stored as original value
In the other direction, the locally stored access level is mapped to
CLASS like that:
ACCESS_LEVEL = ACCESS_PUBLIC("public") →
ACCESS_LEVEL = ACCESS_PRIVATE("private") →
ACCESS_LEVEL = ACCESS_CONFIDENTIAL("confidential", if available in calendar app) →
ACCESS_LEVEL = ACCESS_DEFAULT("server default") →
- if there is an original value: use that value
CLASSotherwise (same as
iCalendar properties which are not processed by DAVdroid (like X- properties) are retained (unless they're larger than ≈ 25 kB). When importing an iCalendar, DAVdroid saves all unknown properties as CalendarContract.ExtendedPropertiesColumns records. When the respective event has been modified and DAVdroid generates the iCalendar again, it includes all unknown properties.
These iCalendar properties are processed/generated by DAVdroid and cannot be changed by users:
PRODIDis set to the DAVdroid identifier
UIDis used to identify an iCalendar (for new iCalendars, a random UUID will be generated)
RECURRENCE-IDis used to identify certain instances of recurring events
SEQUENCEis increased when an iCalendar is modified
DTSTAMPis set to the current time when generating an iCalendar