Setting up Android development platform on Ubuntu Linux 9.04
In this post I will go step by step through the setup of your development box for Android and all its goodness. I start with fresh install of the newest and shinest Ubuntu platform 9.04, which by the way on the first look is just great. I’m a happy owner of G1 for a few months and this is the best phone I ever had so why not start writing some software on it!
Step One.
Before installing anything please run the following command (actually 2 commands)
Install Java! You develop on android or not Java is a must on all my machines 🙂
You can now check your java installation by issuing two commands:
You should be able to see output stating that you have java 6 installed, huuraaayy!
Step Two.
Download and install Android SDK
You can download the latest android SDK from the android development website (developer.android.com), the link to the latest version is here
After your download completes, unzip the file to the directory of your choice. I copy the whole folder into my home directory but the doesn’t really matter.
Open up your favourite text editor (VIM of course) and add the following line at the very bottom of the .bashrc file:
Stepp Three
Download and Install Eclipse
I wish I could go for the easy one here and download the version using apt-get but unfortunately not as the version in repos is 3.2 and ADT plugin requires version 3.3 or higher. You have to download the eclipse for www.eclipse.org and unpack it. Once unpacked its ready to use!
Step Four
Download and install Eclipse plugin
This is instruction from the developer.android.com with one small modification, instead of https use http:
1. Start Eclipse, then select Help > Software Updates….
2. In the dialog that appears, click the Available Software tab.
3. Click Add Site…
4. Enter the Location:http://dl-ssl.google.com/android/eclipse/
If you have trouble aqcuiring the plugin, try using “http” in the Location URL, instead of “https” (https is preferred for security reasons).Click OK.
5. Back in the Available Software view, you should see the plugin listed by the URL, with “Developer Tools” nested within it. Select the checkbox next to Developer Tools and click Install…
6. On the subsequent Install window, “Android DDMS” and “Android Development Tools” should both be checked. Click Next.
7. Read and accept the license agreement, then click Finish.
8. Restart Eclipse.
After executing all the steps above you are ready for Android development. The last step in this tutorial is to run example android projects on your linux dev machine.
If you encounter an error saying :
An error occurred during provisioning.
Cannot connect to keystore.
JKS
Please check your java version. If its set to 1.5 than please run the following command:
Once you finish installing required plugins, restart your eclipse and go to Window->Preferences->Android and set up a path to your android SDK
Step Five
Check your configuration
If all went fine you can try to develop Hello World application in android. You can find the instruction on the android development site:
http://developer.android.com/guide/tutorials/hello-world.html
More android tutorials to come!
Enjoy!
Hi,
On step 2, where you say:
Open up your favourite text editor (VIM of course) and add the following line at the very bottom:
Where exactly do you save that file and how you name it?
Sorry, I’m quite a newbie at this. Many thanks! 🙂
Ah sorry, I just found where to put the path:
“On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to your $SDK_ROOT/tools to it. If you don’t see a line setting the path, you can add one:
export PATH=${PATH}:
Yeah, thanks for pointing that one out, this is corrected now.
i’ve been using windows until last week (now im using ubuntu 9.04) how do i install eclipse in ubuntu the file is in a tar.gz format?
Just unpack the file using ‘tar xzvf filename.tar.gz’ and double click the eclipse file to start it. You don’t need to install it, it should work straight away after unpacking.
thanks i did what you said and got everything set up.
You don’t need to manually install Eclipse to get recent versions on Ubuntu Jaunty.
Use this PPA:
https://launchpad.net/~eclipse-team/+archive/ppa
This is better, as you’ll automatically get updates.
The article is ver good. Write please more
A little shortcut, there is a repository for the latest eclipse… see https://edge.launchpad.net/~yogarine/+archive/eclipse
I used the software sources described on the ~yogarine page above (thanks Sciallo) but after getting to be ready to check “Android DDMS” and “Android Development Tools” and got “Cannot complete the install because one or more required items could not be found.
Software being installed: Android Development Tools 0.9.1.v200905011822-1621 (com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621)
Missing requirement: Android Development Tools 0.9.1.v200905011822-1621 (com.android.ide.eclipse.adt.feature.group 0.9.1.v200905011822-1621) requires ‘org.eclipse.gef 0.0.0’ but it could not be found
I’ve obviously mis-read your instructions somewhere. I’ve installed Eclipse Vn 3.5
See this tutorial for some photos of new android 1.6
http://unixlab.blogspot.com/2009/09/how-to-install-android-sdk-16-on-ubuntu.html
I get this bug when trying to install android add-ons into eclipse : https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/477944
I was trying to use the ubuntu-provided version of Eclipse 3.5 (on Karmic).
Now.. if you could just tell me how do download from SVN and compile for the motorola droid I would be estatic.
Thanks for the web site: trying 10.04 and so far ok (using ubuntu eclipse)
Thank You Sir!
Iam trying to run android apps in eclipse 3.5 but iam getting the error as “Error generating final archive: Unable to get debug signature key”….my ubuntu version is 8.04..even when iam tring to create avd its showing error:null….i tried all the ways….please help me out..
Hi, thanks a lot for helping me to set up my system for Android development. I am using Ubuntu for a long time but going to develop for android for the first time.
Nice tutorial; thanks for taking the time to write it.
Hi!
Thanks! You saved me, when no other tutorial could. <3
Nice write how-to. Very helpful. There are some additional hoops to jump through for 64-bit installations, but they were conquered easily enough.
Have you considered following this up with installing the subclipse SVN eclipse plugin? I have been using subclipse with Assembla’s free online SVN repository to store my projects. Beanstalk is another reasonable choice for source control. It’s prettier but has a leaner free offering.
I ask this because I find very few developers that understand the benefits of using source control. Software Passion seems like the right place to help a grass roots SCM movement 🙂
Excellent tutorial for getting android development set up on Eclipse. Thanks so much for your help, I can wait to start developing. Next stop: your tutorial.
Joel
by the way…
vim sucks. use nano instead.
Awesome.! thanks all working good.!
After going through so many tutorials, finally your tutorial helped me to get android setup successfully on my Ubuntu machine. Can you also share tutorial how to setup Android development environment on OpenSuse?
A year ago I’ve moved to OSX and I’m not coming back to Linux 😉 (at least soon)