Tutorial: How to install the Android SDK

This tutorial explains how to install the SDK for Android and the Eclipse plugin dedicated to Android.


Android SDK is not yet compatible with the JDK 1.7. You must use the JDK 1.6 to develop an Android application


Goal: Install Android SDK. Install Eclipse ADT plugin.

Contents


Install the Android SDK

Before starting to install the Android SDK, the complete and official installation procedure could be found on the Android developer website. This tutorial is a summary of this official installation guide.

Core SDK

You should have already downloaded the Android SDK. Now you need to set up your development environment.


Unpack the package to a safe location on your machine. In the rest of this tutorial, the install path is /opt/android-sdk-linux_x86 (using the Linux/Unix naming standard).

If necessary, change the access rights to the Android SDK, and all its subdirectories (on Linux/Unix rX for others).


Make a note of the name and location of the SDK directory on your system. You will need to refer to the SDK directory later, when setting up the ADT plugin and when using the SDK tools from the command line.


The SDK you've downloaded is not the complete SDK environment. It includes only the core SDK tools, which you can use to download the rest of the SDK packages (such as the latest system image).

Adding Platforms and Packages

You can update and install SDK packages at any time using the Android SDK Manager.

If you've used the Windows installer to install the SDK tools, you should already have the Android SDK Manager open. Otherwise, you can launch the Android SDK Manager in one of the following ways:

  • On Windows, double-click the SDK_Manager.exe file at the root of the Android SDK directory.
  • On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then execute android sdk.


When you open the Android SDK Manager, it automatically selects a set of recommended packages. Simply click Install to install the recommended packages.

Adding Emulator

To run and debug your Android application on a desktop computer, you need to install an Android emulator.

If you've used the Windows installer to install the SDK tools, you should already have the Android SDK Manager open. Otherwise, you can launch the Android SDK Manager in one of the following ways:

  • On Windows, double-click the SDK_Manager.exe file at the root of the Android SDK directory.
  • On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then execute android sdk.


When you open the Android SDK Manager, you need to open the AVD manager.

  1. Select the menu Tools > Manager AVDs...
  2. Click on the "New..." button.
  3. Type the name of your emulator.
  4. Select the Android target.
  5. Put the size of the SD card in the emulated Android device.
  6. Click on the "Create AVD" button.


Now, you have installed the Android SDK and the emulator.

Install the Eclipse ADT Plugin

Android offers a custom plugin for the Eclipse IDE, called Android Development Tools (ADT). This plugin is designed to give you a powerful, integrated environment in which to develop Android apps. It extends the capabilities of Eclipse to let you quickly set up new Android projects, build an app UI, debug your app, and export signed (or unsigned) app packages (APKs) for distribution.


You need to download and install an version of Eclipse. We recommend the "Eclipse Java Developer" version. The rest of this tutorial is based on the versions of Eclipse named "Juno" and "Kepler".

Install JDK 1.6

The Android SDK can only be used with JDK 1.6. If you have already installed a JDK 1.6, go to the next step "Install ADT". Otherwise:

  1. Install a JDK 1.6 (OpenJDK or Oracle JDK).
  2. Start Eclipse, then select Window > Preferences.
  3. In the preference dialog box, open Java > Installed JREs.
  4. Click on the "Add..." button.
  5. Select "Standard VM" in the newly opened dialog box, and click on "Next".
  6. Click on the "Directory..." button, near the "JRE home" field.
  7. Browse your file system and select the directory where your JDK 1.6 is installed.
  8. Back in the "Add JRE" dialog box, click on "Finished".

Back in the "Preferences" dialog box, check the newly installed JDK 1.6 to be sure that it is the default JDK to be used by eclipse; then click on "Ok".

Install ADT

  1. Start Eclipse, then select Help > Eclipse Marketplace.
  2. In the "Find" field, type android, and press the return key.
    The dialog box should update its content with the Eclipse plugins that corresponds to the "android" searching pattern.
  3. Find the plugin "Android Development Tools for Eclipse" in the list; then click on the corresponding "Install" button.
  4. The dialog box should display the modules that are composing the ADT plugin.
  5. Click on "Next" or "Confirm".
  6. Read and accept the license agreements, then click Finish.
    If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
  7. When the installation completes, restart Eclipse.

Install Android Configurator for M2E

  1. Start Eclipse, then select Help > Eclipse Marketplace.
  2. In the "Find" field, type android, and press the return key.
    The dialog box should update its content with the Eclipse plugins that corresponds to the "android" searching pattern.
  3. Find the plugin "Android Configurator for M2E" in the list; then click on the corresponding "Install" button.
  4. The dialog box should display the modules that are composing the Configurator plugin.
  5. Click on "Next" or "Confirm".
  6. Read and accept the license agreements, then click Finish.
    If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
  7. When the installation completes, restart Eclipse.

Configure ADT

After you've installed ADT and restarted Eclipse, you must specify the location of your Android SDK directory:

  1. Select Window > Preferences... to open the Preferences panel (on Mac OS X, select Eclipse > Preferences).
  2. Select Android from the left panel.
    You may see a dialog asking whether you want to send usage statistics to Google. If so, make your choice and click Proceed.
  3. For the SDK Location in the main panel, click Browse... and locate your downloaded Android SDK directory (such as /opt/android-sdk-linux_x86).
  4. Click Apply, then OK.


Now, you development environment is set up. You are ready to start to code.

Import Eclipse Configuration

You may import the standard Eclipse configuration, which is provided by the Janus team for several version of Eclipse.

Related Pages

2014-03-01SARL agent-programming language, version 0.1-beta is available on sarl.io.
This page was last modified on 2 July 2013, at 09:04. This page has been accessed 15,843 times.
Copyright 2010-2014 © Janus Core Developers - Privacy policy