views:

247

answers:

1

Hello,

I have an object of CalendarEntry

I know that http://www.google.com/calendar/feeds/[email protected]/allcalendars/full is the feed url of all calendars

but how I can get this feed url from CalendarEntry instance?

Because I wanna post a new entry in a specified calendar and I need this url.

Thanks!

A: 

I suggest you to specify that URL in your code like the following snippet:

CalendarService myService = new CalendarService("CalendarService");
myService.setUserCredentials("[email protected]", "yourPassword");
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());
}

CalendarEntry instances will store every calendars (primary, secondary,imported calendars) retrieved by the specified URL.

systempuntoout