CHAPTER 3: An Introduction to the Android Application Development Platform 79
As you can see in Figure 3-9, I opened the first drawable-hdpi folder for you to show the ic_launcher
graphic file, which the Configure Launcher Icon dialog shown in Figure 3-5 created for you in four
different resolution density versions. If you are wondering what the pixel dimensions are for these
ic_launcher files in the drawable subfolders that have arrows next to them (which indicates that there
are files in the folders), take a look at the sixth column in Table 3-2. So the ic_launcher graphic I
exposed in the drawable-hdpi folder is 72 by 72 pixels.
There are about a dozen different types of drawable objects in Android, each of which has
their very own class. Some of the more important drawable types include: BitmapDrawable,
ShapeDrawable, NinePatchDrawable, AnimationDrawable, LayerDrawable, TransitionDrawable, and
StateListDrawable, to name a few. I will try and implement as many different types of drawables as I
can during this book, so you will be well-rounded (no pun intended) when it comes to using graphics
(drawables) in Android application design and development. If you wanted to dive into these graphics
classes at a pro level, check out the Pro Android Graphics title, by Wallace Jackson (Apress, 2013).
There are several types of drawable assets that will need to be placed in the drawable folders
for these assets to be visible to, and accessible to, the Android application. The primary one is
Bitmaps, which we will be covering in Chapter 9, as well as media assets that are based upon
(created with) Bitmaps, such as Frame Animation. Any assets that reference Bitmaps or Frame
Animation in an XML definition file format would also be kept in this folder, as would any XML
definitions creating Shapes (2D vector graphics).
Table 3-2. Android Device DPI: Seven Levels of Pixel Density Constants Specifically Supported in Android
Android Device
DPI Constants
Currently in the
Android OS
Screen Size
Constant
Pixel
Density
in DPI
Pixel
Multiplier
Index
Minimum
Screen Size
Launcher
Icon Size
in Pixels
Action Bar
Icon Size
Notify Icon
Size
LDPI
(Low Density)
small 120 0.75 426x320 36x36 24x24 18x18
MDPI (Medium) normal 160 1.0 470x320 48x48 32x32 24x24
TVDPI
(HD 1280x720)
HDTV 213 1.33 640x360 64x64 48x48 32x32
HDPI
(High Density)
large 240 1.5 640x480 72x72 48x48 36x36
XHDPI
(Extra High)
xlarge 320 2.0 960x720 96x96 64x64 48x48
XXHDPI
(Super High)
xxlarge 480 3.0 1280x960 144x144 96x96 72x72
XXXHDPI
(Ultra High)
xxxlarge 640 4.0 1920x1080 192x192 128x128 96x96