How to change permission of folder or file created in Google Drive using Google Drive Android API?
-
I'm using Google Drive Android API to store and share files and folders created. When I create a file/folder using Google Drive Android API,by default created file or folder is private (not shared publicly). When I share the link of file/folder created to any user, that user needs to send email request for access to owner. So owner have to make file/folder public manually in Google Drive to prevent access requests. Where as for Google Drive iOS API, when a file/folder is created, the file/folder created is by default public. Another question I want to ask is, When I am querying list of folders in Root folder (with MIME_TYPE as application/vnd.google-apps.folder), the result is given with all folders. Where as using Google Drive iOS API, queryForFilesList() method returns only folders created by particular iOS app, not all folders in the root directory. What I have to do to get this kind of result using Google Drive Android API or Google Drive REST API?
-
Answer:
Per DaImTo's comment: You can use https://developers.google.com/drive/android/intro and https://developers.google.com/drive/web/about-sdk together, I have a side-by-side CRUD implementations published https://github.com/seanpjanson/GDAADemo and https://github.com/seanpjanson/RESTDemo. You must be aware of a few things, though: 1/ The 'connect' in the GDAA is not aligned with the 'UserRecoverableAuthIOException' logic of the REST See https://github.com/seanpjanson/RESTDemo/blob/master/app/src/main/java/com/andyscan/gdrtdemo/REST.java#L62()/https://github.com/seanpjanson/GDAADemo/blob/master/src/main/java/com/andyscan/gdrtdemo/GDAA.java#L69() combo in the two examples. Actually, you can use GDAA's 'connect' logic to do the authorization and then continue using the REST service. The 'UserRecoverableAuthIOException' should still be handled in case your user messes with the 'http://stackoverflow.com/questions/30172915/user-disconnecting-app-in-drive-causes-loss-of-data-under-file-scope'. But then, your app is DOA anyway if it is under the FILE scope. 2/ The GDAA uses DriveId as a primary ID that is local to a device. It has access to the ResourceId (with some latency) that is primary ID in REST. The ResourceID is a system-wide ID that can be ported to different devices, systems. See http://stackoverflow.com/questions/29030110/cannot-get-folderid-that-i-just-created-on-google-drive/29049474#29049474. 3/ The REST API is broader, the GDAA is build on top of it and has only a subset of functionality (no thumbnail link for instance). It supports FILE scope only (as opposed to DRIVE and FILE scopes of the REST). 4/ When you start mixing the 2 together, you will be exposed to latency/timing issues, since your app has full control over the REST's networking, whereas GDAA's synchronization is hidden with some vaguely documented http://stackoverflow.com/search?q=%5Bgoogle-drive-android-api%5D+requestsync. If you look closer at the GDAA's architecture here (https://developers.google.com/drive/android/files) , you will figure out potential pitfalls of mixing the two. Good Luck
OAEI at Stack Overflow Visit the source
Related Q & A:
- How to play video Using Url On Android?Best solution by Stack Overflow
- How do I use Microsoft Word to open a Google Drive cloud document?Best solution by Quora
- How to use Google+ using OAuth in Android?Best solution by Stack Overflow
- How to change info Window style in Google Maps API?Best solution by Stack Overflow
- How can I delete a folder that I created in Yahoo mail?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.