Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Different Language Support in Android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 242
    Comment on it

    Android gives us the facility to support different languages in your application. The solution is very easy, you just have to define separate values folder for each language and define every String there. You need to add a hyphen and ISO language code with values folder like Values-fr or values es. At run time, android will load it according to the settings of the device.

    These are the example to add different language compatibility.
    English (default locale), /values/strings.xml:

    <!--?xml version="1.0" encoding="utf-8"?-->
    
    <resources>
    <string name="title">My Application</string>
    <string name="hello_world">Hello World!</string>
    </resources>
    
    

    Spanish, /values-es/strings.xml:

    <!--?xml version="1.0" encoding="utf-8"?-->
    
    <resources>
    <string name="title">Mi Aplicacin</string>
    <string name="hello_world">Hola Mundo!</string>
    </resources>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: