Hi all I am new to android. I parsed the calendar file. I need to add events to Google calendar from my application. I am using eclipse ide. In eclipse how to use the Google calendar api? Any jar file is needed to use the calendar api?
Asked
Active
Viewed 1.8k times
8
-
Have you got your API key from google ?If not then first you have to get Google calendar API key – Kirtikumar A. Mar 20 '13 at 07:17
2 Answers
5
use this code:
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", "Some title");
intent.putExtra("description", "Some description");
intent.putExtra("beginTime", eventStartInMillis);
intent.putExtra("endTime", eventEndInMillis);
startActivity(intent);
also discussed here How to launch Android Calendar application using Intent (Froyo) Also, This might not work perfectly on some devices, such as the endTime wont work on HTC wildfire.

Community
- 1
- 1

Amol Gupta
- 704
- 1
- 8
- 26
1
As of ICS release there is an official API for managing calendar data: http://developer.android.com/reference/android/provider/CalendarContract.html

Juri
- 32,424
- 20
- 102
- 136