Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive + ACTION_GET_CONTENT

It appears that Google Drive has an activity that responds to the GET_CONTENT action, but that it's not exported.

Is there another method that I can use in my app to pull content out of Drive, without having to initiate the process from Drive? Writing a picker/chooser activity myself and using the backend APIs to list and open a file is obviously an option, but I'd much rather use Drive's own UI to do that.

like image 301
tophyr Avatar asked Dec 28 '12 00:12

tophyr


1 Answers

Google Drive only has an activity that supports GET_CONTENT to support pre-API 19 devices. As per the Storage Access Framework guide, the GET_CONTENT activity must be disabled on API 19+ devices to prevent a duplicate with the DocumentsProvider.

The whole point of the Storage Access Framework is that it provides a single UI (started when you use startActivity with a GET_CONTENT, OPEN_DOCUMENT, or OPEN_DOCUMENT_TREE Intent) that allows users to pick from any source, including local storage, Google Drive, or any other app. And your app can then access the selected file(s) using the exact same code.

There is no functionality that allows you to specify that only a single root (such as Google Drive) should appear. Users will always be able to select from any available root.

like image 68
ianhanniballake Avatar answered Sep 22 '22 22:09

ianhanniballake