为Android使用谷歌文档和谷歌电子表格api

时间:2022-06-20 15:24:41

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.

我计划使用谷歌文档列表,谷歌文档电子表格API将数据库从我的app上上传到电子表格,然后进行编辑。

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.

我只是想知道这些API是否适合使用谷歌文档作为我在应用中收集的数据的在线存储空间。

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:

两个API的链接如下:

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

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

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

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

Thanks in advance!

提前谢谢!

3 个解决方案

#1


3  

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

(2016年12月- 2017年2月)这个问题的各个部分现在已经过时了:1)GData api(包括文档列表和电子表格api)是谷歌api的上一代。虽然不是所有的GData api都被弃用,但是所有的现代谷歌api都不使用谷歌数据协议;2)Google文档列表API所取代(并在2015年关闭)Google Drive API(移动开发者有一个特定的Google Drive Android API),3)Google发布了一个新的Google床单API v4(不是GData)2016年,和4)Android工作室现在是首选在Eclipse IDE。

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.

为了使用谷歌api,您需要为Android获得谷歌api客户端库(或者为更一般的Java,为Java获得谷歌api客户端库)。现在的一些例子…下面是Android quickstart代码示例,以及Sheets API的更通用的Java quickstart代码示例。传递关于Sheets API的JavaDocs引用也无妨。

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):

如果你对Python不“过敏”,我还用了一些更“真实世界”的例子,使用了Sheets API(非移动的):

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.

最新的API提供了功能可能无法在旧版本,即给开发人员编程面向文档的访问表,如果你是使用用户界面(创建冻结行,执行单元格式,调整行/列添加数据透视表、创建图表,等等)。然而,进口&出口等执行文件级别访问,您将使用Google Drive API——移动,而不是有一个特定的谷歌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.

但是基于您的用例,我认为您不需要驱动器API(也不需要弃用文档列表API),除非您需要执行文件操作,如搜索或我上面描述的那些操作。您可以使用Sheets API“将数据库从[Android]应用程序上传到一个电子表格,然后对其进行编辑”。我上面的一个关于“将SQL数据迁移到表中”的视频应该会为您提供足够的伪代码(这就是Python,不是吗?)来编写应用程序。

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

要了解更多关于如何使用谷歌api的知识,请参阅谷歌开发人员的视频(第1和第2系列),我正在制作(主要是Python或JavaScript)。

#2


8  

For accessing Google APIs on the android platform, the Google APIs Client Library for Java is the way to go.

对于在android平台*问谷歌api, Java的谷歌api客户端库是可行的。

It includes sample apps for the Documents and Spreadsheet APIs.

它包括文档和电子表格api的示例应用程序。

#3


2  

Personally I don't like Google's api lib for java. I honestly think you are better off using scribe and jackson to deserialize the feeds. We made a hello world. It includes calls with openid and oauth to spreadsheet feeds and deserialization template. Hope it helps.

我个人不喜欢谷歌的java api库。我真的认为你最好使用书记和杰克逊去反序列化提要。我们创造了一个hello world。它包括了openid和oauth的调用,以及电子表格提要和反序列化模板。希望它可以帮助。

link

链接

#1


3  

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

(2016年12月- 2017年2月)这个问题的各个部分现在已经过时了:1)GData api(包括文档列表和电子表格api)是谷歌api的上一代。虽然不是所有的GData api都被弃用,但是所有的现代谷歌api都不使用谷歌数据协议;2)Google文档列表API所取代(并在2015年关闭)Google Drive API(移动开发者有一个特定的Google Drive Android API),3)Google发布了一个新的Google床单API v4(不是GData)2016年,和4)Android工作室现在是首选在Eclipse IDE。

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.

为了使用谷歌api,您需要为Android获得谷歌api客户端库(或者为更一般的Java,为Java获得谷歌api客户端库)。现在的一些例子…下面是Android quickstart代码示例,以及Sheets API的更通用的Java quickstart代码示例。传递关于Sheets API的JavaDocs引用也无妨。

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):

如果你对Python不“过敏”,我还用了一些更“真实世界”的例子,使用了Sheets API(非移动的):

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.

最新的API提供了功能可能无法在旧版本,即给开发人员编程面向文档的访问表,如果你是使用用户界面(创建冻结行,执行单元格式,调整行/列添加数据透视表、创建图表,等等)。然而,进口&出口等执行文件级别访问,您将使用Google Drive API——移动,而不是有一个特定的谷歌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.

但是基于您的用例,我认为您不需要驱动器API(也不需要弃用文档列表API),除非您需要执行文件操作,如搜索或我上面描述的那些操作。您可以使用Sheets API“将数据库从[Android]应用程序上传到一个电子表格,然后对其进行编辑”。我上面的一个关于“将SQL数据迁移到表中”的视频应该会为您提供足够的伪代码(这就是Python,不是吗?)来编写应用程序。

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

要了解更多关于如何使用谷歌api的知识,请参阅谷歌开发人员的视频(第1和第2系列),我正在制作(主要是Python或JavaScript)。

#2


8  

For accessing Google APIs on the android platform, the Google APIs Client Library for Java is the way to go.

对于在android平台*问谷歌api, Java的谷歌api客户端库是可行的。

It includes sample apps for the Documents and Spreadsheet APIs.

它包括文档和电子表格api的示例应用程序。

#3


2  

Personally I don't like Google's api lib for java. I honestly think you are better off using scribe and jackson to deserialize the feeds. We made a hello world. It includes calls with openid and oauth to spreadsheet feeds and deserialization template. Hope it helps.

我个人不喜欢谷歌的java api库。我真的认为你最好使用书记和杰克逊去反序列化提要。我们创造了一个hello world。它包括了openid和oauth的调用,以及电子表格提要和反序列化模板。希望它可以帮助。

link

链接