writing to Google Drive spreadsheet

一个人想着一个人 提交于 2019-11-27 15:23:00

问题


I read tons about the Google Drive API, Google Sheets API, and others, but with all the versions changing all the time I didn't understand what I should use...

I have a android app, and all I want to do it to write text to a existing Google Drive spreadsheet.

Example: Just have a edittext where I can put text and put it in a specific cell in the spreadsheet.

The spreadsheet is in a folder that is shared with some people, and I want the user to enter a mail address and than (after I make sure that the folder is shared with him) can write to the spreadsheets in the folder.

Also retrieving text from the spreadsheets is needed.

Does anybody have any experience doing this in android??

thanks!


回答1:


Based on the comments we exchanged:

you looked at: Android - Google Spreadsheet Api which mentions 3 items:
Google Drive Api : https://developers.google.com/drive/
is for creating a spreadsheet. you might not need that if you are using an existing spreadsheet.

Google Spreadsheet Api: https://developers.google.com/google-apps/spreadsheets/
reads/writes to the spreadsheet

Google APi java client: http://code.google.com/p/google-api-java-client/
Wraps the api in a library for easy usage. Otherwise use the raw https calls directly.

For authentication you will need oauth2. Look at the samples for doing a google+ button login in android.
https://developers.google.com/+/mobile/android/sign-in
Once you have that going with the correct scopes (spreadsheets and maybe drive), that library will give you the "access token" you need to call the spreadsheets client library.



来源:https://stackoverflow.com/questions/27753329/writing-to-google-drive-spreadsheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!