Problem with google calendar

Put your problem here if it does not fit any of the other categories.

Problem with google calendar

Postby sddyshou » Tue Jan 11, 2011 5:18 am

Hi all,
I try to read from google calendar, so i download and install the google client api follow the instruction on http://code.google.com/apis/gdata/articles/java_client_lib.html.
I use the sample code from the tutorial website.
Code: Select all
try {
         CalendarService myService = new CalendarService("demo-vibration-1");

         myService.setUserCredentials(account, password);
         // Send the request and print the response
         URL feedUrl = new URL(
               "https://www.google.com/calendar/feeds/default/owncalendars/full");
         Log.v(TAG, "Calendar1");
         CalendarFeed resultFeed = myService.getFeed(feedUrl,
               CalendarFeed.class);
         Log.v(TAG, "Calendar2");
         for (int i = 0; i < resultFeed.getEntries().size(); i++) {
            CalendarEntry entry = resultFeed.getEntries().get(i);
            Log.v(TAG, entry.getTitle().getPlainText());
         }
      } catch (Exception e) {[syntax="java"][/syntax]
         e.printStackTrace();
      }

It compiles and run but throw a parserConfigurationException: org.xml.sax.SAXNotRecognizedException on
Code: Select all
CalendarFeed resultFeed = myService.getFeed(feedUrl,
               CalendarFeed.class);

It fail on android simulate device, but if I run the code on a regular java project it works just fine. I included all the related gdata jar file into my project build path.
Is there anyone run into the same problem?
sddyshou
Freshman
Freshman
 
Posts: 4
Joined: Wed Dec 29, 2010 1:27 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 15 guests