Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

screen support multiple devices using layout-large,layout-normal and layout-xlarge folders

I created layout-large, layout-normal and layout-xlarge in the res folder and I copied all the xml files to those layout folders

First, I want to ask what is the difference between layout (the default) and layout-normal folder?

I know if I run the application on big screen size the app will take the xml files from layout-xlarge. So I made all the elements in layout-xlarge look as I want using FrameLayout in tap2 10.1, but when I run it in note2 or s3 mobile it looks different because the screen size is not same.

So how can I make the the application run in tap2 10.1 (1,280 x 800) and note2 or s3 mobile (1,280 x 720) size?

like image 614
Mohammed Asmar Avatar asked Jul 28 '13 19:07

Mohammed Asmar


People also ask

How to set layout for different screen size in Android studio?

Create a directory for each screen configuration that requires a different layout. Then append a screen configuration qualifier to the layout directory name (for example, layout-w600dp for screens that have 600dp of available width).

Which are the screen sizes in Android Small Large normal?

Screen-size Buckets Android has included support for three screen-size “buckets” since 1.6, based on these “dp” units: “normal” is currently the most popular device format (originally 320x480, more recently higher-density 480x800); “small” is for smaller screens, and “large” is for “substantially larger” screens.

How do you manage different screen sizes and orientations?

To ensure that your layout is flexible and adapts to different screen sizes, you should use "wrap_content" and "match_parent" for the width and height of some view components.


1 Answers

Here there is the official description of how support all the screen size. And as described the layout folders are:

res/layout/my_layout.xml             // layout for normal screen size ("default")
res/layout-small/my_layout.xml       // layout for small screen size
res/layout-large/my_layout.xml       // layout for large screen size
res/layout-xlarge/my_layout.xml

So layout and layout-normal folder are the same, but in the new Android API there isn't no more the layout-normal folder, but only layout folder. Also you have to know if there isn't the specific layout of the screen size in witch the app is running, by default the app takes the "default" layout.

EDIT

You can have different screen resolutions in the same folder, as you can learn from this images:

enter image description here

If you want a more specific layout for specific resolution you have to detect at run time the exact screen size.

like image 84
lory105 Avatar answered Oct 20 '22 00:10

lory105