47
Chapter 2: Prepping Your Development Headquarters
Figure 2-23:
Specify the loca-
tion of the SDK in the
Preferences dialog box.
Eclipse is configured, and you’re ready to start developing Android apps. If you’re having difficulty downloading the tools from https:dl-ssl.
google.comandroideclipse, try removing the s from https:, as fol- lows: http:dl-ssl.google.comandroideclipse.
Getting Acquainted with the Android Development Tools
Now that the tools of the trade are installed, I introduce you to the SDK and some of the tools that are included with it.
Navigating the Android SDK
Whoa You find a lot of folders in the SDK Don’t worry; the folder structure of the Android SDK is pretty easy to understand when you get the hang of it.
You need to understand the structure of the SDK for you to fully master it. Table 2-1 outlines what each folder is and what it contains.
48
Part I: The Nuts and Bolts of Android
Table 2-1 Folders in the Android SDK
SDK Folder Description
usb_driver Contains the drivers for Android devices. If you connect
your Android device to the computer, you need to install this driver so that you can view, debug, and push appli-
cations to your phone via the ADT.
The usb_driver folder won’t be visible until you install the USB driver.
tools Contains various tools that are available for use during
development — debugging tools, view-management tools, and build tools, to name a few.
temp Provides a temporary swap for the SDK. At times, the
SDK may need a temporary space to perform some work. This folder is where that work takes place.
samples Contains a bunch of sample projects for you to play with.
Full source code is included. platforms
Contains the platforms that you target when you build Android applications, such as folders named
android-8 which is Android 2.2, android-4 which is Android 1.6, and so on.
docs Contains a local copy of the Android SDK documentation.
add-ons Contains additional APIs that provide extra functionality.
This folder is where the Google APIs reside; these APIs include mapping functionality. This folder remains empty
until you install any of the Google Maps APIs.
Targeting Android platforms
Android platform is just a fancy way of saying Android version. At this writing, seven versions of Android are available, ranging from version 1.1 through
version 2.2. You can target any platform that you choose.
Keep in mind that several versions of Android are still widely used on phones. If you want to reach the largest number of users, I suggest targeting an earlier
version. If your app requires functionality that older platforms can’t support, however, by all means target the new platform. It wouldn’t make any sense to
write a Bluetooth toggle widget targeting any platform earlier than 2.0 because earlier platforms can’t use Bluetooth.
Figure 2-24 shows the percentage of each platform in use as of July 1, 2010. To view the current platform statistics, visit http:developer.android.
comresourcesdashboardplatform-versions.html.