Nov 062013
 

android-plus-linux-equals-lindroid-edirts

Original article (in spanish) posted on http://vidagnu.blogspot.it/

In this post I want to show the steps you must follow to have a Development Environment for Android in your Linux distro.
What do you need?
Let’s go !




As first thing install Java JDK 6, from the Oracle website it’s possible to download a .rpm.bin package or a .bin file, if you use an rpm based distribution such as Centos, Red hat, Fedora or Suse go for the first package, and if you have any problem check this article Install Sun/Oracle Java JDK/JRE 6u45 on Fedora 19/18, CentOS/RHEL 6.4/5.9

All the others users will have to use the .bin file, to verify that you have installed it you can use the command java -version from a terminal, you should see something similar at this:

java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b04)
Java HotSpot(TM) Server VM (build 20.6-b01, mixed mode)

Now declare the environment variable JAVA_HOME, the best way to do this it’s add these 2 lines in your ~/.bashrc file:

## export JAVA_HOME JDK ##
export JAVA_HOME="/usr/java/jdk1.6.0_45"

and include the “bin” folder that is inside the JAVA_HOME in the PATH environment variable adding this extra line to your ~/.bashrc file:

export PATH=$PATH:$JAVA_HOME/bin

Now proceed with the installation of Android SDK, to do it download the compressed file and unpack into /opt (or /usr/local if you prefer so), now you must create the ANDROID_HOME environment variable which should point to the folder /opt/android-sdk-linux, we must also add the directory “tools” that is within this newly created directory and contains the SDK executables in our PATH environment variable.

With this setup we have a basic framework to build applications for Android.

Now run the command “android” which will open the Android SDK Manager in which we will click on the button or link “New” to select all packages so they will be installed in our environment, this is the best time to take a coffee, as this process usually takes several minutes …

Now we need the IDE, we proceed with the unzip of ECLIPSE for Java Developers 3.7.2 in the /opt (or /usr/local) and add a new environment variable ECLIPSE that must contain /opt/eclipse.

To start Eclipse, run the command “eclipse”, the first time that you run the command it will say that you need to create your workspace which is basically a folder where you will store all the projects.

Now you just need to load the Android Plugin in Eclipse.
  1. Start Eclipse, then select Help > Install New Software.
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter “ADT Plugin” for the Name and the following URL for the Location:
    https://dl-ssl.google.com/android/eclipse/
  4. Click OK.If you have trouble acquiring the plugin, try using “http” in the Location URL, instead of “https” (https is preferred for security reasons).
  5. In the Available Software dialog, select the checkbox next to Developer Tools and clickNext.
  6. In the next window, you’ll see a list of the tools to be downloaded. Click Next.
  7. 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.
  8. When the installation completes, restart Eclipse.
Upon completion you should see a new button that appear in the bar, which refer to Android, also when creating a new project you have the option of choose for Android as shown in the following screen:
android-eclipse-linux


Popular Posts:

Flattr this!

  5 Responses to “How Configure an Android Development Environment on Linux”

  1. What is described here is a road to pain. Google abandoned the Eclipse-based IDE for a god reason. Instead, install the new Google&JetBrains developed IDE for Android and spare yourself the torture.

    • I agree. Netbeans is also a good alternative (using nbandroid plugin). As an additional point on the article maybe you could present the steps to add Intel support in the ADV manager (helps a lot with the emulator on Intel machines)

  2. At step 6 I encountered the following error on a CentOS 6.4 system

    Install Details
    The operation cannot be completed. See the details.
    Details
    Cannot complete the install because one or more required items could not be found.
    Software being installed: Android Traceview 22.3.0.v201310242005-887826 (com.android.ide.eclipse.traceview.feature.group 22.3.0.v201310242005-887826)

      • All most recently available for RHEL & CentOS 6.4

        # rpm -qa | grep eclipse
        eclipse-gef-3.6.1-3.el6.x86_64
        eclipse-mylyn-3.4.2-9.el6.x86_64
        eclipse-valgrind-0.6.1-1.el6.x86_64
        eclipse-svnkit-1.3.0-3.el6.x86_64
        eclipse-swt-3.6.1-6.13.el6.x86_64
        eclipse-pde-3.6.1-6.13.el6.x86_64
        eclipse-jdt-3.6.1-6.13.el6.x86_64
        eclipse-emf-2.6.0-1.el6.x86_64
        eclipse-linuxprofilingframework-0.6.1-1.el6.x86_64
        eclipse-mylyn-cdt-3.4.2-9.el6.x86_64
        eclipse-mylyn-wikitext-3.4.2-9.el6.x86_64
        eclipse-dtp-1.8.1-1.1.el6.x86_64
        eclipse-callgraph-0.6.1-1.el6.x86_64
        eclipse-mylyn-java-3.4.2-9.el6.x86_64
        eclipse-oprofile-0.6.1-1.el6.x86_64
        eclipse-platform-3.6.1-6.13.el6.x86_64
        eclipse-rse-3.2-1.el6.x86_64
        eclipse-subclipse-graph-1.6.5-6.el6.x86_64
        eclipse-cdt-7.0.1-4.el6.x86_64
        eclipse-mylyn-webtasks-3.4.2-9.el6.x86_64
        eclipse-birt-2.6.0-1.1.el6.x86_64
        eclipse-mylyn-trac-3.4.2-9.el6.x86_64
        jetty-eclipse-6.1.24-2.el6.noarch
        eclipse-subclipse-1.6.5-6.el6.x86_64
        eclipse-rcp-3.6.1-6.13.el6.x86_64
        eclipse-changelog-2.7.0-1.el6.x86_64
        eclipse-rpm-editor-0.5.0-2.el6.x86_64
        eclipse-mylyn-pde-3.4.2-9.el6.x86_64
        icu4j-eclipse-4.2.1-5.el6.x86_64

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*