Android Question List of media files

Sergey_New

Well-Known Member
Licensed User
Longtime User
I need to get a vertical list of media files stored locally in the application folder. Number of files up to 1000.
Image sizes up to 1000 pixels high and wide.
Files of gif, jpg, png, pdf types.
The list should contain image thumbnails and file names.
The height and width of the thumbnails are 40dip.
Please suggest the most optimal solution.
In my understanding, this is lazy loading or converting media files to thumbnails.
Thanks!
 

Lucas Siqueira

Active Member
Licensed User
Longtime User
I would do the logic like this:

if I have several 1000dip files and I need to load a list with these images.

the first time I load the list of files, I would put temporary images
and convert according to what I am going to load in the list.

B4X:
if the image exists in the size 40dip
     load it in the imageview
if there is no image in the size 40dip
     load temporary image
     convert the 1000dip image to the size 40dip, save it in a directory.
     load the 40dip image
end if
 
Upvote 0
Top