我有代码:
// Create a CalenderService and authenticate
CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
myService.setUserCredentials("j...@gmail.com", "mypassword");
// Send the request and print the response
URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/allcalendars/full");
CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class);
System.out.println("Your calendars:");
System.out.println();
for (int i = 0; i < resultFeed.getEntries().size(); i++) {
CalendarEntry entry = resultFeed.getEntries().get(i);
System.out.println("\t" + entry.getTitle().getPlainText());
}这段代码给出了所有日历的列表。在我这里-一个盒子日历,一个朋友的生日日历和一个假日日历。我需要接收今天发生的所有事件--即我的笔记、朋友的生日和节假日。我怎么能做到这一点呢?
发布于 2011-10-02 18:52:19
需要执行从该天开始到结束的日期范围查询。看见
http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html#RetrievingDateRange
(我不是100%确定,但我认为使用url https://www.google.com/calendar/feeds/default/allcalendars/full应该可以得到所有日历的结果)
https://stackoverflow.com/questions/7625723
复制相似问题