Getting resources of another Application

If you are the developer of both applications then the right approach would be, as othes noted, to create an Android library project and share it between apps. Nevertheles, you can still access resources from another app, even if this is not your app: Resources res = context.getPackageManager().getResourcesForApplication(“com.example.foo”)

Using Locale to force Android to use a specific strings.xml file for a non-supported language

Will this work? I.e., can we control which strings.xml file it uses via Locale, even if the device has no native support for that language? Yes, you can, by updating Locale within Configuration (see an example below). If you try to use the locale for which there are no corresponding resources (either within your app … Read more

What is the concept behind R.java?

Biggest advantage is in Localization and Providing alternate resources for different screen sizes. e.g you can have a String resource R.string.myname this could be a defined in english in /values-en/strings.xml and in spanish in /values-es/strings.xml System will take care or picking up the right file depending on the locale you just need to use @string/myname … Read more

Android: html in strings.xml

The best way to add html source code in strings.xml is to use <![CDATA[html source code]]>. Here is an example: <string name=”html”><![CDATA[<p>Text</p>]]></string> Then you can display this html in TextView using: myTextView.setText(Html.fromHtml(getString(R.string.html))); If you have links in your html and you want them to be clickable, use this method: myTextView.setMovementMethod(LinkMovementMethod.getInstance());