Hello All,

I am looking for a little help in one of my project on which i am working. 
I am developing an app in which I have to integrate *Google Spreadsheet API*. 
I find the below code from the Google Spreadsheet api documentation, I also 
attach all the required jar file in this but still i am not able to get the 
details. I am getting error when run the below code.

try {
    String url = 
"https://docs.google.com/spreadsheet/pub?key=0AlJeYFlqqMqrdGxOaHh3czVocmEtRlFsTDNiWno4VWc&output=html";;

    SpreadsheetService service =
        new SpreadsheetService("Testing");
// TODO: Authorize the service object for a specific user (see other 
sections)

// Define the URL to request.  This should never change.
//URL SPREADSHEET_FEED_URL = new 
URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full";);
 URL SPREADSHEET_FEED_URL = new URL(url);

// Make a request to the API and get all spreadsheets.
SpreadsheetFeed feed = service.getFeed(SPREADSHEET_FEED_URL,
SpreadsheetFeed.class);
List<SpreadsheetEntry> spreadsheets = feed.getEntries();

if (spreadsheets.size() == 0) {
// TODO: There were no spreadsheets, act accordingly.
System.out.println("Not found");
}

// TODO: Choose a spreadsheet more intelligently based on your
// app's needs.
SpreadsheetEntry spreadsheet = spreadsheets.get(0);
System.out.println(spreadsheet.getTitle().getPlainText());

// Make a request to the API to fetch information about all
// worksheets in the spreadsheet.
List<WorksheetEntry> worksheets = spreadsheet.getWorksheets();

// Iterate through each worksheet in the spreadsheet.
for (WorksheetEntry worksheet : worksheets) {
// Get the worksheet's title, row count, and column count.
String title = worksheet.getTitle().getPlainText();
int rowCount = worksheet.getRowCount();
int colCount = worksheet.getColCount();

// Print the fetched information to the screen for this worksheet.
System.out.println("\t" + title + "- rows:" + rowCount + " cols: " + 
colCount);
}
} catch (Exception e) {
e.printStackTrace();
}

*LOGCAT :- *

09-17 11:12:20.500: W/System.err(394): 
com.google.gdata.util.ParseException: Unrecognized content 
type:text/html;charset=UTF-8
09-17 11:12:20.512: W/System.err(394): at 
com.google.gdata.client.Service.parseResponseData(Service.java:2136)
09-17 11:12:20.512: W/System.err(394): at 
com.google.gdata.client.Service.parseResponseData(Service.java:2098)
09-17 11:12:20.520: W/System.err(394): at 
com.google.gdata.client.Service.getFeed(Service.java:1136)
09-17 11:12:20.520: W/System.err(394): at 
com.google.gdata.client.Service.getFeed(Service.java:998)
09-17 11:12:20.520: W/System.err(394): at 
com.google.gdata.client.GoogleService.getFeed(GoogleService.java:645)
09-17 11:12:20.520: W/System.err(394): at 
com.google.gdata.client.Service.getFeed(Service.java:1017)
09-17 11:12:20.530: W/System.err(394): at 
com.voter.registration.HomeActivity.start(HomeActivity.java:86)
09-17 11:12:20.530: W/System.err(394): at 
com.voter.registration.HomeActivity.onResume(HomeActivity.java:30)
09-17 11:12:20.530: W/System.err(394): at 
android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
09-17 11:12:20.530: W/System.err(394): at 
android.app.Activity.performResume(Activity.java:3832)
09-17 11:12:20.530: W/System.err(394): at 
android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
09-17 11:12:20.540: W/System.err(394): at 
android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
09-17 11:12:20.540: W/System.err(394): at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
09-17 11:12:20.540: W/System.err(394): at 
android.app.ActivityThread.access$1500(ActivityThread.java:117)
09-17 11:12:20.540: W/System.err(394): at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
09-17 11:12:20.540: W/System.err(394): at 
android.os.Handler.dispatchMessage(Handler.java:99)
09-17 11:12:20.550: W/System.err(394): at 
android.os.Looper.loop(Looper.java:130)
09-17 11:12:20.550: W/System.err(394): at 
android.app.ActivityThread.main(ActivityThread.java:3683)
09-17 11:12:20.550: W/System.err(394): at 
java.lang.reflect.Method.invokeNative(Native Method)
09-17 11:12:20.560: W/System.err(394): at 
java.lang.reflect.Method.invoke(Method.java:507)
09-17 11:12:20.560: W/System.err(394): at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-17 11:12:20.560: W/System.err(394): at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-17 11:12:20.560: W/System.err(394): at 
dalvik.system.NativeStart.main(Native Method)

If anyone has any idea please kindly help me.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to