2
votes

I am having problem creating layout for different devices. The old qualifier example small, normal and large, xlarge etc..

My layout is very simple. I just want the whole interface keep the same through different devices...

From the android website there is :

xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp

How should i define with new type of naming to replace small normal large etc..and does that mean i can't use small normal ... as the qualifier for new android os.

1
you can use these qualifiers layout for normal, layout-small for small and so on.Kanwaljit Singh
I thought they was deprecated after android 3.0 so i am a bit confused xLarge is for what screen?? is that a tablet sizeLittleFunny
If you want it to be the same, measure the the screen and resize layouts programmatically.alex
@Simon for xlarge use layout xlarge. Yes it supports tablet size.Kanwaljit Singh
In documentation, they suggest to use layout-sw600dp etc? what is wrong with layout-small etc. Sorry I am too confused with these stuff.LittleFunny

1 Answers

2
votes

For supporting different size screens you can create simply 4-layout folders. layout for normal size, layout-small for small, layout-large for large and layout-xlarge for xlarge screens. And for size of font you can create different values folder like values, values-ldpi, values-mdpi, values-hdpi, values-xhdpi. Then you can create values folder depending upon height or width and belongs to ldpi or mdpi i.e values-w360dp-mdpi or values-h600dp-mdpi. Then android automatically picks layout depending upon screen size and values on depending height or width. And you can combine these with new selectors. Like create layout-sw600dp for 7" tablets.

For more information see this link.