Android Question drawable_X - Code vs Designer

luke2012

Well-Known Member
Licensed User
Longtime User
The designer is very useful to set an image file with a couple of clicks (I always use this).
But when the need is to support several image resolution for several screen size and dpi is it better to use the drawable_ldpi / ... approach ?

In this case I can't set this within the current designer right ? I must use the code approach ?

Thanks in advance for your reply.
 

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
I understand your problem. I'll follow the topic to see the best solution.
I think it would be useful to have access to something like this in the script:
B4X:
ImageView1.Bitmap = LoadBitmap (File.DirAssets, "resolution1\someimage.jpg")
...
ImageView1.Bitmap = LoadBitmap (File.DirAssets, "resolution2\someimage.jpg")

Maybe this can not be implemented.

I created an imagegallery class and I have several icons in it. The icons are initialized depending on the resolution of the device.

I believe that for large images this is not a good solution.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…