Android by default allows the programmer to decouple the code and the non-code assets such as text, images and formatting. These "resources" are present under the res/ directory . The default text for example is present inside res/values/strings.xml. For instance, if your default language is English and you want to allow your application's text to localize to French when the device's language is changed to French, the application would need to have an alternative locale-specific resource directory, res/values-fr/strings.xml in this case .
Let's now consider an example. We have an application interface which contains a button which should have the label "Send" in English and "Envoyer" in French. We first add the following line to res/values/strings.xml:
And then add
to res/values-fr/strings.xml. Inside the layout XML for this button's interface, within the button's definition tag (<button></button>), we add android:text="@string/string_send". Essentially, what we have done is that by way of indirection, we have pointed the Android runtime to access our string resource using @string. To access the same string programmatically in Java we would use getString(R.string.string_send). Our button has now been localized to French. The same strategy can also be used to localize graphics, i.e. by providing graphics in both res/drawable/ and res/drawable-fr/. The two-letter ISO 639-1 code for other languages can be found at .
An extra tip: If you want to post XML code in your blog post for example, encode it using  instead of posting it directly because otherwise it will be treated as actionable HTML.