O'Reilly logo

Pro Android 4 by Satya Komatineni, Dave MacLean

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Resources and Configuration Changes

Resources help with localization. For example, you can have a string value that changes based on the language locale of the user. Android resources generalize this idea to any configuration of the device, of which language is just one configuration choice. Another example of a configuration change is when a device is turned from a vertical position to a horizontal position. The vertical mode is called the portrait mode and the horizontal mode the landscape mode.

Android allows you to pick different sets of layouts based on this layout mode for the same resource ID. Android does this by using different directories for each configuration. An example is shown in Listing 3–36.

Listing 3–36. Alternate Resource ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required