简体   繁体   English

适用于Java的Google-API日历供稿

[英]Google-API Calendar Feed for Java

I'm currently using the new Google API 1.5 beta, and I can't find any examples for retrieving a calendar feed. 我目前正在使用新的Google API 1.5 Beta,但找不到用于检索日历供稿的任何示例。 The examples posted here only seem to provide a list of calendars per account and not their events. 此处发布的示例似乎仅提供每个帐户的日历列表,而不提供其事件。 Is the old GData API the only way to retrieve a calendar feed right now? 旧的GData API现在是检索日历供稿的唯一方法吗? And if so, is it worth waiting for this feature to appear in the new API if I only want to retrieve an event feed? 如果是这样,如果我只想检索事件供稿,是否值得等待此功能出现在新的API中?

Did some digging around in the other non-Android examples and found this to work: 在其他非Android示例中进行了一些挖掘,发现它可以正常工作:

CalendarUrl url = new CalendarUrl(calendar.getEventFeedLink());
try {
  EventFeed feed = client.eventFeed().list().execute(url);
  for(EventEntry entry : feed.getEntries()) {
    // etc....
  }
}
catch(IOException e) {
  e.printStackTrace();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM