Java 将事件添加到Google日历所需的要求?
我需要在不使用IDE的情况下将事件添加到google日历表单Java中。开发我的应用程序需要什么要求。要做到这一点,需要任何API吗?需要知道如何在Java中使用该API。现在我只有JDK1.6。有人能帮我做这件事吗 您可以使用,将JAR包含在您的项目中并使用这些:Java 将事件添加到Google日历所需的要求?,java,google-data-protocol,Java,Google Data Protocol,我需要在不使用IDE的情况下将事件添加到google日历表单Java中。开发我的应用程序需要什么要求。要做到这一点,需要任何API吗?需要知道如何在Java中使用该API。现在我只有JDK1.6。有人能帮我做这件事吗 您可以使用,将JAR包含在您的项目中并使用这些: import com.google.gdata.client.*; import com.google.gdata.client.calendar.*; import com.google.gdata.data.*; import
import com.google.gdata.client.*;
import com.google.gdata.client.calendar.*;
import com.google.gdata.data.*;
import com.google.gdata.data.extensions.*;
import com.google.gdata.util.*;
import java.net.URL;
要创建新的日历事件,可以使用以下代码:
URL postUrl =
new URL("http://www.google.com/calendar/feeds/liz@gmail.com/private/full");
EventEntry myEntry = new EventEntry();
myEntry.setTitle(new PlainTextConstruct("Tennis with Darcy"));
myEntry.setContent(new PlainTextConstruct("Meet for a quick lesson."));
Person author = new Person("Elizabeth Bennet", null, "liz@gmail.com");
myEntry.getAuthors().add(author);
DateTime startTime = DateTime.parseDateTime("2006-04-17T15:00:00-08:00");
DateTime endTime = DateTime.parseDateTime("2006-04-17T17:00:00-08:00");
When eventTimes = new When();
eventTimes.setStartTime(startTime);
eventTimes.setEndTime(endTime);
myEntry.addTime(eventTimes);
// Send the request and receive the response:
EventEntry insertedEntry = myService.insert(postUrl, myEntry);
资料来源: