This document has examples for most of the common use cases. For example, here's the code for retrieving events for a specific time range
URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/private/full");
CalendarQuery myQuery = new CalendarQuery(feedUrl);
myQuery.setMinimumStartTime(DateTime.parseDateTime("2006-03-16T00:00:00"));
myQuery.setMaximumStartTime(DateTime.parseDateTime("2006-03-24T23:59:59"));
CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
myService.setUserCredentials("[email protected]", "mypassword");
// Send the request and receive the response:
CalendarEventFeed resultFeed = myService.query(myQuery, Feed.class);
You could make this a bit Groovier, using something like:
def myQuery = new CalendarQuery("http://www.google.com/calendar/feeds/default/private/full".toURL()).with {
minimumStartTime = DateTime.parseDateTime("2006-03-16T00:00:00");
maximumStartTime = DateTime.parseDateTime("2006-03-24T23:59:59");
it
}
def myService = new CalendarService("exampleCo-exampleApp-1");
myService.setUserCredentials("[email protected]", "mypassword");
// Send the request and receive the response:
def resultFeed = myService.query(myQuery, Feed);