// this will look for an id of string (located in strings.xml)
// that has key name "web_user_agent", "android" is the reference
// to Android OS resources
int id = Resources.getSystem().getIdentifier("web_user_agent", "string", "android");
// now user agent can be found in system resources using the id
String webUserAgent = Resources.getSystem().getString(id);
This has also a good use case when an application is built not with SDK but with Android OS source tree. When application is built in this tree then access to com.android.internal.R is granted, but this may bring many complications when application will be executed on some vendor specific device. This problem comes from the fact that any given vendor can edit for example the strings.xml file, and then com.android.internal.R will be regenerated with some new values. Our application on compilation time will have an inlined int value reference to some string resource from the original Android OS, for example:
int web_user_agent = 0x00000001;
But on device X with some custom fancy UI and changed resources values 0x00000001 will be assigned to
int fancy_very_important_string = 0x00000001;
When application will launch on such device, it will look up for a string with id 0x00000001 and instead of getting string located under the key web_user_agent it will receive fancy_very_important_string.
This is of course a scenario that wont happen to most developers because most of them use official Android SDK that protects developers from hanging themselves along with their application. However if you will play with the Android source tree, problems like that are coming.