Get all folders google drive api on Android

前端 未结 1 534
感情败类
感情败类 2020-12-06 20:45

I use the new Google drive api and I can\'t get All folders from my google drive, I only get the folders that I create with the google drive api... Anybody know why happens

相关标签:
1条回答
  • 2020-12-06 21:07

    By design, GDAA supports only the FILE scope, i.e. it will find / list only folders / files created by the Android app.

    There are 2 ways around it:

    1. Use one of the intents of the GDAA, basically letting the user pick the file / folder. That way it will become available to your app.
    2. Use a different API, the REST Api, which supports the DRIVE scope, giving your app full set of files / folders.

    In case you want to study how the two APIs behave, I've put two different demos on the Github (the REST and the GDAA CRUD demo wrappers).

    The second part of your question does not have answer. You don't set the app folder, you can only get it's DriveFolder id. You use it to create / retrieve objects.

      DriveFolder appFldr = Drive.DriveApi.getAppFolder(mGooleApiClient);
      appFldr.createFile(...);
      appFldr.createFolder(...);
      appFldr.listChildren(...);
      appFldr.queryChildren(...);
    

    ... and don't forget to add the SCOPE_APPFOLDER scope

    Good Luck

    0 讨论(0)
提交回复
热议问题