December 2013
Beginner
416 pages
12h 45m
English
Resource files are a common technique for localizing applications to other languages. These files collect all strings in one location for easy editing, a practice that’s preferred to hard-coding the strings in the code, which supports maintainability of the application. A resource file contains XML values with named attributes that are used in an application, as in Listing 3.2.
Listing 3.2 Resource XML File
<resources> <string name="app_name" >On Your Bike - Chapter 3</string> <string name="hello_world" >Hello world!</string> <string name="menu_settings" >Settings</string> <string name="title_activity_main" >MainActivity</string></resources>
Here is how you refer ...
Read now
Unlock full access