I am adding event like this…
public static String EVENT_URI = "content://com.android.calendar/events";
public static String CALENDAR_URI = "content://com.android.calendar/calendars";
public static Uri insert(ContentResolver cr, ContentValues cv) {
Uri newEvent = null;
try {
cv.put(Event.CALENDAR_ID, 1);
cv.put(Event.TITLE, "title");
cv.put(Event.DESCRIPTION, "description");
cv.put(Event.DTSTART, new Date().getTime());
cv.put(Event.DTEND, new Date().getTime() + 1000 * 60 * 60);
cv.put(Event.EVENT_LOCATION, "Hall: " + "+ 1000 * 60 * 60");
cv.put(Event.HAS_ALARM, true);
cv.put(Event.EVENT_TIMEZONE, TimeZone.getDefault().getDisplayName());
newEvent = cr.insert(Uri.parse(EVENT_URI), cv);
} catch (Exception e) {
e.printStackTrace();
}
return newEvent;
}
I want to sync with Google calendar after adding event, Is there any parameter which I have to send with ContentValues OR I need to fire query for sync.
how this useful http://developer.android.com/guide/topics/providers/calendar-provider.html#sync-adapter
Help!! Thanks.
Sync from Android phone's calendar to Google Calendar on web without using Google Calendar Data API. Is this possible?
Waiting for best answer because I already given account selection feature.