Android Development on Ubuntu: Installing Eclipse, SDK and NDK

This post is for those interested in developing on the android platform but don’t want to use a propriety OS such as Windows or Apple OSX  (for legal, preferential or cost reasons). In my case I am using Ubuntu 10.10, however, this process is applicable to most Linux distributions using the same Unix commands, with only minor changes in the procedure.

Step1: Download the tools

You will need to download the Eclipse IDE, the Android Software Development Kit (SDK) and for completeness the Native Development Kit (NDK). In this example I downloaded the eclipse IDE for java developers.

Step2: Install the tools
First install the Eclipse IDE:
The GUI method (if supported by your X-System) is to simply double click the the “elclipse-xxx-xxxx-linux-x86_64(or 32).tar.gz” and open with your preferred archive manager (in this example I used File Roller 2.32.0 [Gnome based]). Extract the “eclipse” folder to somewhere you deem appropriate for the application to be executed (i.e. your home folder or /opt/ etc).

The command line method:
Similarly you can perform the archive extraction to the same folder in terminal if your X-system doesn’t support the GUI method, so open a new terminal window and change directory “cd” to the location of your downloaded Eclipse IDE package and move the archive to the folder that you deemed appropriate by typing:

$ mv eclipse-jee-indigo-linux-gtk-x86_64.tar.gz "absolute path to your folder" --e.g. "/home/mat/android"

Then cd to that directory and extract the contents with the following:

tar xzvf eclipse-jee-indigo-linux-gtk-x86_64.tar.gz

Elcipse is a java based development environment which once extracted is ready to use. However, ensure you download the latest java framework from sun if you haven’t already.

Android SDK – Once you have downloaded the android SDK from the above link, simply extract the files to your folder using the same above method.
Android NDK – Again here you simply extract the files to the same directory above. So inside your Android directory you now have eclipse, android SDK and android NDK.

Step4: : Configuring Eclipse SDK for Android development (Configuring the ADT)
Installing eclipse alone doesn’t give you the full functionality for development in Android, there is a series of debugging tools and libraries that need to be downloaded through the eclipse software distribution called Android development tools (ADT). To do this, run eclipse by cd’ing to the directory in the terminal or navigating to the eclipse directory and double clicking the eclipse run file, or by typing the following:


Once you have set up a work space, you simply navigate to Help > Install new software, click add and in the http:// field place the following:

And provide a name, such as ADT plugin. Then click Ok.
The tool list will then be retrieved and after a short time you can select the tools you would like to install, check “Developer Tools” to select them all (Recommended). Click Next
Then all integrity checks are made to ensure there are no dependent tools already installed (as you are installing from fresh there shouldn’t be any problems).
Once everything checks out, click Next
This step, read through and Agree to the licence agreements presented and click Finish.
The installation will take some time, when it is complete restart eclipse.

Now elcipse needs to be pointed to the Android SDK directory, do this by: Window > Preferences then click on Android. In the Android SDK location box select browse and navigate to the root folder for Android SDK and click Ok.

Android SDK software

Android SDK software Installation

And that’s it for eclipse, however it is now important you install any updates that may be available for Android SDK. To do this in eclipse go to Window > Android SDK and AVD manager. The manager will open and on the side pane click Available packages, here you can select what you need from third party Android device manufactures. Ensure you install critical updates regularly from the Android repository.
The installation for these items is straight forward, simply select the item you wish and click Install Selected

For now the NDK is set up, however, I will do a blog article that will introduce you to the fundamentals of developing native C code for your android application. In the comming days, stay tuned.