Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
293 views
in Technique[技术] by (71.8m points)

android - writing to Google Drive spreadsheet

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...