Skip to main content

Posts

Showing posts from December, 2013

Google Drive API - some helpful tips and code

I am not sure why, but there are not a lot of examples how to use Google Drive API from Android. If you're wondering about it, or you look for a working code, here it is... I assume you've already went successfully through the Google Drive SDK Quickstart -  https://developers.google.com/drive/quickstart-android  . 1) If you're using Eclipse as your IDE and you don't enjoy the command line, for step 1 in the Quickstart, you can find the right SHA1 fingerprint in Window->Preferences -> Android -> Build . 2) In Google Cloud Console (https://cloud.google.com/console) enable both Drive API and Drive SDK 3) Enabling Google Drive for your Activity. The code assumes that the main purpose of the activity is to synchronize your content (I called it BackupActivity - to backup all the content from the app to the Google Drive). a. In your Activity put the following: // change the following to your Activity name private final static String TAG = "Ba