Uri intent send to calendar

430 views
Skip to first unread message

schotterfahrer

unread,
Nov 22, 2015, 8:02:14 PM11/22/15
to Sailforms Users
Can anyone help me how to send the content of fields to the calendar?
I prefer sending it to an existing event, but adding it as new event in the calendar would be better than nothing.
I think it could be done with uri intent?

MikeG

unread,
Nov 26, 2015, 9:14:48 AM11/26/15
to Sailforms Users
As we don't appear to have any experts on the Android calendar intent interface here, I thought I'd try to investigate. I'm certainly no expert, so any information here is the results of internet searches and Sailforms experiments. Internet searching in this area is not straightforward (to me) as nearly all the results are aimed at Java programmers (not me!!!).

1. The Android standard calendar interface became available at Android API level 14, which means you need Android 4.0 or later.

2. Adding a calendar entry uses the insert URI intent (available in Sailforms) but changing an entry uses the edit URI intent (not available in Sailforms).

3. Ideally one should use an implicit URI intent as that should work with any calendar app (that supports the standard interface) rather than an explicit intent that is directed to a specified app.

4. On a Nexus 7 running Android 6.0 the Google calendar events interface is successfully found by the string:
com.android.calendar/events
but I don't know for certain whether that is an implicit or an explicit intent!!!

5. The insert intent, having found the calendar, does not put the information straight into the calendar (leaving the user in Sailforms) but presents a calendar event creation window displaying any information it could find from the intent parameters (extras in Android-speak) giving the user the option to complete and save the entry, or discard it.

6. The Sailforms URI intent commands allow (as far as I can work out) only string parameters to be passed to the app. In particular, for a calendar entry, this means I can find no wayc of passing to the calendar:
- event start time (long integer, "milliseconds since epoch"),
- event end time (ditto),
- calendar id if the app holds more than one (integer)

7. To send a new event to the calendar you need a URI intent of type insert, with the following text string:
content://com.android.calendar/events?title=event_title
where event_title is the title for the event.

8. Further string parameters (in addition to the title) can be added at the end of the string in the format:
&parameter_name=parameter_value
Potentially useful (and working) parameters are:
eventLocation
description

Right. That's as much as I have been able to achieve. I've attached my test form.

Have we any experts out there who can take us further?

Mike

Calendar.sfg

Andre Lam

unread,
Dec 1, 2015, 10:45:19 AM12/1/15
to Sailforms Users
Hi!

MikeG, you already have done a part of a job i was even afraid to start ), although i'm very interested in inserting events in calendar. So thank You very much!

I also did not find a way to send start time, not with dtstart, non with beginTime.
I am not an expert either, so may be Chris would help us here!

Best regards!

MikeG

unread,
Dec 1, 2015, 1:44:32 PM12/1/15
to Sailforms Users
Yes, I tried both dtstart and beginTime, but neither seemed to be recognised by the calendar app. But I fear that part of the problem may be that the time value is described as a long integer and I don't know how to pass that through the text URI.

Mike

Amos Cuevas

unread,
Apr 9, 2018, 2:27:22 AM4/9/18
to Sailforms Users
Is there any update for how to send start and end times to calendar events via android Intent???

ChrisRoald

unread,
Jul 30, 2020, 6:53:10 PM7/30/20
to Sailforms Users
Reply all
Reply to author
Forward
0 new messages