I´m trying to insert some events in my Google Calendar with Android. For reading the calendar, there is a quickstart tutorial for Android on the Googles developer page and it works fine. But there is no Android code example for inserting events, I just found an Java code example:
Event event = new Event()
.setSummary("Google I/O 2015")
.setLocation("800 Howard St., San Francisco, CA 94103")
.setDescription("A chance to hear more about Google's developer products.");
DateTime startDateTime = new DateTime("2015-05-28T09:00:00-07:00");
EventDateTime start = new EventDateTime()
.setDateTime(startDateTime)
.setTimeZone("America/Los_Angeles");
event.setStart(start);
DateTime endDateTime = new DateTime("2015-05-28T17:00:00-07:00");
EventDateTime end = new EventDateTime()
.setDateTime(endDateTime)
.setTimeZone("America/Los_Angeles");
event.setEnd(end);
String calendarId = "primary";
event = service.events().insert(calendarId, event).execute();
System.out.printf("Event created: %s\n", event.getHtmlLink());
The problem: 'cannot resolve symbol 'service''. Is there a possibility to import 'service', so I can use the Java Code for inserting Events with Android or do I have to use a completly other way for creating events?
Link to Googles introduction for creating events: https://developers.google.com/google-apps/calendar/create-events