googleworkspace / android-samples

Android samples for Google Workspace APIs
Apache License 2.0
636 stars 410 forks source link

Can I listChildren including folder created on google drive web? #94

Closed hksfho closed 6 years ago

hksfho commented 6 years ago

Can I listChildren including folder created on google drive web?

sqrrrl commented 6 years ago

Sort of.

The Android client is based on the per-file scope, meaning most content in Drive is invisible to an application unless either the app created it or the user explicitly authorizes access (via the file picker dialogs.) If you prompt the user to select one or more files and they do, it doesn't matter where those files (or folders) were created.

If you need to list all the content in drive or a specific folder without asking the user to select specific files, you'll need to use the Drive REST API instead.

nantofu commented 6 years ago

I have encountered the same problem. I tried to access all the files from Google Drive through the Drive REST API, which made me spend a lot of time. I am curious as to why the Google Drive team provides an SDK for Android that restricts the data access path. In fact, in the API console, I saw the full application data access authorization mechanism. Under such a mechanism, why does the SDK set up such an obstacle that is uncomfortable for developers?