Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google calendar java api

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!

like image 893
Tommaso Taruffi Avatar asked Dec 03 '25 05:12

Tommaso Taruffi


1 Answers

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.

like image 98
systempuntoout Avatar answered Dec 04 '25 18:12

systempuntoout



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!