I have two android devices for testing. One is with resolution 480×320 and other is with 800×480. I define different layouts in layout-normal and layout directories. I also tried it with layout-hdpi, layout-mdpi etc different combinations.
Is there a way to know from the log of somewhere that in which layout category a device falls just for debugging purposes. I would like to know layout file from which directory is used at runtime. If not then could someone tell me the right combination of layout directories for two devices with the pre-mentioned resolution.
Thanks in advance.
To find which layout (from
layout-ldpi,layout-mdpifolder etc…) is used during runtime. You can use the tag attribute on your layout. For example let’s say you have defined two layouts for different screens, the one inlayout-mdpifolder and the other inlayout-hdpifolder. Something like this:And:
To check which layout is used during runtime, you can use something like this: