I am implementing Google Drive in one of my Android application. I am able to authenticate.
Here in this method I want to list down metadata of all the files and folders.
Drive.DriveApi.fetchDriveId(DemoUtil.getGoogleApiClient(), <drive_id>)
.setResultCallback(idCallback)
But this is not working. It requires drive id, from where I'll get this drive id? Can I get the metadata listing of all files and folder of Google Drive?
- I am using API of play services.
First, be aware of the fact, that using GDAA ('API of play services') will give you only the files, folders created by your Android App, since it supports only the 'SCOPE_FILE' scope. If this is OK, you may use a construct like this:
just modify your ContentValues contvals, to hold the metadata you desire. Snippet is taken from this demo, where you can find unresolved context..
If you need all files/folders regardless of the app that created them, you have to go for the REST API with 'DriveScopes.DRIVE' scope, and the same code snippet would look like this:
taken from here.
Good Luck.