Google Drive Android API Demos app illustrates all possible ways to talk to Drive service with the use of interfaces available in Google Play Services. The calls illustrated within the app are:
- Create a file
- Create a file in App Folder
- Create a folder
- Retrieve metadata
- Retrieve contents
- Listen download progress
- Edit metadata
- Edit contents
- Pin file to the device
- Create a file with creator activity
- Pick a file with opener activity
- Pick a folder with opener activity
- Create a file in a folder
- Create a folder in a folder
- List files in a folder
- Query files in a folder
- Authorization, authentication and client connection
- Synchronous requests
- Listen for metadata and contents change events
If you actually want to run this sample app (though it is mostly provided so you
can read the code), you will need to register an OAuth 2.0 client for the
package ${applicationId}
with your own debug keys
and set any resource IDs to those that you have access to. Resource ID definitions
are on:
- ${applicationId}.BaseDemoActivity.EXISTING_FOLDER_ID
- ${applicationId}.BaseDemoActivity.EXISTING_FILE_ID
To enable OAuth 2.0, follow this guide: https://developers.google.com/identity/protocols/OAuth2
You'll need your debug keystore, it's here:
- linux: ~/.android/debug.keystore
- win: C:\User\YourUser.android\debug.keystore
keytool -exportcert -keystore ~/.android/debug.keystore -list -v