A (175)

(Tuis.) #1
CHAPTER 3: An Introduction to the Android Application Development Platform 75

Eclipse has created a HelloUniverse project folder and sub-folder hierarchy (structure) as well as
opened up your Java Activity class in a currently active (selected) tab and your XML UI definition
in a currently inactive (ghosted or deselected tab), as you can see in Figure 3-8. There is also a
“bird’s-eye view” of your Java code hierarchy in an Outline pane on the right. The Package Explorer
pane on the left is used to navigate the project infrastructure, as you are about to do next, so that
you can learn about what assets go where in an Android application project!


We will be getting into what the Java code in the Eclipse central Editing pane does in the next
chapter, so for now, let’s focus on the Package Explorer pane and learn how to use that to navigate
our Android project structure. As we do this, we will take a look at the various sub-folders and
what components of our Android application need to be stored in certain sub-folders. One of the
things you need to do to become an Android developer is to learn how Android projects need to be
organized. It’s really too bad there is not “forced organization” in more areas of our lives, because
as you will soon see, Android is organized in such a way that it forces your app development to be
surgically precise!


Navigating Around an Android Project


To close an open folder, such as the /HelloUniverse/src/absolute.beginners.hellouniverse/ folder,
containing your MainActivity.java file, shown highlighted in Figure 3-8, click on the downward-right
pointing arrow at its left, called a collapse arrow, and it will close the folder, and will then display a
right pointing arrow, called an expand arrow, instead of a downward-right arrow.


Conversely, to open up any folder, click the right pointing arrow, and it will reveal what is inside or
underneath this folder, which will always be either another folder structure and/or a file or series
of files. Let’s do this to open your Android project’s resource folder, named /res, which is shown
opened up in Figure 3-9.


Figure 3-8. The bootstrap Android application MainActivity.java Java code for Activity, Bundle, and Menu

Free download pdf