Localizing Resources

Language settings are part of the device’s configuration, like the screen orientation configuration you have encountered. Android provides qualifiers for different languages just as it does for screen orientation, screen size, and other configuration factors. This makes localization straightforward: You create resource subdirectories with the desired language configuration qualifier and put the alternative resources in them. The Android resource system does the rest.

In your CriminalIntent project, create a new values resource file: In the project tool window, right-click res/values/ and select NewValues resource file. Enter strings for the File name. Leave the Source set option set to main and make sure ...

Get Android Programming: The Big Nerd Ranch Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.