2

I read this link :

Different resolution support android

res/values-sw720dp/dimens.xml (800*1280)

but when I run my layout on Nexus 7 - API 19 800*1280 on the Genymotion,it use

values-hdpi

instead of

values-sw720dp

!

enter image description here

my min api is 14.

why?

Community
  • 1
  • 1
S.M_Emamian
  • 17,005
  • 37
  • 135
  • 254
  • 2
    Using density qualifiers for anything other than drawables is unlikely to give you good results. If you use any units other than `px` in your `dimens.xml` resources, the units will already take density into account. – CommonsWare Aug 04 '14 at 21:10
  • tnx,'Using density qualifiers for anything other than drawables is unlikely to give you good results.' so, what is the best qualifier name for Nexsus 10 - 4.4.2 2560*1600 device? it use layout-sw720dp instead of layout-xlarge-xhdpi! if I want to use swdp qualifier for this screen resolution (2560*1600),which should I choose? or What should I choose? – S.M_Emamian Aug 05 '14 at 10:32

1 Answers1

5

Because the Nexus 7 does not have a smallest width value >= 720dp. The Nexus 7 is TVDPI (1.3x) density, so that means the 1280x800 resolution is effectively 961dp x 600dp. So it should match the sw600dp qualifier, but it will not match sw720dp, as its smallest width is 600dp.

Kevin Coppock
  • 133,643
  • 45
  • 263
  • 274
  • but when I change values-hdpi on Nexus 7 800*1280, my layout will change ! another question, what is qualifier name for Nexus 7 API 18 - 1200*1920 ? – S.M_Emamian Aug 04 '14 at 21:02
  • If you look at the table [here](http://developer.android.com/guide/topics/resources/providing-resources.html) you'll see that the `sw` qualifiers take precedence over density qualifiers (e.g. `hdpi`), so if you use `sw600dp`, that will be the directory that the Nexus 7 pulls from. – Kevin Coppock Aug 04 '14 at 21:11