我最近在 Android 中做到了这一点。
service = new SpreadsheetService("Spreadsheet");
service.setProtocolVersion(SpreadsheetService.Versions.V3);
service.setUserCredentials("username", "password");
URL metafeedUrl = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
feed = service.getFeed(metafeedUrl, SpreadsheetFeed.class);
List<SpreadsheetEntry> spreadsheets = feed.getEntries(); //List of Spreadsheet
worksheetFeed = service.getFeed(spreadsheets.get(0).getWorksheetFeedUrl(), WorksheetFeed.class); //Using the first spreadsheet from list
List<WorksheetEntry> worksheets = worksheetFeed.getEntries();
worksheet = worksheets.get(0);
URL listFeedUrl = worksheet.getListFeedUrl();
// Create a local representation of the new row.
ListEntry row = new ListEntry();
row.getCustomElements().setValueLocal("column_name", "value");
row = service.insert(listFeedUrl, row);
这对我来说很有用。希望它可以帮助你。