Reading directory using saf asd or file component and get image display in canvas

Hi, i am trying to read a list of images from a directory but i cant get images. when i push the buttons i cant get the display image in canvas. what is my error?

this is using file reader


using saf

using asd


You have got yourself in a complete muddle.

Only your last image has any chance of displaying an image.

Show the full path where you are saving your images.

this is the full path /storage/emulated/0/Download/images

inside file images are 4 images with the name imagen1.png,imagen2.png, ...

and my others images where is the error please i need understand how can call files list

then this has nothing to do with the ASD.

Has the same app saved these image files to that directory or have they come from another app or location ?

You need to read and understand this:

the directory is from internal storage of device not is sdcard. and my app file manager is

so i need modify and use the full path? file:///storage/emulated/0/Download/images/
is correct? and too use read images audio external blocks?

No, it is external storage (which is different from an external sdCard). Read the good advice above.

No, the absolute path is OK.

its correct the blocks for file component? and saf? or how need to join the blocks for working?

You can read images from any location on all Android versions (without SAF). But if the images are not created by the app itself, you must request READ_EXTERNAL_STORAGE on Android < 13 and READ_MEDIA_IMAGES on Android 13+.

See also here: How to access non-media & media files on Android 11+

1 Like