Understanding Resources

Resources play a key role in Android architecture. A resource in Android is a file (like a music file or a file that describes the layout for a window) or a value (like the title of a dialog box) that is bound to an executable application. These files and values are bound to the executable in such a way that you can change them or provide alternatives without recompiling the application.

Familiar examples of resources include strings, colors, bitmaps, and layouts. Instead of hard-coding strings in an application, resources allow you to use their IDs instead. This indirection lets you change the text of the string resource without changing the source code.

There are many, many resource types in Android. Let's start this ...

Get Pro Android 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.