How to set up Eclipse with Android SDK on Ubuntu linux 9.04/9.10 (updated)


SDK Version: 
M3

In my first tutorial i will show you how to set up Eclipse 3.5 with Android Development Tools (ADT) on Ubuntu 9.04.

Before we can install the Android SDK, we must install Java. First we open a new terminal window (Applications > Accessories > Terminal).

To install Java, type:

sudo apt-get install sun-java6-bin 

If you are on a x86_64 system, you also must install ia32-libs:
 

sudo apt-get install ia32-libs

For Ubuntu 9.10 users:

Install eclipse from apt-sources, so open a terminal, then:

sudo apt-get install eclipse

Now open up Eclipse, and go to:
Help Menu -> Install New Software

* Add:
https://dl-ssl.google.com/android/eclipse/
http://download.eclipse.org/datatools/updates
http://download.eclipse.org/webtools/updates/
http://download.eclipse.org/modeling/emf/updates/releases/
http://download.eclipse.org/tools/gef/updates/releases/
http://dl.google.com/eclipse/plugin/3.5 (think this one's optional)

Install these packages, and then you can install adt plugin as well.

we must download Android SDK, located here: http://developer.android.com/sdk/index.html

Now open a terminal again and go to the directory where you've saved the Android SDK and uncompress it, then delete the archive file:
 

cd /home/joeygeek/Desktop
tar xvfz android-sdk_r04-linux_86.tgz
rm android-sdk_r04-linux_86.tgz


Move to your home directory:

mv android-sdk-linux_86 /home/joeygeek

Go to Window > Preferences. Select Android, and add the SDK Location: /home/joeygeek/android-sdk-linux_86
Click the Apply and then OK.

New step we update the Android API versions. Select Window > Android SDK and AVD Manager

* See the end of this tutorial...

Ubuntu 9.04 users:

Ubuntu 9.04 repositories only have a package for Eclipse 3.2 - therefore we must install Eclipse 3.5 manually, you can download it from http://www.eclipse.org/downloads/.

Eclipse 3.5.1

I've chosen the Eclipse Classic Developers for Linux 32bit (select Linux 64bit if you're on an x86_64 system).

Download the file and open a terminal again. Go to the directory, where you've downloaded the Eclipse file, e.g. your desktop (/home/joeygeek/Desktop), and uncompress it:
 

cd /home/joeygeek/Desktop
tar xvfz eclipse-SDK-3.5.1-linux-gtk.tar.gz


Afterwards the eclipse directory located on your desktop, i move it to my home directory:
 

mv eclipse /home/joeygeek


Then you can delete the archive file (if you want):

rm eclipse-SDK-3.5.1-linux-gtk.tar.gz


Inside the eclipse directory, there is an executable file called eclipse, that's the file you must run to start eclipse.
 

cd /home/joeygeek/eclipse
./eclipse

 

Eclipse is asking for a workspace:

Workspace

After that we must download Android SDK, located here: http://developer.android.com/sdk/index.html

Now open a terminal again and go to the directory where you've saved the Android SDK and uncompress it, then delete the archive file:
 

cd /home/joeygeek/Desktop
tar xvfz android-sdk_r04-linux_86.tgz
rm android-sdk_r04-linux_86.tgz


Move to your home directory:

mv android-sdk-linux_86 /home/joeygeek


Next, we must install Graphical Editing Framework (GEF) for Eclipse. You can download here: http://www.eclipse.org/gef/

You need GEF to install Android Eclipse plugin later.

Gef

Download, unzip then move in to your eclipse directory:

cd /home/joeygeek/Desktop
unzip GEF-ALL-3.5.1.zip


Now we have a new eclipse directory on your desktop, move it to your "real" eclipse directory:
 

mv -f eclipse /home/joeygeek


Now start eclipse:

cd /home/joeygeek/eclipse
./eclipse


Next, we install the Android Eclipse plugin. In eclipse go to: Help > Install new Software
Click the Add.. button, and type  https://dl-ssl.google.com/android/eclipse/ to Location textbox. You can add a name your new site, e.g. call it "android" :)
Android install

Then click OK. The middle of the window, there is a checkbox, select Developer Tools (automatically check Android DDMS and Android developer tools)

check it all

Then click Finish. The plugins are now being installed. Eclipse must be restarted for the changes to take effect, so when you are asked if you want to restart Eclipse after the installation, you should select Yes. After Eclipse has started again, we must update our Eclipse preferences to point to the Android SDK directory. Go to Window > Preferences. Select Android, and add the SDK Location: /home/joeygeek/android-sdk-linux_86
Click the Apply and then OK.

New step we update the Android API versions. Select Window > Android SDK and AVD Manager

You should see that:

P

Sorry for windows window, but i did not want to delete my downloaded apis. :)))
Select all then click Install selected.
After this step you can create a new virtual device, Select Window > Android SDK and AVD Manager, click Virtual Devices. Introducing the Android Emulator, managing Android Virtual Devices (AVD)...