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


Last Updated:

  1. devolio

    devolio Well-Known Member This Topic's Starter

    Joined:
    Oct 30, 2008
    Messages:
    339
    Likes Received:
    37
    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.

    [​IMG]

    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

    [​IMG]

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

    [​IMG]

    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.

    [​IMG]

    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

    [​IMG]

    Finally, move it into your home folder.

    mv eclipse ~

    [​IMG]

    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.

    [​IMG]

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

    unzip android-sdk-linux_x86-1.0_r1.zip

    [​IMG]

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

    mv android-sdk-linux_x86-1.0_r1/ ~

    [​IMG]

    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

    [​IMG]

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

    Eclipse will prompt you to choose a workspace location.

    [​IMG]

    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.

    [​IMG]

    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/

    [​IMG]

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

    [​IMG]

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

    [​IMG]

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

    [​IMG]

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

    [​IMG]

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

    [​IMG]

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

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

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

    [​IMG]

    [​IMG]

    And with that, it's time for you to dive into the code and start making your application.
     

    Advertisement
    globus25 likes this.
  2. KlaymenDK

    KlaymenDK Well-Known Member

    Joined:
    May 29, 2009
    Messages:
    1,217
    Likes Received:
    130
    Hi,
    just wanted to say that the plain "Linux" instructions listed at the Android and Eclipse sites work 100% for PCLinuxOS as well.
     
  3. HKVN

    HKVN New Member

    Joined:
    Jun 29, 2009
    Messages:
    1
    Likes Received:
    0
    In Fedora and Debian, Android SDK work perfectly :).
     
  4. confiq

    confiq Member

    Joined:
    Jun 27, 2009
    Messages:
    11
    Likes Received:
    1
    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 :(
     
  5. MountainX

    MountainX Well-Known Member

    Joined:
    Nov 27, 2009
    Messages:
    140
    Likes Received:
    3
    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...
     
  6. MountainX

    MountainX Well-Known Member

    Joined:
    Nov 27, 2009
    Messages:
    140
    Likes Received:
    3
    On 64-bit Ubuntu, here is the command I used for installing java:

    Code (Text):
    1. sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jkd sun-java6-plugin sun-java6-fonts ia32-libs
    The JDK should be optional, but for some unknown reason, my java only worked after I installed the JDK. The plugin and fonts should be optional too.

    Here's a helpful link:
    Ubuntu Linux Install Sun Java Development Kit ( JDK ) and Java Runtime Environment ( JRE )
     
  7. Simy

    Simy New Member

    Joined:
    Dec 17, 2009
    Messages:
    2
    Likes Received:
    0
    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.[​IMG]

    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,
     
  8. MountainX

    MountainX Well-Known Member

    Joined:
    Nov 27, 2009
    Messages:
    140
    Likes Received:
    3
    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...
     
  9. Simy

    Simy New Member

    Joined:
    Dec 17, 2009
    Messages:
    2
    Likes Received:
    0
    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
     
  10. montyboy

    montyboy Member

    Joined:
    Feb 7, 2010
    Messages:
    21
    Likes Received:
    1
    Mind if I use a large percentage of this (giving credit of course) and create a Mac OS X installation sticky?
     
  11. dataphile

    dataphile New Member

    Joined:
    Aug 1, 2010
    Messages:
    1
    Likes Received:
    0
    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.
     
  12. mdl4

    mdl4 New Member

    Joined:
    Jun 26, 2011
    Messages:
    3
    Likes Received:
    0
  13. johntkucz

    johntkucz Member

    Joined:
    Aug 25, 2011
    Messages:
    8
    Likes Received:
    0
    Devolio, thanks SOOOO much this was best guide I ever saw and went to a lot of sites. Thanks so much.
     
  14. johntkucz

    johntkucz Member

    Joined:
    Aug 25, 2011
    Messages:
    8
    Likes Received:
    0

    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!)
     
  15. loveubuntu

    loveubuntu Member

    Joined:
    Nov 23, 2011
    Messages:
    17
    Likes Received:
    2
  16. droidbot45

    droidbot45 Member

    Joined:
    Mar 28, 2012
    Messages:
    12
    Likes Received:
    0
    Thanks for the tutorial
     
  17. mdl4

    mdl4 New Member

    Joined:
    Jun 26, 2011
    Messages:
    3
    Likes Received:
    0
  18. chilin221

    chilin221 New Member

    Joined:
    Mar 11, 2011
    Messages:
    4
    Likes Received:
    0
    If you're on Windows, or mac this Android Getting Started Tutorial should help out. It's from mybringback and they have a bunch of android tutorials for beginners. Hope that helps
     

Share This Page

Loading...