I was trying to do programming using Java to connect to Google Spreadsheet to do data retrieval or modifying data in the cells.
My Google spreadsheet link is https://doc
The feed you get from that URL is a WorksheetFeed
, not a SpreadsheetFeed
.
Try this:
SpreadsheetService service = new SpreadsheetService("google-spreadsheet");
FeedURLFactory urlFactory = FeedURLFactory.getDefault();
WorksheetFeed worksheetFeed = service.getFeed(urlFactory.getWorksheetFeedUrl("1V4jT4vSqmY4YNY1VJhariLRLbxfFWf5z8bSTpDcSBPE", "public", "full"), WorksheetFeed.class);
List worksheets = worksheetFeed.getEntries();
WorksheetEntry worksheet = worksheets.get(0);
System.out.println(worksheet.getTitle().getPlainText());