O'Reilly logo

Android Development Tools for Eclipse by Sanjay Shah, Khirulnizam Abd Rahman

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

String resources

Usually, it is a practice for Android application to store the string values for user interface reference in the XML file due to the nature of mobile apps, which is distributed internationally. So it is best to provide multiple language options. However, this practice is optional, and you may use direct string assigning if you wish to do so.

The string resource file is in an XML form and available through the project tree in res/values/strings.xml. These string resources can also be used to store color information, integer arrays to name some.

Now, add a new string value by clicking on the Add button, provide the variable name in the Name box and the Value of the string. Press Ctrl + S to save the changes. For example, in the following ...

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