How would one go about parsing the start and end times of events in a users Google Calendar using the google-api-java-client?
After installing this sample android pr
You'll need to use the EventFeed and take a look at the EventEntry class
http://code.google.com/p/google-api-java-client/source/browse/calendar-v2-atom-oauth-sample/src/com/google/api/client/sample/calendar/v2/model/EventEntry.java?repo=samples
The Atom string returned containing the startTime / endTime will look like this :
<gd:when startTime='2010-03-13T14:00Z' endTime='2010-03-13T14:30Z'/>
It's modelled in the EventEntry class like this :
@Key("gd:when")
public When when;
(a property for the When object, mapped using the @Key annotation)
The When object, models the start/endTime attributes on the When object
@Key("@startTime")
public DateTime startTime;
@Key("@endTime")
public DateTime endTime;
Client code when inteacting with the eventFeed will look like this :
EventEntry event = eventFeed.get(0);
DateTime start = event.when.startDate;