使用适用于Android的Google文档和Google Spreadsheet API [英] Using Google Docs and Google Spreadsheet APIs for Android

查看:188
本文介绍了使用适用于Android的Google文档和Google Spreadsheet API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正计划使用Google文档列表和Google文档电子表格API在线上将数据库从我的应用上传到电子表格,然后对其进行编辑。

我只是想知道,如果这些API是将Google文档用作我在应用中收集的数据的在线存储空间的正确方法。



我希望我能从你们有经验的人那里得到反馈。



这两个API的链接如下所示:



http://code.google.com/apis/documents/



< a href =http://code.google.com/apis/spreadsheets/ =nofollow noreferrer> http://code.google.com/apis/spreadsheets/



预先感谢!

解决方案

(Dec 2016-Feb 2017) strong>此问题的各个部分现在已过时,如下所示:1) GData API < a>(包括文档列表和Spreadsheets API)都是上一代Google API。尽管并非所有GData API都已被弃用,但所有现代 Google API 使用 Google数据协议; 2)Google文档列表API已被替换(以及在2015年关闭)由 Google Drive API (移动开发者具有特定的 Google Drive Android API ),3)Google 发布新的 2016年Google Sheets API v4 (不是GData),4) Android Studio 现在是Eclipse上的首选IDE。



在ord中呃要使用Google API,您需要获取适用于Android的Google API客户端库(或适用于更通用的Java, Google用于Java的API客户端库)。现在举一些例子...这里是 Android快速入门代码示例以及表单API的更一般的 Java快速入门代码示例。不能伤害传递 JavaDocs参考Sheets API



如果您对Python没有过敏,我还制作了一些包含更多真实世界示例的视频使用Sheets API(非移动版):





最新的API提供了旧版本中不具备的功能即为开发人员提供程序化的文档面向工作表的访问,就好像您在使用用户界面一样(创建冻结行,执行单元格格式化,调整行/列大小,添加数据透视表,创建图表等。 )但是,要执行文件级访问,例如导入&出口,您可以使用 Google Drive API - 对于移动设备,有一个特定的 Google Drive Android API



但是根据您的除非您需要执行文件操作(如搜索或上面描述的那些操作),否则我不相信您需要Drive API(也不推荐使用文档列表API)。您可以使用Sheets API将数据库从[Android]应用程序上传到电子表格并进行编辑。我上面的一个关于将SQL数据迁移到工作表的视频应该能够为您提供足够的伪代码(这就是Python的作用,不是吗?)。

要详细了解如何使用Google API,请查看各种Google开发者视频( series 1 系列2 )我正在制作(主要是Python或JavaScript)。 / p>

I am planning on using the Google Documents List, and Google Documents Spreadsheet API's for uploading a database from my app to a spreadsheet online and then editing it.

I just wanted to know if these API's would be the right approach for using Google docs as an online storage space for the data that I have collected in my app.

I was hoping that I could just get feedback from some of you who might have experience with this.

The links for both API's are listed below:

http://code.google.com/apis/documents/

http://code.google.com/apis/spreadsheets/

Thanks in advance!

解决方案

(Dec 2016-Feb 2017) Various parts of this question are now out-of-date as: 1) GData APIs (including both the Documents List and Spreadsheets APIs) are the previous generation of Google APIs. While not all GData APIs have been deprecated, all modern Google APIs do not use the Google Data protocol; 2) the Google Documents List API has been replaced (and shut down in 2015) by the Google Drive API (mobile developers have a specific Google Drive Android API), 3) Google released a new Google Sheets API v4 (not GData) in 2016, and 4) Android Studio is now the preferred IDE over Eclipse.

In order to use Google APIs, you need to get the Google APIs Client Library for Android (or for more general Java, the Google APIs Client Library for Java). Now for some examples... here's the Android quickstart code sample as well as the more general Java Quickstart code sample for the Sheets API. Can't hurt to pass along the JavaDocs reference for the Sheets API either.

If you're not "allergic" to Python, I've also made several videos with more "real-world" examples using the Sheets API (non-mobile though):

The latest API provides features not available in older releases, namely giving developers programmatic document-oriented access to a Sheet as if you were using the user interface (create frozen rows, perform cell formatting, resizing rows/columns, adding pivot tables, creating charts, etc.) However, to perform file-level access such as imports & exports, you would use the Google Drive API instead -- for mobile, there's a specific Google Drive Android API.

But based on your use-case, I don't believe you need the Drive API (nor the deprecated Documents List API) unless you need to perform file operations like searching or those I described just above. You can just use the Sheets API to "upload a database from your [Android] app to a spreadsheet online and then edit it." My one video above on "migrating SQL data to a Sheet" should give you enough pseudocode (that's what Python is, isn't it?) to write your app.

To learn more about how to use Google APIs, check out the variety of Google developer videos (series 1 and series 2) I'm producing (heads-up mostly Python or JavaScript).

这篇关于使用适用于Android的Google文档和Google Spreadsheet API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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