适用于 Android 的 Google DriveDocs API [英] Google DriveDocs API for Android

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

问题描述

我在几个小时内将 Dropbox 与我的应用程序集成在一起,因为 SDK 的描述很清楚,并且有很好的使用示例.

I integrated Dropbox with my app in a matter of hours as the SDK was clearly described and had good examples of usage.

Google 云端硬盘似乎只有一个一刀切"的 Gdata SDK,它非常重(有许多依赖项,它使我的应用程序的大小增加了三倍)而且不是很直观,因为它的级别太低了.我确信当你知道如何使用它时它是非常有意义的,但由于我找不到任何真实的使用示例,我真的很挣扎.

Google Drive seems to only have a "one size fits all" Gdata SDK which is very heavy (with the many dependencies, it triples the size of my app) and not very intuitive as it is so low level. I'm sure it makes perfect sense when you know how to use it but as I cannot find any real samples of usage I am really struggling.

是否有可供我查看和学习的示例应用程序?如果没有,如果有人有一个简单的上传和下载文件示例来帮助我入门,将不胜感激.

Are there any sample apps available that I can look at and learn from? If not, if anybody has a simple example of uploading and downloading files to get me started it would be much appreciated.

推荐答案

因为我们推出了 Google Drive SDK v2,所以首选的方式是使用 Drive API(而不是 Document List API).由于我们的 较新的客户端库 对 Android 友好!我还建议观看 Google IO 的这篇演讲,它解释了如何将移动应用与云端硬盘集成.

Since we launched the Google Drive SDK v2 the preferred way is to use the Drive API (and not the Document List API). There is a full-access scope which gives you access to listing and reading all the drive files and which can be used in Android apps easily since our newer client library is Android-friendly! I also recommend watching this talk from Google IO which is explains how to integrate mobile apps with Drive.

您还可以使用每个文件范围并与 Drive Android 应用程序集成 意图.

You can also use the per-file scope and integrate with the Drive Android App intents.

我们将提供完整的示例应用和开发指南,因此请保持原样.

We are coming with full sample apps and dev guides so please stay put.

这篇 SO 帖子已经回答了这个问题.

目前,Google Drive SDK 基本上是针对 Chrome Web Store 网络应用程序的.今天要在 Android 上使用 Google Drive,您必须使用 GData Document List API.

Basically currently the Google Drive SDK is targeted at Chrome Web Store web applications. To use Google Drive on Android today you will have to use the GData Document List API.

GData 客户端库较旧(Android 之前的世界:)),不能很好地与 Android 配合使用.正如 Alain 在另一篇文章中所解释的,您可以选择仍然尝试使用 GData 客户端库或使用较新的 google-api-java-client 但由于它没有 Document List API 服务类,您必须手动实现它.

The GData client libraries are older (pre-Android world :)) and don't play well with Android. As explained in the other post by Alain you have the choice of still trying to use the GData client library or use the newer google-api-java-client but since it doesn't have Document List API service classes you will have to manually implement it.

可能最简单和最轻量级的选项是直接使用 API 的基于 HTTP 的 REST 协议以及良好的 XML 解析器.该协议在 Google 文档列表 API 文档中进行了描述,只需找到只要页面中有代码示例,标签就会读取协议".

Probably the simplest and most lightweight option would be to use the HTTP based REST protocol of the API directly along with a good XML parser. The protocol is described in the documentation of the Google Document List API just find the tabs that reads "protocol" wherever there is code samples in the page.

最后一个选项,您等到我们最终发布更好、更新且与 Android 兼容的产品 :)

Last option you wait until we eventually release something better and newer that plays well with Android :)

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

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