Installing Android development environment on Ubuntu 9.04

January 30, 2010

in Android, Linux/Ubuntu

I wanted to play with writing Android apps on my home Linux computer, which is currently running Ubuntu 9.04 (Jaunty Jackalope). These are mostly notes for myself, so don’t feel guilty if you skip this post. :)

- Make sure your system is up-to-date:

sudo apt-get update && sudo apt-get upgrade

- Install Java

sudo apt-get install sun-java6-jdk

- Switch Sun to be the default version of Java. It’s much faster than the built-in version, at least when I tried it.

sudo update-java-alternatives -s java-6-sun

- Make a directory, e.g. mkdir ~/android

- Download Eclipse from http://www.eclipse.org/downloads/ (I chose the “Eclipse Classic 3.5.1″ version). Move the code into that directory, then unpack it. Unpacking is enough–the software runs in place and doesn’t have to be installed onto the system other than unpacking it.

mv eclipse-SDK-3.5.1-linux-gtk.tar.gz ~/android
cd ~/android
tar xzvf eclipse-SDK-3.5.1-linux-gtk.tar.gz

- Download the latest Android SDK from http://developer.android.com/sdk/index.html and move it into that directory, then unpack it. I believe unpacking is enough–the software runs in place and doesn’t have to be installed onto the system other than unpacking it.

mv android-sdk_r04-linux_86.tgz ~/android/
cd ~/android/
tar xzvf android-sdk_r04-linux_86.tgz

- Edit your ~/.bashrc file and add a line to the bottom:

export PATH=${PATH}:/home/matt/android/android-sdk-linux_86/tools

Okay, now Java, Eclipse, and the Android SDK are installed. Now you need to install the Android Development Tools (ADT) for Eclipse.

- Run Eclipse. If you installed Eclipse in ~/android/eclipse then you can cd to that directory and run ./eclipse to start the program.

- Install the Android Development Tools (ADT) for Eclipse. Follow the excellent instructions at http://developer.android.com/sdk/eclipse-adt.html to get and install the ADT. Don’t forget the “Window > Preferences” step to tell Eclipse where the Android SDK is, so when you click “Browse…” you might navigate to /home/matt/android/android-sdk-linux_86 for example.

- Next, I installed a bunch of packages. In Eclipse, click “Window->Android SDK and AVD Manager.” In the resulting window, on the left-hand side will be an “Available Packages” option. I clicked on that, then clicked the checkbox beside the “repository.xml” package to select all available packages and then clicked “Install Selected.” 12 out of the 14 packages installed for me.

- Now you’re ready to create your first Android program . You’ll discover how to make an Android virtual device (AVD) along the way.

- If you want, you can get custom skins, e.g. a Nexus One skin for Android. You can unpack the .zip file in <your-sdk-directory>/platforms/android-x.y/skins/nexusone for example. Then create a new Android virtual device (AVD) and select the Nexus One as the skin.

- If you want to run your Android program on your own Android device, you’re pretty close. Follow step 10 of this walkthrough. When you’re done and the phone is disconnected from your Ubuntu machine, you’ll still have the executable, called an “android package” or .apk file on your phone. So you can show your friends your “Hello, World!” program. :)

Some resources that I found helpful (other than the official Android developer site) are below:
- http://www.futuredesktop.org/developing_android_apps_on_ubuntu.html
- http://www.softwarepassion.com/setting-up-android-development-platform-on-ubuntu-linux-904/
- http://www.howtoforge.com/installing-google-android-sdk1.0-on-ubuntu8.04-desktop
- http://androidforums.com/developer-101/2321-installing-eclipse-android-sdk-ubuntu-8-04-8-10-a.html
- You might also want to watch this O’Reilly video or some of the official videos.

If you found this post at all interesting, you might also be interested in Google I/O too. Google I/O happens on May 19-20, 2010 in San Francisco.

{ 13 comments… read them below or add one }

Chris Arkwright January 30, 2010 at 8:22 pm

Thanks Matt, I’ll give this a shot! Cheers!

miguel January 31, 2010 at 12:22 am

Simple and complete. Nice post

Tim Wintle January 31, 2010 at 4:13 am

Just to point out that obviously Eclipse is optional (for those of us who like text editors terminal-based). I’m not a mobile dev, and the only time I got the Android SDK up and running was when google goggles came out – but I still couldn’t seem to install a copy even in the emulator :-( .

Andrew January 31, 2010 at 10:25 am

Mat

I like the idea of at least getting some kind of Android App running in a simulation environment on my XP PC. I use the NetBeans IDE for PHP dev mostly, it would be so cool to get Android working on this platform. Then I would love to blog about it.

Andy

zoooro January 31, 2010 at 8:02 pm

Thanks Matt!

Sunil February 1, 2010 at 12:54 am

I was really looking for a good tutorial. thanks a lot :)

Geiger February 1, 2010 at 7:54 am

People like the idea of Android, but dislike that there’s so many versions of it flying around.

FYI: The iPhone SDK is for Mac OS only. :(

We know you’re a king “Google Guy”, but have you paid any attention to the Palm webOS? Palm has somehow become the little guy on the field, but they are doing things soooooo right. The NEW Palm is reminiscent of a young Google in a lot of ways.

joe c. February 1, 2010 at 8:20 am

Good point Geiger, they may be doing things much better especially from a UI standpoint however, the marketing just isn’t generating the same kind of buzz that there is for the Google/Apple phones.

Facebook Developer February 2, 2010 at 5:10 am

After Google Nexus Android based smartphone many mobile developers are focusing to developed apps for these smartphones. And for Ubuntu its quite diffuclt for them. You have just share impressive lesson. Thanks for sharring Matt

Scott February 2, 2010 at 12:12 pm

irrelevant but you might be interested to know that http://adwords.google.com is currently stuck in an endless loop.

(although it will probably be fixed by the time you see this, but if not, I am sure you know who to contact to get it fixed)

Mobile User February 3, 2010 at 2:39 pm

Any reason this shouldn’t work on my MacBook Air?

Geiger February 9, 2010 at 6:46 pm

@joe c. – You couldn’t be more right! Did you see the ads from Verizon??? “Palm Pre – Smart Enough for your Mom”. Ugh….

Jib February 20, 2010 at 10:35 pm

Outstanding. I am a long time Win dev and I ordered a Dell laptop with Ubuntu just to do Android dev so I am the noobist of the noobs to this. I followed your post and in no time at all, I had my own ‘Hello Android’. The links you provide will keep me going for a while. Excellent job!

Leave a Comment

If you have a question about your site specifically or a general question about search, your best bet is to post in our Webmaster Help Forum linked from http://google.com/webmasters

If you comment, please use your personal name, not your business name. Business names can sound salesy or spammy, and I would like to try people leaving their actual name instead.

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

Previous post:

Next post: