16

I am really confused What is the significance of drawable-hdpi, drawable-ldpi, drawable-mdpi, drawable-xhdpi and drawable-xxhdpi of android drawable type under res and how to decide which one of them sholud use?

shaby
  • 1,301
  • 1
  • 15
  • 17
  • the qualifiers for different pixel densities are explained here: https://developer.android.com/training/multiscreen/screendensities#TaskProvideAltBmp – Cor Sep 09 '22 at 09:55

5 Answers5

13
ldpi    Resources for low-density (ldpi) screens (~120dpi).
mdpi    Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)
hdpi    Resources for high-density (hdpi) screens (~240dpi).
xhdpi   Resources for extra high-density (xhdpi) screens (~320dpi).
nodpi   Resources for all densities. These are density-independent resources. The system does not scale resources tagged with this qualifier, regardless of the current screen's density.
tvdpi   Resources for screens somewhere between mdpi and hdpi; approximately 213dpi. This is not considered a "primary" density group. It is mostly intended for televisions and most apps shouldn't need it—providing mdpi and hdpi resources is sufficient for most apps and the system will scale them as appropriate. If you find it necessary to provide tvdpi resources, you should size them at a factor of 1.33*mdpi. For example, a 100px x 100px image for mdpi screens should be 133px x 133px for tvdpi.

So when you create drawable-hdpi, drawable-ldpi, drawable-mdpi, drawable-xhdpi and drawable-xxhdpi the phone appropriately takes the resources according to its pixel density.If nothing is specified it will take resources from drawable. For more details check here

krishna
  • 4,069
  • 2
  • 29
  • 56
1

these are image folders for different densities.

hdpiimages for the Android Broad Screen set or Android Phones with the Higher resolution.

ldpi Lower images quality supported by the earlier sets of the android

mdpi for medium images support

xhdi devices with maximum resolution.

Hamad
  • 5,096
  • 13
  • 37
  • 65
0

These are used to put images of different resolutions to address devices' different screen sizes. For more information, check: http://developer.android.com/guide/practices/screens_support.html

Ricardo
  • 7,785
  • 8
  • 40
  • 60
0

These folders allow you to store multiple different quality versions of a picture so that faster phone can show a better quality picture while an older, slower phone still allows the app to run, albeit with lower quality pictures. It also depends heavily on the DPI of your phone which one it uses. If you want more information you can read up on it on This website (developer.android).

Voidpaw
  • 910
  • 1
  • 5
  • 18
0

Android categories device on two bases

  • Resolution which xlarge,sw800dp etc. (Mainly for Layout folder)
  • Base on the DPI which is main point to Image that is handle in drawable-hdpi, drawable-ldpi, drawable-mdpi, drawable-xhdpi and drawable-xxhdpi

More Explanation

My HTC explorer screen comes under small screen, but because of high density pixel per inch it take image from drawable-hdpi. Samsung Tab with 10 inch screen comes under large screen category but take images from drawable-mdpi.

Tofeeq Ahmad
  • 11,935
  • 4
  • 61
  • 87