Create an Android Development Environment
Getting the Android SDK
The last thing you need is the Android SDK. Since many Android versions are available, the SDK developers created a two-step approach. First, you download the SDK Starter Kit and then you download the runtime environments (called “platforms” in Android-speak) that you wish to support. As usual, when deciding which platform to develop for it’s a tradeoff between supported functions and uptake. You might see a feature you want in the latest release of Android, but that doesn’t help if your targeted device doesn’t support that release. This is a very subjective decision that’s specific to your business requirements, but I stick with the 2.x releases of Android (and specifically 2.2, also known as Froyo, because that’s the version my Samsung Fascinate supports). To begin the process, head to the Android SDK download page as shown in Figure 7.
This will download the installer. Start it and you’ll see the screen in Figure 8.
I tend to put these applications into my own directory structure and this is no exception (see Figure 9). On Windows 7, for example, the installer will default to installing in the Program Files (x86) folder, but I try to avoid that whenever possible (among other reasons, that folder is “virtualized” and some things just don’t run well when installed there). Since this application is very Eclipse-related, I installed it right underneath my high-level Eclipse folder. Now everything is installed, and my final directory structure looks like this:
| +- jdk16se32
| +- android-sdk
| +- E37 Droid
There’s also a checkbox on the installer that lets you launch it after installation. If you selected that checkbox, the SDK Manager will start automatically. Alternately, you can start the SDK Manager from the Start menu. SDK Manager will start up and immediately go to the Internet to try to find packages to download. It will take a few moments.
Figure 10 shows the screen, but after I have changed it to select only those components I need for this project. When the SDK Manager first comes up, by default it has the Android 4.0 platform selected for download. I don’t need that, because I am focusing entirely on the 2.2 platform for now. It doesn’t hurt to download all the pieces, but I think it’s more confusing that way, especially if you’re not intending to write for version 4.0 anytime soon. If you match what I did, you should select exactly four packages to download, and the button will then say “Install 4 packagesÉ.” The SDK Manager will download those components and install them. You may get a warning message that the command ‘adb kill-server’ failed, but you can ignore that.
Once the download and installation is done, we’re almost finished.