Blog

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)

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

Install Java! You develop on android or not Java is a must on all my machines :)

$ sudo apt-get install sun-java6-jdk

You can now check your java installation by issuing two commands:

$ java -version
$ javac -version

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:

export PATH=${PATH}:/home/kris/android-sdk-linux_x86-1.5_r1/tools

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:

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

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!

30 responses on “Setting up Android development platform on Ubuntu Linux 9.04

  1. Ivan May 16, 2009 at 11:27 am

    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! :)

  2. Ivan May 16, 2009 at 11:39 am

    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}:

  3. admin May 16, 2009 at 1:37 pm

    Yeah, thanks for pointing that one out, this is corrected now.

  4. johnny bravo May 24, 2009 at 9:28 pm

    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?

  5. admin May 24, 2009 at 9:54 pm

    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.

  6. johnny bravo May 25, 2009 at 3:26 am

    thanks i did what you said and got everything set up.

  7. Toby Corkindale August 4, 2009 at 4:27 am

    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.

  8. Zashkaser August 5, 2009 at 6:44 pm

    The article is ver good. Write please more

  9. Sciallo August 24, 2009 at 12:20 am

    A little shortcut, there is a repository for the latest eclipse… see https://edge.launchpad.net/~yogarine/+archive/eclipse

  10. Chris Sheppard September 7, 2009 at 1:06 pm

    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

  11. Fermileve September 26, 2009 at 11:30 am

    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

  12. stephane November 9, 2009 at 9:11 pm

    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).

  13. HR April 3, 2010 at 10:58 pm

    Now.. if you could just tell me how do download from SVN and compile for the motorola droid I would be estatic.

  14. Owen May 4, 2010 at 7:59 pm

    Thanks for the web site: trying 10.04 and so far ok (using ubuntu eclipse)

  15. gimeti June 14, 2010 at 9:27 am

    Thank You Sir!

  16. Narasimha Reddy August 25, 2010 at 2:04 pm

    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..

  17. Ajmal Hussain Abbasi August 31, 2010 at 7:38 am

    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.

  18. Joaquim Homrighausen August 31, 2010 at 3:22 pm

    Nice tutorial; thanks for taking the time to write it.

  19. Snoo September 21, 2010 at 10:57 pm

    Hi!

    Thanks! You saved me, when no other tutorial could. <3

  20. Bill January 19, 2011 at 5:18 pm

    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 :)

  21. Jack April 18, 2011 at 10:57 pm

    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

  22. airtonix July 20, 2011 at 3:16 pm

    by the way…

    vim sucks. use nano instead.

  23. Dipan November 13, 2011 at 9:21 am

    Awesome.! thanks all working good.!

  24. Pakistan Politics December 20, 2012 at 12:53 pm

    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?

  25. admin December 20, 2012 at 12:55 pm

    A year ago I’ve moved to OSX and I’m not coming back to Linux ;) (at least soon)

Leave a Reply

Related Posts

    No Releated Posts

30 responses on “Setting up Android development platform on Ubuntu Linux 9.04

  1. Ivan May 16, 2009 at 11:27 am

    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! :)

  2. Ivan May 16, 2009 at 11:39 am

    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}:

  3. admin May 16, 2009 at 1:37 pm

    Yeah, thanks for pointing that one out, this is corrected now.

  4. johnny bravo May 24, 2009 at 9:28 pm

    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?

  5. admin May 24, 2009 at 9:54 pm

    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.

  6. johnny bravo May 25, 2009 at 3:26 am

    thanks i did what you said and got everything set up.

  7. Toby Corkindale August 4, 2009 at 4:27 am

    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.

  8. Zashkaser August 5, 2009 at 6:44 pm

    The article is ver good. Write please more

  9. Sciallo August 24, 2009 at 12:20 am

    A little shortcut, there is a repository for the latest eclipse… see https://edge.launchpad.net/~yogarine/+archive/eclipse

  10. Chris Sheppard September 7, 2009 at 1:06 pm

    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

  11. Fermileve September 26, 2009 at 11:30 am

    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

  12. stephane November 9, 2009 at 9:11 pm

    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).

  13. HR April 3, 2010 at 10:58 pm

    Now.. if you could just tell me how do download from SVN and compile for the motorola droid I would be estatic.

  14. Owen May 4, 2010 at 7:59 pm

    Thanks for the web site: trying 10.04 and so far ok (using ubuntu eclipse)

  15. gimeti June 14, 2010 at 9:27 am

    Thank You Sir!

  16. Narasimha Reddy August 25, 2010 at 2:04 pm

    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..

  17. Ajmal Hussain Abbasi August 31, 2010 at 7:38 am

    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.

  18. Joaquim Homrighausen August 31, 2010 at 3:22 pm

    Nice tutorial; thanks for taking the time to write it.

  19. Snoo September 21, 2010 at 10:57 pm

    Hi!

    Thanks! You saved me, when no other tutorial could. <3

  20. Bill January 19, 2011 at 5:18 pm

    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 :)

  21. Jack April 18, 2011 at 10:57 pm

    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

  22. airtonix July 20, 2011 at 3:16 pm

    by the way…

    vim sucks. use nano instead.

  23. Dipan November 13, 2011 at 9:21 am

    Awesome.! thanks all working good.!

  24. Pakistan Politics December 20, 2012 at 12:53 pm

    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?

  25. admin December 20, 2012 at 12:55 pm

    A year ago I’ve moved to OSX and I’m not coming back to Linux ;) (at least soon)

Leave a Reply