• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Installing Eclipse and the Android SDK (Ubuntu 8.04/8.10)

devolio

Android Enthusiast
Note: In this tutorial, I'm using Xubuntu 8.04. These steps are the same for Ubuntu and Kubuntu as well. They're also the exact same for [Xu|Ku|U]buntu 8.10.

The first thing we need to do is download all of the needed files. First up, the Android SDK. You can download it from http://code.google.com/android/download.html

We're also going to need Eclipse. Head over to http://www.eclipse.org/downloads/. The version we want is Eclipse IDE for Java Developers. The JEE version will work as well.

picture.php


Next, we're going to need Java. Bring up a terminal window (Applications -> Accessories -> Terminal). We can install it using apt, by running...

sudo apt-get install sun-java6-bin

picture.php


(If you're using a 64 bit distribution, you'll also need to install the ia32-libs as well)

Once it's done downloading the files, it will prompt you about the license.

picture.php


Press tab, and then enter. It will tell you that you have to accept the license to continue, and then prompt you again. Select yes, and press enter to continue.

picture.php


Now that Java is installed, we can get started on Eclipse. First, let's untar/gzip Eclipse. In our terminal window...

cd ~/Desktop

And then untar/gzip the file.

tar xvfz eclipse-jee-ganymede-SR1-linux-gtk.tar.gz

picture.php


Finally, move it into your home folder.

mv eclipse ~

picture.php


Now, if you want to add eclipse to your menu, right click on Applications and Edit Menu. Click on Programming, and then click New Item. Type in the name, and the full location to Eclipse (/home/yourusername/eclipse/eclipse), and finally, click OK.

Personally, I just made a launcher for it on my Desktop.

picture.php


Now, let's extract the Android SDK. Back in the terminal again...

unzip android-sdk-linux_x86-1.0_r1.zip

picture.php


Let's move the resulting folder into our home folder.

mv android-sdk-linux_x86-1.0_r1/ ~

picture.php


Now, this is the single most important step. Without this, we'll encounter all sorts of odd problems later. Open up your ~/.bashrc in your favorite editor (because I'm doing this in Xubuntu, I'm using mousepad. You can use whatever you'd like.)

sudo mousepad ~/.bashrc

And we're going to add the following at the bottom of the file (making sure you replace yourusername with your actual username.)

export PATH=${PATH}:/home/yourusername/android-sdk-linux_x86-1.0_r1/tools

picture.php


Save the changes, and exit your editor. Now, we can start up Eclipse.

Eclipse will prompt you to choose a workspace location.

picture.php


This is where all of your project files will be stored. Set it where you want, and click OK.

Once Eclipse is started up, we can add the ADT plugin. In the menu, Help -> Software Updates.

picture.php


Click on the Available Software tab, and then Add Site. For the location, we're going to enter http://dl-ssl.google.com/android/eclipse/

picture.php


And click OK. Eclipse will go find the list of available software, and update your list.

picture.php


Click the checkbox next to the Location we just added to select all of the software, and click Install.

picture.php


Eclipse will calculate all of the requirements and download the needed files. Then you'll be greeted by the Install window.

picture.php


Click Next to install the selected tools. You'll be asked to agree to the license.

picture.php


Accept the license agreement, and then click Finish. Eclipse will install everything...

picture.php


...And then will prompt you to restart, click Yes. Eclipse will restart.

The last thing we need to do is point the ADT plugin to our Android SDK folder. In the top menu, go to Window -> Preferences, and then click on the Android tab.

picture.php


Click Browse, choose the Android SDK folder, and then click OK. Now click Apply and let Eclipse crunch on it for a second or two.

picture.php


And click OK. You're finished!

To run a quick test and make sure everything is working properly, go to File -> New -> Project. Expand Android, click on Android Project, and click Next.

picture.php


Now we'll have to fill in our project information. Because this is a test run, we'll call the project testrun. For the package name, we'll use com.android.test. And last but not least, the activity name will be test.

picture.php


Click Finish.

Eclipse will crunch on that for a second, and open the project in the left pane. Expand the main tree to see the file structure of a default new project. The last thing we need to do before we run our test application is set up a run configuration. In the menu, go to Run -> Run Configurations...

Double click on Android Application and it will create a new configuration. Give the configuration a name, and click browse for the project.

picture.php


Choose your project, click OK. Now click Apply, then Run.

You'll notice the bottom pane switches over to Console. This will let you know what's going on with the emulator. After a few seconds, the emulator will start up.

picture.php


Note that the first run will take *much* longer than usual to start up, as it's setting up the Android OS while it starts up for the first time. Depending on the specs of your computer, it can take anywhere from a few minutes to over half an hour.

After awhile, you'll arrive at the starting screen. Usually, you'll get a few errors as things start up and can't be started.

picture.php


I usually just click wait. In the console, you'll see it install, and then start up your application.

picture.php


picture.php


And with that, it's time for you to dive into the code and start making your application.
 
Hi,
just wanted to say that the plain "Linux" instructions listed at the Android and Eclipse sites work 100% for PCLinuxOS as well.
 
Stupid thing in ubuntu 9.04 is that they don't have eclipse 3.3+ in repos which is required for android :(

So you must download/install it manually :(
 
Stupid thing in ubuntu 9.04 is that they don't have eclipse 3.3+ in repos which is required for android :(

So you must download/install it manually :(

I'm still on 9.04. I am going to use a "mixed" system and install Eclipse from Karmic on Jaunty based on advice from the Ubuntu forums.

I found a great blog about how to do it: http://blog.opperschaap.net/2009/12/...distributions/

"You could use that to receive updates for Eclipse on Karmic, and keep your own system on Jaunty. And when you feel ready to move on, you can remove the preferences file or change it to upgrade."

However, manual downloading and installing is pretty easy...
 
I've done everything here I actually found it in another tutorial I've copy and pasted the hello world in, but mine is a bit different everywhere. Here is a picture of my laptop while waiting for the emulator to crash again.
IMAG0014.jpg


It says android in that font for quite awhile after it says android in a bland font, like this posts font for example.

I've also noticed things are a bit different on my screen then on the tutorials.
I'm also doing all this from a very slow laptop with SSH and X forwarding to a faster desktop, incase that matters. The Desktop has all development files.

Thanks for any and all information :) If this should have been its own post I'm sorry,
 
I've done everything here I actually found it in another tutorial I've copy and pasted the hello world in, but mine is a bit different everywhere. Here is a picture of my laptop while waiting for the emulator to crash ...
Yes, I too noticed in the newest software versions that everything is a lot different from this tutorial. We need an updated tutorial.

The first time I ran my test project it took about 5 minutes (I think) for the emulator to go thru all its startup steps -- on a fairly fast desktop computer.

Also, I had to dismiss about 3-5 crash messages. I didn't even count them. I just dismissed them one after the other. From the tutorial, it sounded like this is expected.

I have no idea how the X forwarding will affect the emulator startup. Just give it plenty of time. All I can say is just wait and watch the messages in the console window and see what happens...
 
When I have a chance ill try again. But work is getting in the way as usual.....

Next time ill give it an entire day on the desktop. See whay happens
 
Mind if I use a large percentage of this (giving credit of course) and create a Mac OS X installation sticky?
 
I just got done installing the Java SDK and Eclipse on Ubuntu 10.04. The problem i had was that Eclipse Helios (3.6) didn't work. I had to use Eclipse Galileo (3.5) in order for Android to show up as an option in the Projects list.
 
Devolio, thanks SOOOO much this was best guide I ever saw and went to a lot of sites. Thanks so much.


That said....do you have (have you made) or can you rec any more guides? Thanks!

(I have skimmed a few guides and books on android dev but, well, this guide of yours worked!)
 
Back
Top Bottom