Google Drive\Docs API for Android

15,797

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

Share:
15,797
Admin
Author by

Admin

Updated on June 19, 2022

Comments

  • Admin
    Admin almost 2 years

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

    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.