Google 캘린더에서 Java 및 gdata API를 사용하고 있습니다. 공개 캘린더에서 이벤트 위치를 검색하려고합니다. 여기 내 접근 방식 :Google 캘린더를 사용하여 위치를 얻으시겠습니까?
private static void getCalendarEvents (CalendarService service, URL feedURL)
throws IOException, ServiceException{
CalendarFeed resultFeed = service.getFeed(feedURL, CalendarFeed.class);
for(int i = 0; i < resultFeed.getEntries().size(); i++){
CalendarEntry entry = resultFeed.getEntries().get(i);
System.out.println("\t" + entry.getLocations());
}
내 콘솔에서 "entry.getLocation()"에 대한 부분, 나는 다음과 같이 출력을 얻는 유지 :
[[email protected]]
[[email protected]]
....
설명에 따르면, 방법은 반환해야 목록 유형 그러나 명백하게 나는 그것을 얻지 않았다. 누구나 왜이 값을 얻는 지 알 수 있습니까? 또는 올바른 반환 값에 어떻게 액세스 할 수 있습니까?
또한 Google 코드 여기에 CalendarEntry.class의 코드를 참조하십시오 http://www.google.com/codesearch#EOYaOg_yTgg/trunk/java/src/com/google/gdata/data/calendar/CalendarEntry.java
덕분에 많이.
감사합니다. 여기에 이벤트 날짜를 가져 오지 못했습니다. 내 코드를 게시하고 있습니다. 잠시만 기다려주세요.
private static List<When> getEventDates(CalendarEntry entry){
return entry.getRepeatingExtension(When.class);
}
내가 아래에 전화 : 나는 모든 "널 (null)"의를 가지고, 의미
for(int i = 0; i < resultFeed.getEntries().size(); i++){
CalendarEntry entry = resultFeed.getEntries().get(i);
List<When> timeList = getEventDates(entry);
System.out.println("\t" + i+". "+entry.getTitle().getPlainText() + "\t" + timeList.get(0).getValueString());
}
이 donest 작업 ... 먼저 내 getEventDates.class이 때 개체의 목록을 반환 in timeList. XML의 내용을 갖고 싶습니다. 힌트를주세요. 감사합니다.
대단히 고맙습니다. 그리고 나는 사건의 날짜를 얻는 데 여전히 문제가있다. 위 질문을 업데이트했습니다. 잠시만 기다려주세요. 고마워요 –
내 업데이트 된 질문의 두 번째 부분을 참조하십시오. –
CalendarEntry는 달력을 나타내며 날짜가 없습니다. 당신이 얻으려고하는 것은 CalendarEventEntry입니다. CalendarEventEntry는 달력에서 날짜와 시간을 나타내는 이벤트를 나타냅니다. http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html –