0

I've used several images with different sizes. I copied the images into different folders. such as (except drawable-ldpi folder):

enter image description here

for example :

drawable-mdpi test.png => 60*60 px

drawable-hdpi test.png => 85*85 px

drawable-xhdpi test.png => 110*110 px

drawable-xxhdpi test.png => 110*110 px

I have only one folder my layouts:

enter image description here

my manifest:

<supports-screens
     android:anyDensity="true"
     android:largeScreens="true"
     android:normalScreens="true"
     android:resizeable="true"
     android:smallScreens="true"
     android:xlargeScreens="true" />

now, when I install my project on galaxy s4, images within the program shows drawable-mdpi folder. why ?


I even made ​​a separate folder for my layout and changed width and height of image :

res/layout/my_layout.xml imageview => layout_width and layout_height = 48*48 // default

res/layout-large/my_layout.xml


res/layout-xlarge/my_layout.xml

But always the default option is selected ! why?

Has AlTaiar
  • 4,052
  • 2
  • 36
  • 37
user3103823
  • 135
  • 1
  • 3
  • 13
  • the problem you face when you install app after publish – mohammed momn Jan 29 '14 at 22:49
  • 3
    not a solution, but an advice : you don't need to create different layout just for having different layout width and height. It's better to keep the same layouts if there is no difference between them and put width and height in `values/dimens.xml` for normal values and `values-large/dimens.xml` for large one, etc. – S.Thiongane Jan 29 '14 at 22:53
  • Do I need to make a /res/layout and values-large/ values-xlarge/ values-xxlarge/ ? (minSdkVersion="11") – user3103823 Jan 30 '14 at 07:19

1 Answers1

1

you don't need to write support-screens in the minifest - default is fine.

first things first:

  • s4 is on the upper end of normal but it should still be normal not large. this is why your 'layout-large' was not used. but you should not use the size selection stuff, dpi selection is much better (so one layout should work).
  • s4 is on the edge between xxhdpi and xhdpi so samsung can decide what it is. i think they used xhdpi. but this should not realy matter.

dpi categories:

  • ldpi (you will not need it because neerly no device has it)
  • mdpi = 160dpi or 1x
  • hdpi = 240dpi or 1,5x
  • xhdpi = 320dpi or 2x
  • xxhdpi = 480dpi or 3x

simple dpi example:
if you have a fullscreen design/image in full hd (1080x1920) you can just cut the stuff out as you need it and will get it correct for xxhdpi. (if i remember correct - maybe xhdpi) however, you can calculate the lower sizes from this point. - xxhdpi = 1080x1920 - xhdpi = 720x1280 (/3*2 of the above) - ...

if you do it this way it should work correct ;)

A. Binzxxxxxx
  • 2,812
  • 1
  • 21
  • 33