みんなの質問には根拠があります。この質問に答えるコードはありませんでした。この質問に答えるために使用したコードの下を見つけてください。あなたのコードを少し修正しました
import com.google.gdata.client.*;
import com.google.gdata.client.calendar.*;
import com.google.gdata.data.*;
import com.google.gdata.data.acl.*;
import com.google.gdata.data.calendar.*;
import com.google.gdata.data.extensions.*;
import com.google.gdata.util.*;
import java.net.*;
import java.io.*;
import java.util.List;
public class GetGoogleCalendarEventByID {
public static void main(String[] args) {
System.out.println("Before Creating CalendarService.");
CalendarService myService = new CalendarService("exampleCo-exampleApp-1.0");
System.out.println("After Creating CalendarService.");
try
{
System.out.println("Going to setUserCredentials.");
myService.setUserCredentials("email@gmail.com", "password");
URL feedUrl =
new URL("https://www.google.com/calendar/feeds/email@gmail.com/private/full");
CalendarEventFeed myFeed = myService.getFeed(feedUrl, CalendarEventFeed.class);
List <CalendarEventEntry> entries = myFeed.getEntries();
for (CalendarEventEntry e : entries){
if (e.getId().equalsIgnoreCase("http://www.google.com/calendar/feeds/email%40gmail.com/events/EventIDLastPart")){
System.out.println("Got the CalendarEventEntry: " + e.getId());
System.out.println("CalendarEventEntry has text: " + e.getPlainTextContent());
}
}
System.out.println("Finished getting Event.");
}
catch(Exception e)
{
System.out.println("Error : " + e.toString());
}
}
}
注: feedUrl - これは、カレンダー設定の下にあるカレンダーの URL です。
イベント ID の形式はhttp://www.google.com/calendar/feeds/email%40gmail.com/events/EventIDLastPartです。
例えば
http://www.google.com/calendar/feeds/email%40gmail.com/events/ghytrueueyyrgfuur
それが役に立てば幸い
ンゴニダン