开发者

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("calendar.test@gmail.com", "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;开发者_如何学Python i < resultFeed.getEntries().size(); i++) { 
  CalendarEntry entry = resultFeed.getEntries().get(i); 
  System.out.println("\t" + entry.getTitle().getPlainText()); 
}


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜