Android: is EXTERNAL_CONTENT_URI enough for a photo gallery?

I play with the Android MediaStore classes and try to create a very simple photo gallery application when I notice that these are two image content URIs: EXTERNAL_CONTENT_URI and INTERNAL_CONTENT_URI . At first I thought that this refers to the location of the storage (external SD or internal memory), but after a little testing this is clearly not the case. I read about it here , and it looks like this indicates that the internal uri content is actually content that is internal to each application on the device. However, I’m not entirely sure and would like to receive opinions from more experienced developers who are more familiar with the MediaStore classes.

So my main question is: is it enough to simply request EXTERNAL_CONTENT_URI to get all the important photos? And if possible, answer what INTERNAL_CONTENT_URI and what should it be used for?

+8
android mediastore
source share
1 answer

External vs Internal storage does not refer to the memory location, but refers to the privacy policy. Internal storage means that only applications or processes of the system / superuser can access the content.

External storage can be read by each application, this is what appears when you connect your phone to the computer, so you can think of it as what is shown to everyone else, therefore, "external".

I have, for example, Samsung S5, and it puts both internal and external storage into the same “internal” flash memory, they are actually just separate sections on the same stick.

When I add an SD card, it adds another (secondary) external storage.

Each Android device must come with internal and external storage, so devices that ship without an SD card, for example, guarantee the separation of internal memory into internal and external storage.

Regarding how External_Content_URI relates, it will return images that are in external storage - after reading the documents more carefully, it says that it only returns for the “primary” amount of external memory. I just noticed that the last part in quotation marks is itself, so I’ll check something in the next few days if the secondary external storage is also indexed or retrieved by the media, if someone else does not respond first.

http://developer.android.com/reference/android/provider/MediaStore.Images.Media.html

+16
source share

All Articles