CHAPTER 3: An Introduction to the Android Application Development Platform 69
- You will also define your application’s package name, absolute.beginners.
hellouniverse, using this dialog. The parts of a package name are separated
using periods, and a package name generally uses lowercase characters.
Since this is the Absolute Beginners book, and the HelloUniverse app, I used
absolute.beginners.hellouniverse for the package name. You’ll learn more
about Java packages in the next chapter, when we get into the structure of the
Java programming language and its various components in far greater detail.
The next four drop-down selectors in the middle of this dialog allow you to specify which API
versions of Android OS you want your application to support (run on), and what you want your
application to look like, which is controlled using something called a “theme” in Android, which we
will be looking at in Chapter 5.
- The first of these drop-down selectors allows you to specify the Minimum
Required SDK, which will determine how far back (in version numbers) your
Android application support will go! I accepted the default Android 2.2 value,
as there are still a lot of Android 2.2 smartphones and Kindle Fire uses 2.3,
so 2.2 and later covers the vast majority of the Android devices out there.
Note If you wanted to see the exact percentage of the device market that each OS version has at any given
time, you can use the Android developer web site “dashboard” feature, which tracks what percentage of each
OS version is being used by manufacturers on their Android devices. If you want to see these percentages
now, you can visit the following URL on the Android developer web site, where these statistics are
kept up-to-date: http://developer.android.com/about/dashboards/index.html
- The second of these drop-down selectors allows you to select the Target SDK,
which is essentially the opposite of the Minimum SDK, as it sets the other end
of your app’s range of version support. This is usually set to reflect the latest
version of the OS that has been released, as that will be the most feature-filled
and have the fewest “bugs” or code that does not work optimally. We will set
our Target SDK to Android 4.4.2 API Level 19, since that is currently the latest
version and is what we have installed in Eclipse and for our AVD emulator.
If you are using Android 4.4.4, this will say API 19: Android 4.4.4 in the drop
down menu. - The third of these drop-down selectors allows you to determine which API
(OS version) Eclipse uses to compile your application DEX file with, and as
you might imagine, this should match your Target SDK. This is because we
are allowing the Android Compatibility Library (which we saw in Chapter
2 in the Android SDK Manager) to provide the “backwards OS version
compatibility support” for the code we are writing, allowing us to develop
for the latest OS revision without having to create a plethora of OS version-
specific DEX files.