What is the optimal bitmap size for the available ldpi / mdpi / hdpi / xhdpi folders?

I want to scale the images so that they optimally fit the screen size and do not consume more memory than required.

I currently put the images taken for a 640 x 960 screen in the hdpi folder, it looks good, but it consumes a lot more memory than necessary. For example, a 480 x 800 device is hdpi and downloads these bitmaps.

Since most hdpi devices that I know are 480 x 800, my first thought was to reduce all the images in hdpi to fit the 480 x 800 screen. But I'm not sure, since hdpi refers not only to resolution, but also to density .

This is confusing as folders refer to density, but bitmaps are just pixels and I don't know how to assign them ...

Any help is greatly appreciated.

To give more context: the fact is that I have a bitmap animation with more than 20 bitmaps of 640 x 588 px. Thus, on some devices, this alone will work out of memory. The memory occupied by 640 x 588 is 1.43 mb each bitmap! If I reduce to 480 x 441, I get 0.80 mb and this is a huge improvement. And since I wonโ€™t lose the details in the 480 x 800 device, I would scale all the tiles.

+5
source share
1 answer

-, , , Android . , , , , , , , OS , , (, drawable-large-hdpi), .

, , 9- , , .

+6

All Articles