2
我正在开发一个Android应用,该应用使用GData API for Google Calendar in Java连接到Google日历。到目前为止,我已经设法创建活动,但我只能设置标题,描述和时间。Google日历API:新活动属性
有没有人知道我可以在哪里找到一个参考或带有可设置为事件的所有参数的示例?
我给你留下了一些我迄今为止取得的成果的代码。
CalendarService calendarService = new CalendarService("CalendarAPP");
calendarService.setUserCredentials(<username>, <password>);
URL postUrl = new URL("https://www.google.com/calendar/feeds/<GMAIL ACCOUNT>/private/full");
CalendarEventEntry myEntry = new CalendarEventEntry();
myEntry.setTitle(new PlainTextConstruct("Tennis with Beth"));
myEntry.setContent(new PlainTextConstruct("Meet for a quick lesson."));
DateTime startTime = DateTime.now();
DateTime endTime = DateTime.now();
When eventTimes = new When();
eventTimes.setStartTime(startTime);
eventTimes.setEndTime(endTime);
myEntry.addTime(eventTimes);
CalendarEventEntry insertedEntry = connection.getCalendarService().insert(postUrl, myEntry);
在此先感谢。
Mikywan。