Get all folders google drive api on Android

耗尽温柔 提交于 2019-11-28 01:24:43

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!