Previous  | Next  | Home

Installing the Software


 

The basic software components that we will need are Java, the Eclipse IDE, the Android plugin for Eclipse, and the Android Software Development Kit (SDK) and related libraries such as Google maps. This software should work under Windows, Mac, or Linux.

 

Installing Java, Eclipse, and the SDK Starter Kit

To optimize flexibility, the tools required to develop with Android are installed in two stages: the basics (including an SDK "starter kit"), and then the specific Android platforms (versions of the operating system) that the developer wishes to use. In this section we install the starter kit and in the next we install specific Android platforms.

  1. If it is not already installed on your computer, get the Java Development Kit (JDK). You need at least Java 5 or 6 (that is, versions 1.5 or 1.6), and you need the JDK (Java Development Kit), not just the JRE (Java Runtime Environment). Once installed, check versions with javac -version for the JDK and java -version for the JRE. For example, on one of my Linux Fedora 14 systems I get
    
       [guidry@m81 androidTutorials]$ javac -version
       javac 1.6.0_20
       [guidry@m81 androidTutorials]$ java -version
       java version "1.6.0_20"
       OpenJDK Runtime Environment (IcedTea6 1.9.4) (fedora-50.1.9.4.fc14-x86_64)
       OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
       [guidry@m81 androidTutorials]$ 
    
    
    indicating that both the JDK and the Java Runtime correspond to Java 1.6.

  2. Download and install the Eclipse IDE. Be sure to choose "Eclipse IDE for Java Developers" (I'm using version 3.6, codenamed Helios, and version 3.5, codenamed Galileo on my machines; install the most current version but at least 3.4 is recommended).

  3. Download the current Android SDK. There is no installer; just uncompress in the desired directory. The Quickstart notes on that webpage give details on how to install for Linux, Windows, or Mac platforms. Note the directory for the SDK install since you will need to specify it for Eclipse below. By default, the SDK files are unpacked into a directory named

    
      android-sdk-<machine-platform> 
    
    
    For example, on my Linux system the SDK is at /home/guidry/android-sdk-linux_86. It will be convenient for later if you add the tools subdirectory of the SDK to your path once installed, since this will permit you to execute Android tools such as the ADB (Android Debug Bridge) from any directory:
  4. NOTE: If you install Android 2.3 you will find that the adb has been moved from the tools to the platform-tools subdirectory of the SDK, so you should add this directory to your path also. For example, on my Linux Fedora system,
    
        export PATH=${PATH}:/home/guidry/android-sdk-linux_86/platform-tools
    
    
    Leave the tools subdirectory in the path too, since other Android tools still reside there.

    The SDK is in general downloaded in two or more stages, as described in more detail in the Android Installing the SDK document. The current step installs the "starter package". In the next section we will use the tools installed in this step to download specific components needed for developing and testing applications.

  5. Download and install the Android plugin for Eclipse (Android Development Toolkit or ADT). Exact instructions will depend on the current version of Eclipse. Details should be consulted in the Installing the SDK document but will be something like the following:

    If you encounter any problems installing the ADT, try consulting this FAQ and try googling the associated error strings. (As in most things Android, the Web is your best help desk since it is likely that you are not the first person who has encountered your problem.)

  6. Add Android platforms and other components required for the specific projects you will develop using the tools installed in Step 3, as described in the next section.

 

Installing Specific Android Platforms

The SDK uses a modular structure that divides the major parts of the SDK---Android platform versions, add-ons, tools, samples, and documentation---into separately installable components. The SDK starter package installed in Step 3 includes only a single component: the SDK Tools. To develop an Android application, you also need to download at least one Android platform, although downloading additional components is often useful (see Adding SDK Components for more details).

The types of components in the SDK repository are:

See recommended components for information about which components are required and which are optional.

To install additional components of the SDK:

  1. Open Eclipse.

  2. Select Window > Android SDK and AVD Manager. (Note that you can also launch this window by issuing the command "android" with no arguments in a shell window, assuming you have put the SDK tools directory in your path as instructed above; otherwise you will have to use the full path to the android command.)

  3. In the left panel of the resulting window select Installed Packages to see what is installed, and Available Packages to see what is available that is not yet installed. Under Available Packages, check the boxes for components that you wish to install (see the following figure).


    For our purposes, let us select all the platforms, Google API add-ons, and docs for versions 1.5, 1.6, 2.1, 2.2, 2.3, and Honeycomb (3.0) of Android. (This will allow us to target the latest Android versions, but also to test backward compatibility with earlier versions.) After selecting, click the Install Selected button, and accept any license requirements, etc. After installation, these new components should appear if Installed Packages is selected in the left panel, as illustrated in the following figure


  4. If you do not have all these packages installed, go back to Available Packages and check that all available packages have been selected.

  5. Close the Android SDK and AVD Manager window.

You should now have all the components required to begin developing an Android application. A good way to test your installation is to install and run a sample Android package, as described in the next section.


Previous  | Next  | Home