How do I change the permission of a folder or file created in Google Drive using the Google Drive Android API?

I use Google Drive Android API

to store and share created files and folders. When I create a file / folder with Google Drive Android API

, by default the created file or folder is closed (public) .

When I pass a link to a file / folder created for any user, that user should send an email request to access the owner. Therefore, the owner needs to manually open the file / folder in Google Drive to prevent access requests.

Where for Google Drive iOS API

when a file / folder is created, the created file / folder is by default public .

Another question I want to ask, when I go through the list of folders in the Root folder (with how ), the result is provided with all folders. Where, using , the method returns only folders created by a specific iOS app, not all folders in the root directory. MIME_TYPE

application/vnd.google-apps.folder

Google Drive iOS API

queryForFilesList()

What do I need to do to get this kind of result using or ? Google Drive Android API

Google Drive REST API

+3


source to share


1 answer


Per DaImTo's comment:
You can use GDAA and REST together, I have a number of CRUD implementations posted here and here . There are several things you need to know:

1 / "connect" in GDAA does not match the "UserRecoverableAuthIOException" REST logic. See init () / connect () combo for two examples. Actually you can use the GOLDA "connect" logic to authorize and then continue using the REST service. The "UserRecoverableAuthIOException" still needs to be handled if your user is using " Settings"> "Application Management> Disconnect from Disk . " But then your application is DOA anyway if it is under the FILE scope.

2 / GDAA uses DriveId as the primary identifier that is local to the device. It has access to the ResourceId (with some delay), which is the main identifier in REST. ResourceID is a system identifier that can be ported to different devices, systems. See here and here .

3 / REST API is broader, GDAA builds on top of it and has only a subset of functionality (no thumbnail reference for example). It only supports FILE scopes (as opposed to DRIVE and FILE REST scopes).



4 / When you start mixing the 2 together you will run into latency / timeout issues as your application has full control over the REST network whereas GDAA sync is hidden with some vague sync methods docs .

If you look at the GDAA architecture here ( Lifecycle of the Drive file ), you will understand the potential problems of mixing the two.

Luck

+2


source







All Articles