Wandering Camera Guy
Lurker
I'm working on an app and want the ability to read/write files in a directory on Google Drive. In the past for local files I use Storage Access Framework with Intent.ACTION_OPEN_DOCUMENT_TREE to get access to a directory and it's files/sub-directories. How do I get the Storage Access Framework interface to show Google drive and not just local memory (device, microSD, usbkeys).
I have seen info on Google Drive REST API but those posts are years old and it seems the Storage Access Framework should support it to make access much easier. Am I missing why it wouldn't be supported or is there something needed to pick a Google account so it knows which Google Drive account to show?
Aka, what is needed beyond:
Thanks,
Gary
I have seen info on Google Drive REST API but those posts are years old and it seems the Storage Access Framework should support it to make access much easier. Am I missing why it wouldn't be supported or is there something needed to pick a Google account so it knows which Google Drive account to show?
Aka, what is needed beyond:
Code:
val i = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
i.addCategory(Intent.CATEGORY_DEFAULT)
i.flags = Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION and Intent.FLAG_GRANT_WRITE_URI_PERMISSION
startActivityForResult(i, SELECT_CURRENT_DIR)
Thanks,
Gary