CHAPTER 3: An Introduction to the Android Application Development Platform 77
Android Resources: Asset Project Folders
If you want to add custom animation, custom themes, digital video, and digital audio to an Android
project, you will have to add new folders to your project folder hierarchy. You will be learning how to
do this during the course of this book, as you learn about how to create and add in these types of
assets to your Android application.
For now, however, I just want to give you an overview of the different folder types and names that
are possible to have in your Android application projects. This is so that you have a high-level view
of what is possible in Android development as well as the types of Android assets you are going to
learn how to incorporate during this book.
Your external new media assets (that is, those primarily created outside of Android, using software
like GIMP and Blender 3D) are kept in the resources folder, shown in Figure 3-9 opened up to show
all the sub-folders, and referenced as HelloUniverse/res. Other resource assets that are external
to your Java code and XML markup such as constants, styles, themes, and user interface layout
definitions, are also kept in this folder. Externalizing resources allows your Android development
process to be more modular by nature, and to be more organized.
There are many different resource types in Android, and they either have their own sub-folders, under
the /res/ project folder, or their own files, under the /res/values/ folder. We will go over the majority
of these in detail in the next eight sections of this chapter. Primary types of resources include:
drawable resources (graphic)
layout resources (user interface design)
menu resources (menu navigation)
values resources (constant definitions)
raw resources (video and audio files)
xml resources (configurations and definitions)
string resources (text values)
color resources (custom colors)
Table 3-1. Android Project Directory (Folder) Hierarchy, Showing the Key Sub-folders We Will Be Using in this Book
Project Sub-Folder Name: What application assets this sub-folder will contain:
/src Java source files (your Java programming logic)
/res Project resources (your XML markup definitions)
/res/drawable Digital image and digital illustration assets
/res/anim 2D animation assets (procedural or tween animation)
/res/raw Digital video and digital audio assets
/res/values Data values which remain fixed, called “Constants”
/res/layout UI design layout definitions
/res/menu Application menu structure design definitions