写入 Google Drive 电子表格 [英] writing to Google Drive spreadsheet

查看:46
本文介绍了写入 Google Drive 电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了大量有关 Google Drive API、Google Sheets API 等的信息,但是随着所有版本一直在变化,我不明白我应该使用什么...

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...

我有一个 Android 应用,我想做的就是将文本写入现有的 Google Drive 电子表格.

示例:只需有一个编辑文本,我可以在其中放置文本并将其放入电子表格的特定单元格中.

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.

有没有人有在android中做这件事的经验??

Does anybody have any experience doing this in android??

谢谢!

推荐答案

根据我们交流的意见:

您查看了:Android - Google Spreadsheet Api,其中提到了 3 个项目:
Google 云端硬盘 API:https://developers.google.com/drive/
用于创建电子表格.如果您使用的是现有电子表格,则可能不需要它.

Google 电子表格 API:https://developers.google.com/google-apps/spreadsheets/
读取/写入电子表格

Google APi java 客户端:http://code.google.com/p/google-api-java-client/
将 api 包装在库中以便于使用.否则直接使用原始 https 调用.

对于身份验证,您将需要 oauth2.查看在 android 中进行 google+ 按钮登录的示例.
https://developers.google.com/+/mobile/android/sign-在
一旦您使用正确的范围(电子表格和驱动器),该库将为您提供调用电子表格客户端库所需的访问令牌".

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.

这篇关于写入 Google Drive 电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆