How to Install Android on Ubuntu Linux with Eclipse IDE

This document will prepare an overview of the steps you will take to install and configure Android on your Ubuntu Linux system. You must have Oracle Java JDK or OpenJDK on your system before installing Android SDK. OpenJDK (aka Open Java...
Method 1 of 6:

Prepare your Development Environment

  1. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 1How to Install Android on Ubuntu Linux with Eclipse IDE Picture 1
    Prepare your Ubuntu Linux development environment and ensure it meets the system requirements. First, boot up Ubuntu Linux,make sure you have an implementation of the Java JDK installed on your system, whether it is OpenJDK or Oracle Java JDK, which lays the foundation for the Android SDK. If you don't have the Java JDK installed on your system please install it, you can obtain the Oracle Java JDK from Download the Oracle Java JDK,for more information on:
    1. How to Install Oracle Java on Ubuntu Linux or to install the OpenJDK and OpenJRE open up a terminal on your system and run the following commands
    2. Type/Copy/Paste: sudo apt-get install openjdk-7-jdk
      1. This command installs OpenJDK on your system
    3. Type/Copy/Paste: sudo apt-get install openjdk-7-jre
      1. this command installs OpenJDK JRE( Java Runtime Environment ) on your system
    4. You have choice between installing OpenJDK or installing Oracle Java. I strongly recommend installing Oracle Java because it is usually the most well maintained and up to date version of Java.
  2. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 2How to Install Android on Ubuntu Linux with Eclipse IDE Picture 2
    If you are running a 64-bit distribution of Android SDK on your development machine, you need to install the ia32-libs:
    1. Type/Copy/Paste: sudo apt-get install ia32-libs
      1. This command installs additional libraries needed for development with the Android SDK
    2. Type/Copy/Paste: javac -version
    3. this command checks for the Java JDK on your system:
      1. It should respond back with:
        1. java 1.7.0
        2. or something very similar
    4. Type/Copy/Paste: java -version
      1. this command checks for the Java JRE ( Java Runtime Environment ) on your system
Method 2 of 6:

Download and Configure Eclipse Integrated Development Environment (IDE)

  1. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 3How to Install Android on Ubuntu Linux with Eclipse IDE Picture 3
    You want to make sure you have the Eclipse Integrated Development Environment (IDE) installed on your system,for example select Eclipse Classic, and download the version for your system architecture such as 32bit or 64 bit version for Linux. If your computer system has 4GB or more of memory most likely it is a 64 bit computer. You can tell if your Ubuntu Linux operating system is 32 or 64 bit by opening up a terminal and running the following command:
    1. Type/Copy/Paste: file /sbin/init
    2. Download Eclipse IDE it will download into your /home/"your_user_name"/Downloads
      1. Select the correct bit version for your corresponding system architecture. For example, if you are on 32-bit Ubuntu Linux select 32-bit Eclipse IDE and if you are on 64-bit Ubuntu Linux select 64-bit Eclipse IDE.
  2. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 4How to Install Android on Ubuntu Linux with Eclipse IDE Picture 4
    This is an example of a 64-bit Eclipse IDE setup on 64-bit Ubuntu Linux operating system.
    1. Type/Copy/Paste: cd /home/"your_user_name"/Downloads
      1. this will change you in your Downloads directory
    2. Type/Copy/Paste: sudo -s cp -r eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz /usr/local
      1. this will copy your Eclipse IDE to the /usr/local directory
    3. Type/Copy/Paste: cd /usr/local
      1. this will change you into the eclipse directory
    4. Type/Copy/Paste: sudo -s chmod a+x eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
      1. this command makes the eclipse binaries executable for all on the system
    5. Type/Copy/Paste: sudo -s tar xvzf eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
      1. this unpacks your Eclipse IDE compressed binaries
    6. Type/Copy/Paste: exit
      1. this command takes you out of root user
  3. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 5How to Install Android on Ubuntu Linux with Eclipse IDE Picture 5
    Open up a terminal and enter the following commands:
    1. Type/Copy/Paste: cd /home/"your_user_name"/Desktop
      1. this will change you into your user Desktop, make sure you are not root
    2. Type/Copy/Paste: ln -s /usr/local/eclipse/eclipse
    3. Type/Copy/Paste: chown "your_user_name" eclipse
      1. this will make the Eclipse symbolic link located on your desktop belong to the user
      2. Important, make sure you are not root when you create this symbolic link from your Eclipse IDE /usr/local/eclipse directory to your Desktop /home/"your_user_name"/Desktop
Method 3 of 6:

Download, Install and Configure the Android SDK

  1. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 6How to Install Android on Ubuntu Linux with Eclipse IDE Picture 6
    Download the Android SDK, click on the Linux tarball, android-sdk_r22-linux.tgz and save it to your /home/"your_user_name"/Downloads directory, open up a terminal and run the following commands:
    1. Type/Copy/Paste: cd /home/"your_user_name"/Downloads
      1. this will change you into your Downloads directory
    2. Type/Copy/Paste: sudo cp -r android-sdk_r22-linux.tgz /opt
      1. this will copy the android sdk to /opt
    3. Type/Copy/Paste: cd /opt
      1. this will change you into the Android working directory
    4. Type/Copy/Paste: sudo tar xvzf android-sdk_r22-linux.tgz
      1. this will unpack your Android SDK
    5. Type/Copy/Paste: sudo -s chmod -R 755 /opt/android-sdk-linux
      1. this will make the /opt directory and the Android SDK writable and executable for all users on the system.
  2. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 7How to Install Android on Ubuntu Linux with Eclipse IDE Picture 7
    When these steps are complete you will have Android SDK located at:/opt/android-sdk-linux on your Ubuntu Linux system.
  3. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 8How to Install Android on Ubuntu Linux with Eclipse IDE Picture 8
    Also, open up a terminal and add Android SDK to your system wide PATH on Ubuntu Linux
    1. Type/Copy/Paste: sudo nano /etc/profile
    2. or
    3. Type/Copy/Paste: sudo gedit /etc/profile
    4. Add the following lines below to the end of the system PATH file
    5. Type/Copy/Paste: export PATH=${PATH}:/opt/android-sdk-linux/tools
    6. Type/Copy/Paste: export PATH=${PATH}:/opt/android-sdk-linux/platform-tools
  4. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 9How to Install Android on Ubuntu Linux with Eclipse IDE Picture 9
    Save the /etc/profile file and exit
  5. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 10How to Install Android on Ubuntu Linux with Eclipse IDE Picture 10
    Reload your system PATH /etc/profile by issuing the following command
    1. Type/Copy/Paste: . /etc/profile
      1. this informs the Linux system of the location of the Android SDK development tools
Method 4 of 6:

Install the Android Development Tool (ADT) Plugin for Eclipse IDE

In order to install the Android Development Tool (ADT), you will have to install the Android ADT tool for the Eclipse IDE as root:

  1. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 11How to Install Android on Ubuntu Linux with Eclipse IDE Picture 11
    Type/Copy/Paste: sudo -s /usr/local/eclipse/eclipse
    1. this will install the ADT plugin tool for all users on the system
  2. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 12How to Install Android on Ubuntu Linux with Eclipse IDE Picture 12
    Install the ADT Plugin for Eclipse, the ADT is a plugin for the Eclipse IDE. Before you can install or use ADT, you must have a compatible version of Eclipse installed on your development computer. Start Eclipse, then select Help > Install New Software. Click Add, in the top-right corner. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location
  3. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 13How to Install Android on Ubuntu Linux with Eclipse IDE Picture 13
    Type/Copy/Paste: https://dl-ssl.google.com/android/eclipse/
    1. Click OK
    2. Note: If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons)
  4. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 14How to Install Android on Ubuntu Linux with Eclipse IDE Picture 14
    In the Available Software dialog, select the checkbox next to Developer Tools and click Next. In the next window, you'll see a list of the tools to be downloaded and Click Next. Read and accept the license agreements, then click Finish.
    1. Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
  5. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 15How to Install Android on Ubuntu Linux with Eclipse IDE Picture 15
    When the installation completes, restart Eclipse. Configuring the ADT Plugin, after you've successfully downloaded the ADT as described above, the next step is to modify your ADT preferences in Eclipse to point to the Android SDK directory:
    1. Select Window > Preferences... to open the Preferences panel
      1. 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. You cannot continue with this procedure until you click Proceed.
  6. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 16How to Install Android on Ubuntu Linux with Eclipse IDE Picture 16
    For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory, which should be /opt/android-sdk-linux
    1. Click Apply, then OK.
Method 5 of 6:

Add Android platforms and other components to your SDK

  1. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 17How to Install Android on Ubuntu Linux with Eclipse IDE Picture 17
    Adding Platforms and Other Component,in setting up your SDK is using the Android SDK and AVD Manager (a tool included in the SDK starter package) to download essential SDK components into your development environment. The SDK starter package, which you've already downloaded, includes only a single component: the latest version of the SDK Tools. To develop an Android application, you also need to download at least one Android platform and the associated platform tools. You can add other components and platforms as well, which is highly recommended.
  2. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 18How to Install Android on Ubuntu Linux with Eclipse IDE Picture 18
    Open Eclipse and click Window->Android SDK and AVD Manager->Installed packages and click update all. Simply click Install to accept the recommended set of components and install them
  3. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 19How to Install Android on Ubuntu Linux with Eclipse IDE Picture 19
    On Linux, open a terminal and navigate to the /opt/android-sdk-linux/tools directory in the Android SDK.
    1. Type/Copy/Paste: sudo -s
    2. Type/Copy/Paste: cd /opt/android-sdk-linux/tools
    3. this will change you into the android sdk tools directory
    4. Type/Copy/Paste: ./android
    5. this command will run the Android graphical user interface, in most cases you will have to be root user in order for the Android SDK to download updated components to the opt/android-sdk-linux directory.To download components, use the graphical UI of the Android SDK and AVD Manager to browse the SDK repository and select new or updated components. The Android SDK and AVD Manager installs the selected components in your SDK environment.
Method 6 of 6:

Create your Android Virtual Device (AVD)

  1. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 20How to Install Android on Ubuntu Linux with Eclipse IDE Picture 20
    Once all the components for Android have been updated you will need to create an Android Virtual Device.
    1. Click on Window->Android SDK and AVD Manager->Virtual Devices in order to create an Android Virtual Device ( emulator ).
    2. Click New, scroll down to the box that says name and assign an Android Virtual Device name such as: My_AVD
    3. Next click on the box that says target and use the arrow button and scroll down and select appropriate Android version you want to develop with such as, Android 3.2-API Level 13.
    4. Next scroll down to the box that says Skin and Click on Resolution, enter the numbers 420x580 and select Create AVD, this will create your Android Virtual Device ( emulator ), for program testing.
  2. How to Install Android on Ubuntu Linux with Eclipse IDE Picture 21How to Install Android on Ubuntu Linux with Eclipse IDE Picture 21
    Congratulations, you should now have the Android SDK setup to work with Eclipse IDE and you can begin developing Android Applications.
4 ★ | 1 Vote