80 CHAPTER 3: An Introduction to the Android Application Development Platform
Note Vector graphics are defined using math instead of pixels; if you’re familiar with Adobe Illustrator (.AI files)
or Scalable Vector Graphics (SVG files) then you are probably familiar with the distinction between pixel-based
graphics (Photoshop and GIMP) and vector-based graphics (Illustrator and InkScape). I may have dropped the
ball in Chapter 1, as I didn’t have you download and install a vector graphics program! Google InkScape and go
download this and install it, if vector graphics is an area that interests you (or just to get free software)!
Android Layout: Assets that Lay Out a UI Design
A “layout” in Android is also aptly named, as it is a definition of how your user interface elements
and drawable assets are going to be “laid out” relative to each other on the Android device display
screen. Once we get you up-to-speed on Java, in Chapter 5, you will be learning more about UI
layout design during the rest of this book!
Chances are, if you want your Android app to have a custom design for each type of device (iTV,
smartphone, tablet, smartwatch, and so forth), you are going to have a number of custom /res/layout
folders, not just a /res/layout-land and /res/layout-port folder, as I gave as an example earlier. You
probably will have complex alternate resource folders as well, such as /res/layout-sw800dp-land
for tablets and /res/layout-sw240dp-port for smartwatches.
The /res/layout/ folder, and any custom layout alternate resource folders that you create, will
generally contain UI layout definition XML files. As you will see in Chapters 6 through 8, and over
the rest of the book, UI layouts in Android are defined using XML layout definitions. These are
hand-crafted by using XML markup, and stored in filenamehere.xml files in the /res/layout folder or
one of the alternate layout resource folders that you create.
Since we are going to look at the XML for the UI layout that Eclipse created for us earlier in the
chapter, and because we have a couple of chapters coming up specifically covering UI layout
design, I am going to leave the /res/layout/ folder coverage at that, and move on to look at some of
the other resource folder types next. If you are interested in the concept of alternate layout design
folders, you can find in-depth coverage on the Android developer web site at the following URL:
http://developer.android.com/guide/topics/resources/providing-resources.html
Android Menu: Assets that Define Menu Options
A “menu” in Android is exactly what it says it is, and what you would expect it to be: a menu, or a list
full of options, for your end-users to select from in order to navigate around your Android application
infrastructure.
There are several different types of menus in Android, including pop-up menus, context-sensitive
menus, and options menus. We will get more into menu design as we progress through this book,
adding menu items to your application’s menuing system. We will start this process during the next
chapter when we customize the default menu XML markup and Java code that Eclipse ADT’s New
Android Application Project series of dialogs created for you.
Technically, the Android menu that your application uses, via a hardware MENU button on the
Android device, or via those three vertical dots on the Action Bar at the top of an Android device