8

I've spent hours trying to work out how to use SDK. It seems so long winded and has about 20 dependencies but absolutely no examples of usage.

Does anyone know where I could find some examples to learn from. Dropbox was just a case of downloading the SDK and using it. Google drive only seems to have javadoc which is only helpful as a reference if you already know what you are doing.

I'm trying to do what I consider to be the most simple operations. upload, download, delete, create.

Andrew Aylett
  • 39,182
  • 5
  • 68
  • 95
  • the internet [says](http://arstechnica.com/business/news/2012/04/google-drive-sdk-announced-but-apis-are-only-accesible-to-web-apps-for-now.ars?clicked=related_right) there is no Android API. There are also [examples](https://developers.google.com/drive/examples/index) – zapl Apr 25 '12 at 09:16
  • 4
    Then "the internet" is wrong. http://code.google.com/p/google-api-java-client/wiki/APIs#Drive_API The examples you link to are not for the Android version of the Drive SDK which is what the OP is asking about. – Kuffs Apr 25 '12 at 11:35

2 Answers2

1

I had the same problems originally, finding a SDK that actually worked for Google Docs.

In the end I ended up implementing it on my own using raw HTTP requests, as also suggested in the other answer linked to by Alain. My implementation only handle file transfers and file management, but it is quite straightforward to implement, and works perfectly for Google Drive files also. I basically just implemented what I needed from the Google Documents List API version 3.0 found here: https://developers.google.com/google-apps/documents-list/

It took a little time, but was well worth it, and much more lightweight since I didn't have to include on all the dependencies of the various Google API's.

AndersC
  • 512
  • 1
  • 4
  • 11
  • 3
    Care to share or place it on GitHub? We can't be the only ones who needed this and seems silly to keep reinventing the wheel. –  Apr 27 '12 at 05:46
  • Did you find a way how to get partial responses? Picasa API has "fields" url parameter which limits what's returned, this seems not to work in Docs API 3.0. – Pointer Null Apr 27 '12 at 22:35
  • 1
    I would be very interested in the sources as well. Rewriting the whole thing doesn't seem logical to me either :) – Quint Stoffers Jun 12 '12 at 19:18
0

Google has now a tutorial called Quickstart: Run a Drive App on Android.

The Drive API are at https://developers.google.com/drive/v2/reference/

If your goal is to let users open files directly from the Drive app for Android using your app, see Integrate with the Android Drive App.

Alessandro Jacopson
  • 18,047
  • 15
  • 98
  • 153