Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropbox not seen in Storage Access framework implementation

I implemented SAF (Storage Access Framework) in my app. I am running my app on Samsung nexus 10. It has dropbox installed. But I cannot see dropbox inside my application. So my question is:

Is Dropbox registering to SAF? If yes, is there something else, I need to do in my app to make dropbox available as one of root folder?

Currently, in my app, I see - Google Drive, Images, downloads as my root folders

like image 762
Sushil Avatar asked May 27 '14 11:05

Sushil


People also ask

What is SAF storage?

Android 4.4 (API level 19) introduces the Storage Access Framework (SAF). The SAF enables users to browse and open documents, images, and other files across all their preferred document storage providers. A standard UI lets users browse files and access them in a consistent way across apps and providers.


2 Answers

I found the answer, you should launch your intent with:

Intent i = new Intent(Intent.ACTION_GET_CONTENT);

I'm still testing my app about the using Intent.CATEGORY_OPENABLE or not. But this intent shows drop box.

You can find about it here:

https://developer.android.com/guide/topics/providers/document-provider.html#client

like image 102
Budius Avatar answered Oct 18 '22 04:10

Budius


TalkLittle has already provided the link to the forum post which clearly indicates the lack of interest in providing the SAF access.

As Budius noted, you can (probably) read the file by using ACTION_GET_CONTENT intent.

But, depending on what your objective is, be mindful of what the documentation states:

Use ACTION_GET_CONTENT if you want your app to simply read/import data. With this approach, the app imports a copy of the data, such as an image file. Use ACTION_OPEN_DOCUMENT if you want your app to have long term, persistent access to documents owned by a document provider. An example would be a photo-editing app that lets users edit images stored in a document provider.

Using Open Document intent will allow you to also write the modified file back while Get Content won't. There might be workarounds but it is not straightforward as with Open Document intent.

like image 1
Alen Siljak Avatar answered Oct 18 '22 04:10

Alen Siljak