java - 谷歌日历java API

标签 java google-api google-calendar-api

我有一个 CalendarEntry 对象

我知道 http://www.google.com/calendar/feeds/example@gmail.com/allcalendars/full 是所有日历的 feed url

但是我如何从 CalendarEntry 实例中获取这个提要 url?

因为我想在指定的日历中发布新条目并且我需要这个 url。

谢谢!

最佳答案

我建议您在代码中指定该 URL,如以下代码段:

CalendarService myService = new CalendarService("CalendarService");
myService.setUserCredentials("example@gmail.com", "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 实例将存储通过指定 URL 检索到的每个日历(主日历、辅助日历、导入日历)。

关于java - 谷歌日历java API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1928549/

相关文章:

java - 通过数组访问数组巨大的性能损失

ant - 通过ant编译jdk

python - Google Drive API Python 实现的 ~/.credentials/drive-python-quickstart.json 保存在哪里?

php - Google URL Shortener - 未指定 HTTP Referer

api - 如何使用 API 设置 Google 日历事件的颜色

oauth-2.0 - Google API刷新 token 限制

java - 从 spring Controller 下载文件

java - Android,从网络获取数据并更新 UI(多线程和 MVC 设计模式)

asp.net-mvc-3 - 在 Azure 网站上使用 GData API 时出现 InvalidCredentialsException;本地调试运行正常

php - 如何从谷歌日历获取事件详情