Android Software Developer Kit
Now that we have a feel for the Android platform, let's get the Eclipse environment set up for Android development so we can create our example applications. This section walks through obtaining the Android SDK and configuring it for use with Eclipse.
If Eclipse is not installed, download it and install the latest stable release of the Eclipse IDE from the Eclipse Foundation (see Resources). The installation is a compressed folder. Extract the contents of the folder to a convenient place on your computer. The installer does not create any icons or shortcuts on Windows®. For purposes of this tutorial, the Eclipse folder will be located in the c:\software\eclipse directory.
To start Eclipse, double-click on eclipse.exe found in the eclipse installation directory. This will start the IDE. The software prompts for a "workspace" and suggests a default location, such as c:\documents and settings\username\workspace. Choose this location or specify an alternative workspace location.
Once Eclipse is loaded, click the Workbench - Go to the workbench icon on the main screen.
Now it's time to obtain the Android SDK.
Find the Android downloads in Resources.
There are SDK installation versions available for Windows, Mac OS X (Intel® only), and Linux (i386). Select the latest version of the SDK for the desired platform. Note that at the time of this writing, the latest Android SDK version is marked m3-rc37a.
The Android SDK is a compressed folder. Download and extract the contents of this file to a convenient place on your computer. For purposes of this tutorial, the SDK is installed to c:\software\google\android_m3-rc37a. Obviously, if you are installing this on Mac OS X and Linux, you should install the SDK where you usually put your development tools.
Both Eclipse and the Android SDK are installed. It's time to install the Eclipse plug-in to take advantage of the Eclipse environment.
The following steps demonstrate the installation of the Eclipse plug-in, officially known as Android Developer Tools. Note that alternative installation directions are available from the Android Web site. See Resources for more information.
Install the Android Developer Tools:
- Run the "Find and Install" feature in Eclipse, found under the Help > Software Updates menu.
- Select the Search for new features to install option.
- Select New Remote Site. Give this site a name, such as "Android Developer
Tools," for example. Use the following URL in the dialog:
Please note the HTTPS in the URL. This is a secure download.
Figure 1. New Update Site
- A new entry is added to the list and is checked by default. Click Finish. The search results display the Android Developer Tools. Select the Developer Tools and click Next.
- After reviewing and accepting the license agreement, click Next. Note that the license agreement includes a special requirement for use of the Google Maps API.
- Review and accept the installation location, then click Finish.
The plug-in is now downloaded and installed. The plug-in is not signed (at the time of writing), so proceed at your own comfort level by clicking on Install All, then restart Eclipse.
Once Eclipse is restarted, it is time to connect the plug-in to the SDK installation. Select Preferences under the Window menu. Click on the Android item in the tree view to the left. In the right-hand pane, specify the SDK installation location. The value used for this tutorial is c:\software\google\android\m3-rc37a (again, use appropriate locations in Mac OS X and Linux installations).
Once the SDK location is specified, there are three other sections that may be configured. They are mentioned here briefly:
- The Build section has options for rebuilding resources automatically. Leave this checked. The Build option can change the level of verbosity. Normal is the default.
- DDMS — Dalvik Debug Monitor Service is used for peering into a running VM. These settings specify TCP/IP port numbers used for connecting to a running VM with the debugger and various logging levels and options. The default settings should be just fine.
- LogCat — This is a log file created on the underlying Linux kernel. The font is selectable in this dialog. Adjust this as desired.
Congratulations! The Eclipse environment is ready to create Android applications.