The file Strings.xml in the folder values is an excellent place to store and unify all the texts that appears in the program, no matter if they are the name of the buttons or a long alert message text.
The structure of it is very simple.
<string name="NameOfTheString">Text to show</string>
From Java file:
The simplest option is use directly
Notice R is a self generated file. All the changes made in the Strings.xml should appears there. If not, press on Project -> clean ... and click on Ok. The this file will be generated again.
From Layout file(XML):
To refer any values you can use:
In this example, it could be: