0

My App creates a folder in GDrive to store user notes. I am replacing Google API client with GDrive Android SDK ( through Google Play services ) in my Android app. With GDrive Android SDK, I am not able to find a way to get the DriveID for the custom app folder created under GDrive Root folder by my App.

I am using two scopes supported by GDrive Android SDK:

Drive.SCOPE_FILE Drive.SCOPE_APPFOLDER

The following query only lists the AppFolder and the files created by the App but it doesn't list the folder created by the App.

Query query = new Query.Builder()
                 .addFilter(Filters.eq(SearchableField.MIME_TYPE,"application/vnd.google-apps.folder"))
                .build();
Drive.DriveApi.query(getGoogleApiClient(), query)
                .setResultCallback(metadataBufferCallback);

What could be the problem? Please help. Thanks for your support and guidance.

Somesh
  • 1
  • Have you tried [these](http://stackoverflow.com/questions/22199537/how-to-get-driveid-of-created-folder-in-google-drive-android-api) approaches yet? – pointNclick Mar 31 '15 at 23:57
  • Thanks for pointing to these links. I could now resolve the issue and using the following method to get the folder by name: `Query query = new Query.Builder() .addFilter(Filters.eq(SearchableField.TITLE, "folder-name")) .addFilter(Filters.eq(SearchableField.MIME_TYPE, "application/vnd.google-apps.folder")) .addFilter(Filters.eq(SearchableField.TRASHED, false)) .build(); Drive.DriveApi.query(googleApiClient, query) .setResultCallback(myMetadataBufferResultCallback);` – Somesh Apr 24 '15 at 17:04

0 Answers0