Android Development Environment Setup

Overview of Installation: This table includes the latest versions of the tools use for Android development. Use these versions when creating a fresh install. Where possible, update to these versions if using an already existant install.

Software Version
Java Development Kit (JDK) 1.6 Update 26
Eclipse (32-bit) Helios (3.6.2)
Android SDK Revision 11

Use the Android SDK and AVD Manager to install the following

  • Android SDK Tools
  • Android SDK Platform-tools
  • SDK Platform Android 3.2, API 12
  • SDK Platform Android 2.3.4, API 10
  • Google APIs by Google Inc., Android API 12
  • Google APIs by Google Inc, Android API 10
  • Usb Driver package

Versions to Install

  • revision 11
  • revision 5
  • revision 12
  • revision 1
  • revision 1
  • revision 2
  • revision 4
ADT Eclipse Plug-in 11.0.0
Subversive Eclipse Plug-in 0.7.9.I20100512-1900

1.0 Overview of Development Environment

Android is an open source mobile operating system. Functionality can be added to the operating system by developing applications. This document will describe how to set up a personal computer for Android application development.

The Eclipse IDE provides a development environment for Java applications. The functionality of Eclipse is extended through the use of plug-ins. For Android application development, the Android Development Tools (ADT) plug-in can be added to Eclipse. The ADT plug-in provides functionality for developing Android applications, like UI creation, XML editing, and application development.

Other plug-ins can extend Eclipse's functionality in useful ways. One of the plug-ins we'll use is Subversive, which provides connectivity to a Subversion repository. Subversion allows teams to collaborate on a common code base and tracks changes to the code base over time.


2.0 Install Java Development Kit

Java libraries are required to run the Eclipse platform. The Java Development Kit (JDK) provides the Java libraries in addition to the javac and java commands for compiling and executing Java programs. The Java Runtime Environment (JRE) provides the Java libraries and the java command for running Java programs. While Eclipse only requires the JRE to run; most Java developers prefer to install the JDK so that they have access to the compilation functionality from the command line or when using other IDEs.

Java also comes in several editions: standard edition (SE), enterprise edition (EE), and micro edition (ME). EE is used for enterprise level development, typically at large corporations, while ME is used for mobile and embedded development. SE provides enough functionality for most medium to large development activities.

The JDK can be downloaded from http://java.sun.com/. Download the executable for your operating system and follow the installation instructions. Remember which directory you installed the JDK in. If you don't like the provided directory, you can select another directory.

After installing, we want to add the javac and java command to our path so we can run them from the command line. To do this, open your Control Panel, and select System. On Windows XP, select the Advanced tab. On Windows Vista, select the Advanced System Settings task. In the resulting window, select the Environment Variables button.

Select the Path variable and select Edit. Move your cursor to the end of the text field for entering the value. Add a semi-colon (;) and add the full path to the bin directory of your Java installation. Select OK.

Select the CLASSPATH variable and select Edit. Move your cursor to the end of the text field for entering the value. Add a semi-colon (;) and put a period (.). Select OK. The period represents your current working directory, and means that all files in your current working directory will be on the classpath when compiling and running Java applications. If you do not have a CLASSPATH variable, select the New button, and create one. The name of the variable should be CLASSPATH, in all capital letters.

See http://courses.ncsu.edu/csc116/common/java_install/ for a video on how to install the Java SE Development Kit.


3.0 Download Eclipse

Eclipse is available in several distributions with plug-in configurations geared towards specific development activities. The Android Developer site recommends that developers download the Eclipse IDE for Java Developers.

Eclipse IDE for Java Developers Image
Figure 1: Eclipse download selection

Eclipse does not require installation. Instead you will extract the zipped files to the directory of your choosing (we recommend that you install under your top drive, like C:\). You can then start Eclipse by entering the <eclipse-home-dir>/eclipse and double clicking the purple Eclipse icon.

For more information about how to use Eclipse, see the Getting Started with Eclipse 3.5 for Beginner Programmers or the Getting Started Using Eclipse tutorial.


4.0 Install Android SDK and Install Components

For Android application development, the Android Software Development Kit (SDK) is required. You can download the Android SDK appropriate for your OS and platform from http://developer.android.com/sdk/index.html. You'll want to unzip the Android SDK, and remember the path to that directory. To simplify later steps, we recommend that you keep your Android SDK libraries on a path with no spaces, and in a location that you won't change later. If you use the Windows installer, you can change the path to one with no spaces.

Adding the Android SDK to the system's path variable allows for using the command from anywhere in the file tree. You will want to add the full path to android-sdk-<OS>/tools to your system's Path variable. See the discussion about modifying the Path variable on Windows machines under the section on installing the JDK.

Next, you want to install the SDK components associated with the versions of the Android operating system you are developing for. See http://developer.android.com/sdk/adding-components.html for additional information on installing Android SDK components.

Bring up the Android SDK and AVD Manager by entering android at the command line from within the android-sdk-<OS>/tools directory. When the Android SDK and AVD Manager is displayed, select the third option in the left menu, Available Packages.

You will want to install, at a minimum, the SDK components outlined in the table at the top of the tutorial. Installing other components will provide additional functionality and allow for the development of applications on phones that run earlier version of the Android OS.


5.0 Installing ADT Eclipse Plug-in

The Android Development Tools (ADT) plug-in for Eclipse provides functionality for creating and emulating Android applications in the Eclipse environment. See http://developer.android.com/sdk/eclipse-adt.html for instructions on installing the ADT plug-in. Make sure that you follow the directions for the version of Eclipse that you installed..

After you install the ADT Eclipse plug-in, you'll be able to access the Android SDK and AVD Manager from within Eclipse. There is a button on the tool bar. Additionally, you can open the Android SDK and AVD Manager by selecting Window > Android SDK and AVD Manager.


6.0 Create an AVD

An Android Virtual Device (AVD) is required for launching an application in an emulator. The AVD describes the type of device you want to emulate. See http://developer.android.com/guide/developing/tools/avd.html for information on creating AVDs. The default location for newly created AVDs is your home directory on your computer. Eclipse and the ADT look for AVDs in that location.

Note: The AndroidDevelopment VCL environment requires special setup of the AVD. Email the teaching staff if you plan on using the AndroidDevelopment VCL instance.


7.0 Install Subversive Eclipse Plug-in

The Subversive Eclipse plug-in provides connectivity to an Subversion (SVN) repository for archiving and sharing source code. The repository information that you will use for your class will be provided by the teaching staff. For now, you want to install the Subversive plug-in so that you can connect to the repository later.

To install the Subversive plug-in, select Help > Install New Software. In the Install window that is displayed, type in Subversive. The following URL should be displayed: http://download.eclipse.org/technology/subversive/0.7/update-site/. Select the URL. A list of all possible plug-ins from the Subversive update site. Select Subversive SVN Team Provider (Incubation) and Subversive SVN JDT Ignore Extensions (Optional) (Incubation) under the Subversive SVN Team Provider Plugin (Incubation). Select Next to install the plug-in. You will be asked to restart Eclipse.

Upon restart, select Window > Open Perspective > Other.... In the resulting dialog, select SVN Repository Exploring. A dialog called Install Connectors will display, which provides a list of connectors. Download all SVN Kit connectors.


8.0 Setting up an Android Device for Development

The Android developer site provides an excellent overview of setting up an Android Device for development. See http://developer.android.com/guide/developing/device.html for instructions on setting up an Android device.

If you are using a Windows device, refer to http://developer.android.com/intl/de/sdk/win-usb.html for instructions on using the USB device driver that you installed in step 4.0.

Potential Problems

Some Windows 7 users have experienced issues with getting the DDMS to recognize that a ADP1 (G1) is connected. Although Windows 7 automatically installs drivers, sometimes you need to manually install the ones provided by the SDK.

After connecting your phone to a USB port on your computer, you must go to the device manager to manually update the drivers. To do so, you must right-click on Computer and select Properties (or press hotkey Windows+Pause), then select Device Manager from the left control pane. From there, look for a USB device that has a yellow triangle with an exclamation point for the icon. Double-click that (Or right-click > Properties). In the Properties window, click on the Driver tab, then click on the "Update Driver..." button.

Updating Android device driver
Figure 2: Updating Android device driver

From here, click "Browse my computer for driver software." In the new window that pops up, browse to the location that you installed the Android SDK to and select the folder titled "usb_driver," then click next.

Broswer for driver software
Figure 3: Browse for driver software

Windows Security may prompt you to install device software by Google Inc. Click "Install." After it is done installing, the DDMS should be able to recognize your G1 properly.

If you are having problems getting the Google drivers to work with the DDMS and the Motorola Droid, you may want to try using Motorola's drivers instead. There are detailed directions for doing this in this discussion at www.androidforums.com.

Note: If you plan on using the AndroidDevelopment VCL instance, you will be unable to connect your Android device to the VCL instance via USB.