How to Install Android on Ubuntu Linux with Eclipse IDE

Table of contents:

How to Install Android on Ubuntu Linux with Eclipse IDE
How to Install Android on Ubuntu Linux with Eclipse IDE
Anonim

This article offers an overview of the steps required to install and configure Android on your Ubuntu Linux system. Before installing the Android SDK on the system you will need to have the Oracle Java JDK or the OpenJDK. OpenJDK (Open Java Development Kit) is a free and open source implementation of the Java programming language. Additionally, you will learn to:

  1. Prepare the development environment and make sure it meets the system requirements;
  2. Install the Android Software Development Kit (SDK);
  3. Download and configure the Eclipse Integrate Development Environment (IDE);
  4. Install the Android Development Tool (ADT) Plugin for Eclipse IDE;
  5. Add Android platforms and other components to your SDK;
  6. Create your Android Virtual Device (AVD).

    Steps

    Part 1 of 6: Preparing the Development Environment

    Install Android on Ubuntu Linux with Eclipse IDE Step 1
    Install Android on Ubuntu Linux with Eclipse IDE Step 1

    Step 1. Prepare the Ubuntu development environment and make sure it meets the system requirements

    First, start Ubuntu, make sure you have an implementation of the Java JDK installed on your system, be it OpenJDK or Oracle's JDK, which lays the foundation for the Android SDK. If you don't have the Java JDK installed on your system, do it now; you can get it from the Download Oracle Java JDK page.

    • For more information on how to install the Java JDK search wikiHow for articles on the subject or open the terminal and enter the following commands to install OPenJDK and OpenJRE.
    • Type / Copy / Paste:

      sudo apt-get install openjdk-7-jdk

      This command installs OpenJDK on the system

    • Type / Copy / Paste:

      sudo apt-get install openjdk-7-jre

      This command installs the OpenJDK Java Runtime Environment (JRE) on the system

    • You have the option to choose whether to install OpenJDK or Oracle Java. The advice is to install the software Oracle, because it is often the most up-to-date and most curated version of Java.
    Install Android on Ubuntu Linux with Eclipse IDE Step 2
    Install Android on Ubuntu Linux with Eclipse IDE Step 2

    Step 2. If you have a 64-bit distribution of the Android SDK on your system, you will need to install the ia32-libs

    • Type / Copy / Paste:

      sudo apt-get install ia32-libs

      This command installs additional libraries needed for development with the Android SDK

    • Type / Copy / Paste:

      javac -version

    • This command checks the Java JDK on your system.

      • The answer should be as follows:

        • java 1.7.0
        • or something very similar.
      • Type / Copy / Paste:

        java -version

        This command checks the Java JRE on your system

      Part 2 of 6: Download and Configure the Eclipse Integrate Development Environment (IDE)

      Install Android on Ubuntu Linux with Eclipse IDE Step 3
      Install Android on Ubuntu Linux with Eclipse IDE Step 3

      Step 1. Make sure you have the Eclipse IDE installed on your system

      If you have not already done so, select Eclipse Classic and download the version suitable for the architecture of your Linux system (32-bit or 64-bit). If your computer has more than 4GB of RAM it is probably 64-bit. You can check your Ubuntu version by opening the terminal and entering the following command.

      • Type / Copy / Paste:

        file / sbin / init

      • Download Eclipse IDE; will be saved in the / home / folder "your_user_name"/ Downloads.

        Select the version for your system architecture. If you have the 32-bit version of Ubuntu select the 32-bit version of the program and do the same for the 64-bit version

      Install Android on Ubuntu Linux with Eclipse IDE Step 4
      Install Android on Ubuntu Linux with Eclipse IDE Step 4

      Step 2. The following example is for installing the 64-bit version of Eclipse IDE on a 64-bit Ubuntu operating system

      • Type / Copy / Paste:

        cd / home /"your_user_name"/ Downloads

        You will reach the path of the Downloads folder

      • Type / Copy / Paste:

        sudo -s cp -r eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz / usr / local

        This command copies the Eclipse IDE to the / usr / local folder

      • Type / Copy / Paste:

        cd / usr / local

        You will reach the path of the Eclipse folder

      • Type / Copy / Paste:

        sudo -s chmod a + x eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz

        This command makes the Eclipse binaries executable for all users of the system

      • Type / Copy / Paste:

        sudo -s tar xvzf eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz

        This command decompresses the compressed binaries of the Eclipse IDE

      • Type / Copy / Paste:

        exit

        With this command you log out of the root user

      Install Android on Ubuntu Linux with Eclipse IDE Step 5
      Install Android on Ubuntu Linux with Eclipse IDE Step 5

      Step 3. Open a terminal and enter the following command:

      • Type / Copy / Paste:

        cd / home /"your_user_name"/ Desktop

        You will reach your user's Desktop path, make sure you are not root

      • Type / Copy / Paste:

        ln -s / usr / local / eclipse / eclipse

      • Type / Copy / Paste:

        chown "your_user_name" eclipse

        • This will assign the Eclipse symbolic link on the desktop to your user.
        • Important, make sure you are not root when you create this symbolic link from Eclipse IDE / usr / local / eclipse folder to Desktop / home /"your_user_name"/ Desktop.

        Part 3 of 6: Download, Install and Configure the Android SDK

        Install Android on Ubuntu Linux with Eclipse IDE Step 6
        Install Android on Ubuntu Linux with Eclipse IDE Step 6

        Step 1. Download the Android SDK, click on the Linux tarball, android-sdk_r22-linux.tgz and save it in the / home / "your_username" / Downloads folder, open the terminal and run the following commands

        • Type / Copy / Paste:

          cd / home /"your_user_name"/ Downloads

          You will reach the path of the Downloads folder

        • Type / Copy / Paste:

          sudo cp -r android-sdk_r22-linux.tgz / opt

          You will copy the Android SDK to / opt

        • Type / Copy / Paste:

          cd / opt

          You will reach the path of the Android folder

        • Type / Copy / Paste:

          sudo tar xvzf android-sdk_r22-linux.tgz

          This command unzips the Android SDK archive

        • Type / Copy / Paste:

          sudo -s chmod -R 755 / opt / android-sdk-linux

          This command makes the / opt folder and the Android SDK writable and executable for all users of the system

        Install Android on Ubuntu Linux with Eclipse IDE Step 7
        Install Android on Ubuntu Linux with Eclipse IDE Step 7

        Step 2. Once these steps are completed, the Android SDK is located in the path:

        / opt / android-sdk-linux of your Ubuntu system.

        Install Android on Ubuntu Linux with Eclipse IDE Step 8
        Install Android on Ubuntu Linux with Eclipse IDE Step 8

        Step 3. Open the terminal and add the Android SDK to the system PATH

        • Type / Copy / Paste:

          sudo nano / etc / profile

        • or
        • Type / Copy / Paste:

          sudo gedit / etc / profile

        • Add the following lines to the end of the system PATH file
        • Type / Copy / Paste:

          export PATH = $ {PATH}: / opt / android-sdk-linux / tools

        • Type / Copy / Paste:

          export PATH = $ {PATH}: / opt / android-sdk-linux / tools

        Install Android on Ubuntu Linux with Eclipse IDE Step 9
        Install Android on Ubuntu Linux with Eclipse IDE Step 9

        Step 4. Save the / etc / profile file and exit

        Install Android on Ubuntu Linux with Eclipse IDE Step 10
        Install Android on Ubuntu Linux with Eclipse IDE Step 10

        Step 5. Reload the / etc / profile file with the following command

        • Type / Copy / Paste:

          . / etc / profile

          This command informs the Linux system of the location of the Android SDK development tools

        Part 4 of 6: Install the Android Development Tool (ADT) Plugin for Eclipse IDE

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

        Install Android on Ubuntu Linux with Eclipse IDE Step 11
        Install Android on Ubuntu Linux with Eclipse IDE Step 11

        Step 1. Type / Copy / Paste:

        sudo -s / usr / local / eclipse / eclipse

        This command will install the ADT plugin tool for all users on the system

        Install Android on Ubuntu Linux with Eclipse IDE Step 12
        Install Android on Ubuntu Linux with Eclipse IDE Step 12

        Step 2. Install the ADT Plugin for Eclipse

        Before you can install or use ADT, you will need to have a compatible version of Eclipse installed on your system. Launch Eclipse, then select Help> Install New Software. Click Add, in the upper right corner. In the Add Repository window that appears, enter "ADT Plugin" as Name and the following URL as Path.

        Install Android on Ubuntu Linux with Eclipse IDE Step 13
        Install Android on Ubuntu Linux with Eclipse IDE Step 13

        Step 3. Type / Copy / Paste:

        https://dl-ssl.google.com/android/eclipse/

        • Click OK.
        • Note: If you have trouble getting the plugin, try using "http" in the Path, instead of "https" (https is used because it offers more security).
        Install Android on Ubuntu Linux with Eclipse IDE Step 14
        Install Android on Ubuntu Linux with Eclipse IDE Step 14

        Step 4. In the Available Software window, check the Developer Tools box, then click Next

        In the following window, you will see the list of tools to download, then click Next. Read and accept the license agreement, then click Finish.

        Note: If you see a warning that the authenticity or validity of the program cannot be confirmed, click OK

        Install Android on Ubuntu Linux with Eclipse IDE Step 15
        Install Android on Ubuntu Linux with Eclipse IDE Step 15

        Step 5. When the installation is complete, restart Eclipse

        The next step will be to change the ADT settings in Eclipse to point to the Android SDK folder.

        • Select Window> Preferences… to open the Preferences pane.

          Select Android from the left pane. A window may appear asking you whether to send usage statistics to Google. Make your choice and proceed. You cannot continue with the operation unless you click Proceed

        Install Android on Ubuntu Linux with Eclipse IDE Step 16
        Install Android on Ubuntu Linux with Eclipse IDE Step 16

        Step 6. To set the SDK Path in the main pane, click Browse

        .. and find the SDK folder you downloaded, which should be / opt / android-sdk-linux.

        Click on "Apply" and then on "Ok"

        Part 5 of 6: Adding Android Platforms and Other Components to Your SDK

        Install Android on Ubuntu Linux with Eclipse IDE Step 17
        Install Android on Ubuntu Linux with Eclipse IDE Step 17

        Step 1. Download the core components of the SDK in the development environment

        The SDK starter package, which you have already downloaded, includes only one component: the latest version of the SDK Tools. To develop an Android application, you will also need to download at least one Android platform and the tools associated with it. You can add other components and platforms as well, which is highly recommended.

        Install Android on Ubuntu Linux with Eclipse IDE Step 18
        Install Android on Ubuntu Linux with Eclipse IDE Step 18

        Step 2. Open Eclipse and click Window-> Android SDK and AVD Manager-> Installed Packages, then click Update All

        Click Install to accept the recommended set of components and install.

        Install Android on Ubuntu Linux with Eclipse IDE Step 19
        Install Android on Ubuntu Linux with Eclipse IDE Step 19

        Step 3. On Linux, open a terminal and navigate to the / opt / android-sdk-linux / tools folder of the Android SDK

        • Type / Copy / Paste:

          sudo -s

        • Type / Copy / Paste:

          cd / opt / android-sdk-linux / tools

        • You will reach the tools path of the Android SDK.
        • Type / Copy / Paste:

          ./android

        • This command will run the Android GUI; in most cases you will need to be root to download the updated Android SDK components to the opt / android-sdk-linux folder. To download components, use the GUI to browse the SDK repository and select new or updated components.

        Part 6 of 6: Create your Android Virtual Device (AVD)

        Install Android on Ubuntu Linux with Eclipse IDE Step 20
        Install Android on Ubuntu Linux with Eclipse IDE Step 20

        Step 1. After updating all the Android components, you will need to create an Android Virtual Device (AVD)

        • Click on Window -> Android SDK and AVD Manager -> Virtual Devices to create an Android Virtual Device (an emulator).
        • Click New, scroll to the name field and give the device a name, such as: Mio_AVD.
        • Now click on the target field and use the arrows to select the appropriate Android version to develop for, such as Android 3.2-API Level 13.
        • Then, scroll to the Skin field and click on Resolution; enter the numbers 420x580 and click Create AVD.

Recommended: