0

I am having some problems with layouts in my android application. I have created multiple android resource directories, for multiple android devices. The problem stands when I try to test my app on a nexus 5 emulator the screen's layout is out of bounds, it is disproportionate completely. In my app all the layouts for the layout-xxhdpi-1080-1920 seem completely alrigth, the problem arises when I start my app in an nexus 5 emulator. It seems that the emulator picks a different layout size and not the one is it supposed to.

And I also have one question reqarding layout creation. Is the any better way to cover as much android devices as possible, instead of making all layout resolutions: for example: -mdpi-460x800 , xhdpi-720x1290, xhdpi-1080x1920, and so on ... It really takes about more than 18 layout directory types and it is quite a lot.

I already looked at all the documentation Supporting different screens.

Horizon_Net
  • 5,959
  • 4
  • 31
  • 34
  • Did you try the app on a real device? Sometimes, an AVD can show some things differently. A real device can give you a more correct idea. – Pratyush Yadav Jun 28 '15 at 21:01
  • Yes I have tried it, and the layout that displayed on a nexus 5 device is not the right one. Still can't find the problem – CodeBlock Jun 28 '15 at 21:32

1 Answers1

0

You could cover almost every android device in the world. To do this you need have device specific resources.

for android versions earlier than 3.2

layout-ldpi
layout-mdpi
layout-hdpi
layout-xhdpi

for android version 3.2 and higher

layout-sw360dp
layout-sw420dp
layout-sw600dp
layout-sw720dp

This is just an representative example, more information here in android docs

Durga Mohan
  • 1,110
  • 9
  • 11