how to read value from string.xml in android?

Solution 1:

Try this

String mess = getResources().getString(R.string.mess_1);

UPDATE

String string = getString(R.string.hello);

You can use either getString(int) or getText(int) to retrieve a string. getText(int) will retain any rich text styling applied to the string.

Reference: https://developer.android.com/guide/topics/resources/string-resource.html

Solution 2:

In Activity:

this.getString(R.string.resource_name)

If not in activity but have access to context:

context.getString(R.string.resource_name)
application.getString(R.string.resource_name)

Solution 3:

I'm using this:

String URL = Resources.getSystem().getString(R.string.mess_1);