0

I have LG G3 phone, i know the screen resolution of this phone is : 1440 x 2560 pixels, 5.5 inches (~534 ppi pixel density) .

i've seen in another question here Different resolution support android that:

layout-large-mdpi   (1024x600)
layout-large-tvdpi  (800x1280)
layout-large-xhdpi  (1200x1920)
layout-xlarge-mdpi  (1280x800)
layout-xlarge-xhdpi (2560x1600)

Drawables folders:

Mobile

res/drawable        (default)
res/drawable-ldpi/  (240x320 and nearer resolution)
res/drawable-mdpi/  (320x480 and nearer resolution)
res/drawable-hdpi/  (480x800, 540x960 and nearer resolution)
res/drawable-xhdpi/  (720x1280 - Samsung S3, Micromax Canvas HD etc)
res/drawable-xxhdpi/ (1080x1920 - Samsung S4, HTC one, Nexus 5, etc)

does that mean that i need to creates images in the xxxhdpi directory ? i need to be sure before i start duplicating so many pictures, what is the relation between mdpi and xxxhdpi?

Community
  • 1
  • 1
amjad
  • 29
  • 3
  • Have you read [this](http://developer.android.com/guide/practices/screens_support.html)? If not, you should. Also, density and resolution are different things. You can have an hdpi screen in 480x800, 600x1024 and even larger, depending on the actual screen size. – 323go Dec 10 '14 at 04:23
  • it worked using res/drawable-xxxhdpi/ for my LG density, THANKS – amjad Dec 15 '14 at 00:11

1 Answers1

0

Through below code you can identify the corresponding folder for your device.

DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
switch(metrics.densityDpi){
    case DisplayMetrics.DENSITY_LOW://ldpi
        break;
    case DisplayMetrics.DENSITY_MEDIUM://mdpi
        break;
    case DisplayMetrics.DENSITY_HIGH://hdpi similarly extra high, double extra high also //available
        break;
}

As Shiv told if you want to run in various devices you need to duplicated the images.

Dalinaum
  • 1,142
  • 13
  • 18
MathanG
  • 1,195
  • 10
  • 22