I'm developing a feature in my app where user needs to give access to his google drive account to another user so the second can upload files to drive.
I have been searching google drive android api
and also checked out the demos but I can't find anything relative to what I want.
Is this something that's doable and if yes then what do I need from the api to create it ?
I think the only way to fully give access to your google Drive is to share your password, which isn't something you would want. What you can do is share a folder where the other user can move files in and out.
You do this by using Permissions.create, setting the type to "user" and providing the email of that user. You can check code samples in Sharing Files in Drive API:
Permission userPermission = new Permission()
.setType("user")
.setRole("writer")
.setEmailAddress("example@appsrocks.com");
driveService.permissions().create(fileId, userPermission)
.setFields("id")
.queue(batch, callback);
Permission domainPermission = new Permission()
.setType("domain")
.setRole("reader")
.setDomain("appsrocks.com");
driveService.permissions().create(fileId, domainPermission)
.setFields("id")
.queue(batch, callback);
You can read this google forum which seems to talk about the same issue as well.