Static fragments and dual-pane layouts
The previous exercise introduced you to static fragments, those that can be defined in the activity XML layout file. You can also create different layouts and resources for different screen sizes. This is used for deciding which resources to display depending on whether the device is a phone or a tablet.
The space for laying out UI elements can increase substantially with a larger size tablet. Android allows specifying different resources depending on many different form factors. The qualifier frequently used to define a tablet in the res
(resources) folder is sw600dp
.
This states that if the shortest width (sw
) of the device is over 600 dp, then use these resources. This qualifier is used for 7” tablets and larger. Tablets facilitate what is known as dual-pane layouts. A pane represents a self-contained part of the user interface. If the screen is large enough, then two panes (dual-pane layouts) can be supported. This also provides...