In our little sample application we used the strings.xml to define static texts.
If you want to use the build-in multi-language support you just have to follow some easy conventions.
To use localization for strings you have to add a new directory to res/ and name it “values-de” for the german language.
Create a strings.xml in this directory and deploy your application. If you now change your language on the device or emulator, the phone picks the strings.xml with the matching local code and uses it – in the same manner you could provide images etc. for a specific language (i.e. graphical buttons).
Works well for our little sample.

Our strings.xml for the german language:

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Wähle einen Freund</string>
    <string name="button_info_text">Bitte wähle einen Kontakt aus</string>
    <string name="button_text">Auswahl</string>
    <string name="contacts">Kontakte</string>
    <string name="chosen">Sie haben ausgewählt:</string>
</resources>
Share