Android Programming Press on the image to return to the main documentation page.

calendar2

Written by Edward Smith

List of types:

MyCalendar

MyCalendar


Permissions:

android.permission.READ_CALENDAR
android.permission.WRITE_CALENDAR

Events:

None

Members:


  AddEventAttendee (eventID As Int, Name As String, Email As String, Relationship As String, Type As String, Status As String)

  CreateEvent (CalID As Int, Title As String, Desc As String, Location As String, StartTime As Long, EndTime As Long, RRule As String, AllDay As Boolean) As String

  CreateEventWithReminder (CalID As Int, Title As String, Desc As String, Location As String, StartTime As Long, EndTime As Long, ReminderTime As Long, RRule As String, AllDay As Boolean) As String

  DeleteCalendarEntry (entryID As Int) As Int

  GetAllTimeZones As String()

  GetEventDetails (eventId As Int) As Map

  GetExtendedListOfAllCalendars (AccessLevel As Int) As List

  GetListOfAllCalendars (Own As Boolean) As Map

  GetListofAllEventsforCalendar (calID As Int) As List

  GetListofEventsforCalendarBetweenDates (calID As Int, StartTime As Long, FinishTime As Long) As List

  GetListofEventsforCalendarSpanningTimes (calID As Int, StartTime As Long, FinishTime As Long) As List

  Initialize

  ListExtendedCalendarEntryDetails (eventId As Int) As Map

  ListofEventsWithDescKeywordBetweenDates (calID As Int, Keyword As String, StartTime As Long, FinishTime As Long) As List

  ListofEventsWithTitleKeywordBetweenDates (calID As Int, Keyword As String, StartTime As Long, FinishTime As Long) As List

  UpdateEvent (eventID As Int, Title As String, Desc As String, Location As String, ChangeTime As Boolean, StartTime As Long, EndTime As Long) As Int

Members description:

AddEventAttendee (eventID As Int, Name As String, Email As String, Relationship As String, Type As String, Status As String)
Add an attendee to an event using the Event ID
eventID: Event ID (required)
Name: Name of person (not required)
email: Email of person (required)
Relationship: One of "ATTENDEE" "ORGANIZER" "PERFORMER" "SPEAKER" "NONE" (required)
Type: One of "REQUIRED" "OPTIONAL" "NONE" (required)
Status: One of "ACCEPTED" "DECLINED" "INVITED" "TENTATIVE" "NONE" (required)
CreateEvent (CalID As Int, Title As String, Desc As String, Location As String, StartTime As Long, EndTime As Long, RRule As String, AllDay As Boolean) As String
Creates a new calendar event in the selected calendar using it's ID
returns new event ID
CalID: Calendar ID as found in 'GetListOfAllCalendars'
Title: Title for the Event
Desc: Description of the Event
Location: Location of the Event
StartTime: Start Time of the Event in milliseconds from epoch
EndTime: Finish Time in milliseconds from epoch
RRule: String containing the Recurring Rule, Pass null if no recurring
AllDay: Set to 'True' if all day event. The start and finish time must be on a midnight boundary
CreateEventWithReminder (CalID As Int, Title As String, Desc As String, Location As String, StartTime As Long, EndTime As Long, ReminderTime As Long, RRule As String, AllDay As Boolean) As String
Creates a new calendar event with reminder in the selected calendar using it's ID
returns new event ID
CalID: Calendar ID as found in 'GetListOfAllCalendars'
Title: Title for the Event
Desc: Description of the Event
Location: Location of the Event
StartTime: Start Time of the Event in milliseconds from epoch
EndTime: Finish Time in milliseconds from epoch
ReminderTime: Time in minutes to trigger the reminder
RRule: String containing the Recurring Rule, Pass null if no recurring see the following link for all the possibilities
iCalendar Details
AllDay: Set to 'True' if all day event. The start and finish time must be on a midnight boundary
DeleteCalendarEntry (entryID As Int) As Int
Deletes the specified calendar entry
entryID:
GetAllTimeZones As String()
Returns a full list (as an array) of all timezone names
GetEventDetails (eventId As Int) As Map
Returns event details using it's ID
eventId: Event ID
Returns a map with the following items, map will have size = 0 if there is no matching event
Title Title for the Event
Desc Description of the Event
Location Location of the Event
StartTime Start Time of the Event in milliseconds from epoch
EndTime Finish Time in milliseconds from epoch
AllDay 1 if all day otherwise 0
Duration The duration of the event in RFC2445 format
HasAlarm 1 if has alarm 0 otherwise
RRule String containing the Recurring Rule.
GetExtendedListOfAllCalendars (AccessLevel As Int) As List
Returns a list of calendars based on the user Access Level.
Use -1 to return all calendars
NO_ACCESS = 0
FREEBUSY_ACCESS = 100
READ_ACCESS = 200
RESPOND_ACCESS = 300
OVERRIDE_ACCESS = 400
CONTRIBUTOR_ACCESS = 500
EDITOR_ACCESS = 600
OWNER_ACCESS = 700
ROOT_ACCESS = 800
Returns A LIST containing the following calendar fields: calID, name, displayName, colourName, location, timezone, accesslevel, owneracc
This sequence of 8 fields is repeated depending on how many calendars are returned.
The 'colorName' value for Android 4+ is a signed 3 byte integer of the RGB value (eg. 1484645 = 0x16A765)
For pre Android 4 the value appears to be a signed 4 byte integer of the ARGB value (eg. -14069085 = 0xFF2952A3)
The pre Android 4 colours are not an exact match for the Android 4+ colours (these are correct)
GetListOfAllCalendars (Own As Boolean) As Map
Returns a list of calendars and their ID in a Map, Index is the calendar ID.
The first named calendar is normally the 'Default' calendar and it's name is the same as your email, the
other calendars are either additional calendars created by you or calendars you subscribe to.
Own: Set to 'True' if you want only 'owner' Calendars
Return type: @return:A MAP containing the calendar name and ID
GetListofAllEventsforCalendar (calID As Int) As List
Returns a 'List' of all events for the specified calendar
calID: ID of the calendar to get the events from
Return type: @return:List of all events for calendar
GetListofEventsforCalendarBetweenDates (calID As Int, StartTime As Long, FinishTime As Long) As List
Returns a 'List' of all events for the specified calendar between the
specified dates
calID: ID of the calendar to get the events from
StartTime: Beginning time of the search in milliseconds from epoch
FinishTime: End time of the search in milliseconds from epoch
Return type: @return:List of all events for calendar between dates
GetListofEventsforCalendarSpanningTimes (calID As Int, StartTime As Long, FinishTime As Long) As List
Returns a 'List' of all events for the specified calendar that span
the specified dates
calID: ID of the calendar to get the events from
StartTime: Beginning time of the search in milliseconds from epoch
FinishTime: End time of the search in milliseconds from epoch
Return type: @return:List of all events for calendar that span dates
Initialize
Common initialisations
ListExtendedCalendarEntryDetails (eventId As Int) As Map
Get a list of the details for a calendar entry Including the Reminders and Attendees

Returns a Map with the following fields
hasAlarm
recurRule
duration
minutes
method
AttendeeName
AttendeeEmail
AttendeeStatus
The Attendee information can be repeated in groups of 3 depending on the number
of attendees.
See
Google Developer
eventId: The Event ID
ListofEventsWithDescKeywordBetweenDates (calID As Int, Keyword As String, StartTime As Long, FinishTime As Long) As List
Returns a 'List' of all events for the specified calendar between the specified
dates if the 'keyword' exists in the description
calID: ID of the calendar to get the events from
Keyword: String used in the search of the description
StartTime: Beginning time of the search in milliseconds from epoch
FinishTime: End time of the search in milliseconds from epoch
Return type: @return:List of all events for calendar between dates
ListofEventsWithTitleKeywordBetweenDates (calID As Int, Keyword As String, StartTime As Long, FinishTime As Long) As List
Returns a 'List' of all events for the specified calendar between the specified
dates if the 'keyword' exists in the title
calID: ID of the calendar to get the events from
Keyword: String used in the search of the Title
StartTime: Beginning time of the search in milliseconds from epoch
FinishTime: End time of the search in milliseconds from epoch
Return type: @return:List of all events for calendar between dates
UpdateEvent (eventID As Int, Title As String, Desc As String, Location As String, ChangeTime As Boolean, StartTime As Long, EndTime As Long) As Int
Updates a calendar event using the Event ID
eventID: Event ID
Title: New Title for the Event or "" if no change
Desc: New Description of the Event or "" if no change
Location: New Location of the Event or "" if no change
ChangeTime: If true then the values in StartTime and EndTime will be used to set the new time.
Even if only one time is changing both times must be supplied as the system can update both or neither not one.
StartTime: New Start Time
EndTime: New End Time
Top