Updated 22 December 2016
In This Blog,
I have talk about some basic points for support the layout for multiple screens and konw the method for create it. Because Android runs on a family of devices that allow various screen sizes and densities.
We should know some important things before make multi screen layout.
Screen size: Actual physical size, measured as the screen’s diagonal.
four generalized sizes: small, normal, large, and extra-large.
Screen density: The quantity of pixels within a physical area of the screen; usually referred to as dpi (dots per inch).
Six generalized densities: low, medium, high, extra-high, extra-extra-high, and extra-extra-extra-high.
Orientation: The orientation of the screen from the user’s point of view. This is either landscape or portrait.
Resolution: The total number of physical pixels on a screen.
Density-independent pixel (dp)A virtual pixel unit that you should use when defining UI layout, to express layout dimensions or position in a density-independent way.
A set of six generalized densities:
If you create design your UI for different screen sizes, you’ll find that each design requires a minimum amount of memory space.
So, each generalized screen size above has an associated minimum resolution that’s defined by the system.
These minimum sizes are in “dp” units—the same units you should use when defining your layouts—which allows the system to avoid worrying about changes in screen density.
If you want to create layout for handset then you have to create activity in normal layout folder
1 |
res/layout/main_activity.xml |
And if you want to create the layout for the For 7” tables then create your activity in the layout-sw600dp folder and use the drawable-sw600dp.
1 2 |
res/layout-sw600dp/main_activity.xml res/drawable-sw600dp/image.png |
if you want to create the layout for For 10” tables then create your activity in the layout-sw720dp folder and use the drawable-sw720dp.
1 2 |
res/layout-sw720dp/main_activity.xml res/drawable-sw720dp/image.png |
Note:
sw
means “smallest width”. It doesn’t change if the device is rotated.
If you want to change the layout when the screen orientation has changed then use Available width – w<N>dp.
1 2 |
res/layout-w600dp/main_activity.xml res/drawable-w600dp/image.png |
If you are using “available width” qualifier, w<N>dp
then one device may actually use both layouts, depending on the current orientation of the screen.
Note: layout-w600dp uses Multi-pane.
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.