What screen size / density combinations should be supported for a bitmap?

I am writing an application where I need several full-screen bitmaps. Based on my naive reading of “Multi-Screen Support” in the Android documentation, in order to cover all my databases, I should probably have 16 versions of each bitmap: all pairs from [ small, normal, large, xlarge ]and [ ldpi, mdpi, hdpi, xhdpi ]. This should reduce the work that the processor must do to scale the images, but it will cost a lot of storage.

However, this seems wildly ineffective for two reasons:

  • Not all of these combinations are found in practice.
  • Because I just show vector art for every physical size (without respect for DPI), pairs such as large / mdpi and normal / hdpi (which are 480x854 pixels) are duplicate files.

So, do you just need to provide really large images and let the system scale them? Bite a bullet and provide a lot of duplicate images? Avoid the problem in general and be careful with some raw raw software solution? Any other ideas? Thank.

EDIT: Obviously, you can create images of XML bitmaps that have an alias of the actual bitmap. This solves the second argument of inefficiency. However, I wonder what combinations of them do others practice.

+3
2

, , , , . .

, , , dpi - , x * y. , - dpi. 4 .

(xlarge ), . , , , .

Android-, , , , .

0

ldpi, mdpi, hdpi xhdpi ( ). .

, (, ), , SD-. , . (http://developer.android.com/guide/appendix/install-location.html)

-1

All Articles