Use resources for as much data as you can. It makes it easier to change things.
You can use the property window to create and use resources or you can edit the XML directly.
There is a wide range of resource types. In addition to layouts and menus, you are certain to use values and drawables.
Drawables are an example of a resource that doesn't use an XML file - you simply copy the graphics resource files into the drawables directory.
You can store simple data types in the values resource directory and this is often a better way to do things than using constants in the code.
The R object is automatically generated and its structure mimics the resource directory structure. For each resource the R object has an integer resource id.
Many methods take a resource's id and retrieve the resource for you. If you want to explicitly access a resource in code then use the methods that the Resources object provides.
Conditional resource allow you to provide resources that suite the current device - locale, screen resolution and so on.
Conditional resources work by applying qualifiers to the names of the directories that hold the resource files, e.g. values-es/.
Android Studio provides a simplified view of conditional resources that groups all variations on a resource file in the same abstract directory. This does not correspond to the file structure but it is simpler.
You can use Android Studio's New, Resource File command to create conditional resources.
The layout editor lets you select which locale resource is used so that you can work directly with the localized layout.
If you want to localize your app then make use of the Android Studio Translation Editor.
Android Programming In Java: Starting With an App Third Edition