How to access google calendar with new api on android ?
Using GData APIs I could write such a code:
CalendarService myService = new CalendarService("CalendarService");
myService.setUserCredentials("example@gmail.com", "yourPassword");
URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/allcalendars/full");
CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class);
Log.d(TAG,"Your calendars:");
for (int i = 0; i < resultFeed.getEntries().size(); i++) {
CalendarEntry entry = resultFeed.getEntries().get(i);
Log.d(TAG,entry.getTitle().getPlainText());
}
But I can’t use such a code on android, because of SAX exception. Tell me please how can I authorize with login and password using new V3 api in such a way.
you can’t authorise with a username and password with v3, it uses oAuth2
What you need to do is use OAuth2 to get an access token, make sure your scope is set for the google calendar. Save your refresh token somewhere, then you can access all you want