Sumithran
Sumithran

Reputation: 271

How to integrate with google Calendar?

I am new to java. I need to integrate with google calendar form my java allpication.But it gives the Exception message : Error connecting with login URI.I use the following code for connect with google.

CalendarService myService = new CalendarService("CalendarService"); 
myService.setUserCredentials("[email protected]", "Kdfdfderekra"); 
URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/allcalendars/full"); 
CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class); 
System.out.println("Your calendars:"); 
for (int i = 0; i < resultFeed.getEntries().size(); i++) { 
  CalendarEntry entry = resultFeed.getEntries().get(i); 
  System.out.println("\t" + entry.getTitle().getPlainText()); 
}

Upvotes: 0

Views: 1318

Answers (1)

tbsalling
tbsalling

Reputation: 4545

Use new URL("https://...") instead of new URL ("http://...") as shown in the examples in the Google API documentation.

Upvotes: 1

Related Questions