Google Drive\\Docs API for Android

被刻印的时光 ゝ 提交于 2019-11-27 03:12:13
Nicolas Garnier

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

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.


This has already been answered in this SO post.

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.

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.

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.

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

Note that the sample app that they published for using Google Drive (dredit) includes jars for Android:

/dredit/war/WEB-INF/lib/google-api-client-android2-1.8.0-beta-sources.jar

Could be a red-hearing, but this seems to imply that the Java version of the sample app could be used on Android?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!