ProgrammerGuide.Net | Step by Step Programmer Guide

Adding String Resources | Android Programming | ProgrammerGuide.Net | Step by Step Guide

String resources are used to manage all UI text in a single location. Localization can be achieved by defining various definition for different languages.

Android includes a string file at res/values/strings.xml, by default. You will find “hello_world” string in the resource file when opened.

<string name=”hello_world”>Hello world!</string>

Let’s delete the above string and define as below to understand the Android string resources better

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">My Hello World Android Application</string>
    <string name="edit_message">Enter your first message in Android Application</string>
    <string name="button_submit">Submit</string>
</resources>
Please click here for related products on Amazon!

Jayashee

Add comment

Want to Check Celebrities News?