Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Earlier, I gave you a basic mapping of what goes where in the res/ folder. In this section, I’ll show you its more advanced functions. As always, you can either code this yourself or follow along from the sample code posted at Peachpit.com/androiddevelopanddesign.
The layout folders are the source of the first tool at your disposal, and it’s one of the best. Android will, if configured correctly, pick layout files from a folder that matches the hardware configuration closest to the one it’s running on. Using this tool, you can define multiple screen layouts for any number of different hardware configurations. Let’s start with something simple: landscape mode.
Let’s say you have a simple screen with two buttons. Let’s take a look at the layout XML that produced the two buttons.