03-31-2011 10:16 AM
41 12
tools
  1. Jerry Hildenbrand's Avatar
    I just spent all day figuring this out for a good friend and was wise enough to document it so I could share. The scope of this How-To is to help a user set up a native Linux shell and programming environment for Android OS using Ubuntu 9.10 over an existing Windows installation. The steps are outlined below.

    1. Make sure you have enough room on your hard drive. I recommend at least 10 GB for the system and applications. This space will be unavailable to Windows after you're done.

    2. Fire up your web browser and go to Wubi - Ubuntu Installer for Windows . This is basically a batch file that does everything needed to install a generic version of Ubuntu 9.1 on your computer. Using this, it's easy to uninstall the whole Linux installation from the Windows control panel. If you've never tried installing Linux before, this is for you.

    3. When you're all done and restarted, play with Ubuntu for a bit. Learn how to open Firefox and the terminal. Search for some Ubuntu user forums and do some reading. Once you're familiar enough with the OS and you're ready to install everything, cruise back here and continue.

    4. You have to install Sun's Java Runtime Engine (JRE) and Java Development Kit (JDK). You also need to remove OpenJDK and other incompatible Java items.

    Start gnome-terminal from Ubuntu's main menu Applications -> Accessories -> Terminal and run these commands one by one.

    Code:
    sudo apt-get remove -y --purge openjdk-6-jre openjdk-6-jre-lib openjdk-6-jdk gcj
    
    sudo apt-get install --reinstall -y sun-java6-jre sun-java6-jdk sun-java6-fonts
    Anytime it asks for a password, it means your user password.
    If you need to confirm the license, press TAB-key or arrow-keys to move the cursor in the text window.

    5. Install Eclipse. Before you begin, you need to be sure you don't have any bits of the standard Ubuntu Eclipse version. In your terminal type
    Code:
    sudo apt-get remove eclipse
    Then browse to Eclipse Downloads and download the "Eclipse IDE for Java EE Developers (188 MB)". To determine which version (32 or 64 bit) you need, in your term type:
    Code:
    uname -a
    You'll either see i686 (for 32bit) or X86_64 (for 64bit Linux). Download the correct version. On your menu, open Places->Downloads and click the eclipse package you downloaded. File Roller will open. Drag the folder into your Home folder. It should create an "eclipse" directory in your $HOME area (like /home/username/eclipse/). Then check the eclipse directory.
    Code:
    cd ~
    ls -l
    you should see eclipse listed. There's a bug between Ubuntu 9.1 and eclipse. It's easy to fix. Applications->Accessories->gEdit Text Editor. In the blank document that opens type the following:
    Code:
    GDK_NATIVE_WINDOWS=true $HOME/eclipse/eclipse
    Save the file as ~/eclipse/start.sh.
    In your term:
    Code:
    cd ~/eclipse
    chmod +x start.sh
    Then anytime you want to start eclipse type:
    Code:
    cd ~/eclipse
    ./start.sh
    You can also create a launcher (shortcut) on your desktop by right clicking on the desktop, selecting create launcher. The command should point to the start.sh file you created.

    6. Download the Android SDK for Linux by browsing to Android SDK | Android Developers . Take the newest SDK version for Linux (i386). It will work on all Linux versions.
    Once again, open your downloads folder and click the SDK. Drag the android-sdk-linux folder into your home folder.

    7. Create a Virtual Device. Open your term and type
    Code:
    nano
    This will open a console text editor. We have to fix another bug before we can continue. In the editor that opened type:
    Code:
    sdkman.force.http=true
    then CTRL+X . It will ask you if you want to save the buffer (file). Type y for yes. It then asks for a name, type
    Code:
    ~/.android/androidtool.cfg
    then enter.
    Now we need to move to the android/tools dir and start the adv manager.
    Code:
    cd ~/android-sdk-linux/tools
    ./android
    This will start a gui to set up your environment. In the dialog that opens:
    1. Select Available Components in the left panel. This will reveal all components currently available for download.
    2. Select everything and click Install Selected.
    3. Verify and accept the components you want and click Install Accepted. The components will now be installed into your existing Android SDK directories.
    Close the dialog.

    Back in your term type
    Code:
    ./android create avd --target 2 --name my_avd
    In the "target" field, use 1 for a 1.5 device, 2 for a 1.6 device and 3 for a 2.0 device. The above will create a device using Android 1.6.

    8. Install the Android plugin for the Eclipse IDE.
    Now start the Eclipse IDE and select Help -> "Install New Software..." from the menu. The "Install" dialog for new software should appear. Then press the [Add...] button and fill in these values.
    Code:
    Name: Android plugin
    Location: https://dl-ssl.google.com/android/eclipse/
    Then stay in the same dialog and wait 5 - 10 seconds. You should first see that the status changes to "Pending...". It will now communicate with the Google's site and download the most recent plugin. Wait until the status or text changes to "Developer Tools", then check "Developer Tools" and all its subitems. Click the [Next...] button to move forward. gain, click the [Next..] button to move to the final dialog and accept/confirm the license text. Then select Finish.

    9. Eclipse IDE has to know the location of Android SDK. It's very easy to set. Start the Eclipse IDE and select Window -> Preferences from the main menu. Select "Android" from the list. Then click the [Browse...] button and set the path of SDK Location. (It's in your HOME directory. You downloaded and extracted it above).


    Congratulations. You now have a native Linux environment to use the adb shell, complete with the tools to develop Android applications if you wish.


    Feel free to ask any questions, I did my best to document and catch any issues but I'd imagine I missed at least a few.
    11-13-2009 08:35 PM
  2. dkoss's Avatar
    I am trying to set up the adb shell on Ubuntu 9.1. I've successfully set up the SDK Manager and my virtual device. I also have Eclipse 3.5.1 Galileo installed but everytime I try to install the ADT for Eclipse I keep getting this error:
    "Cannot complete the install because one or more required items could not be found.
    Software being installed: Android Development Tools 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group 0.9.5.v200911191123-20404)
    Missing requirement: Android Development Tools 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group 0.9.5.v200911191123-20404) requires 'org.eclipse.wst.xml.ui 0.0.0' but it could not be found"
    I have attempted to update Eclipse but get no updates needed, tried to install the ADT manually with a .zip file but get the same error. I was just wondering if you might have any insight as to what is going wrong or if I need to go to an earlier version of Eclipse, any help would be greatly appreciated.
    12-23-2009 10:29 PM
  3. Jerry Hildenbrand's Avatar
    I had similar errors. I ended up having to apt-get remove the Deb/Ubuntu version of eclipse, and download direct from their site and extract it in my home dir.
    12-24-2009 03:00 AM
  4. dkoss's Avatar
    Yea that's what I was attempting yesterday but I couldn't get to their website eclipse.org kept taking me to a smartphone site, but I'll try it again. Just glad to hear it's not just me going insane and forgetting some small step. Thanks for your time, I'll let you know how it goes.
    12-24-2009 06:41 AM
  5. Jerry Hildenbrand's Avatar
    http://mirror.cs.rit.edu/mirrors/ecl...nux-gtk.tar.gz

    Direct link to R.I.T. http mirror of the eclipse package if the eclipse site still gives you a fit
    12-24-2009 08:05 AM
  6. dkoss's Avatar
    Thank you I will try this when I get home.
    12-24-2009 11:59 AM
  7. dkoss's Avatar
    Thanks for the link gbhil. I was able to set up the ADT finally. I just wish I would have used this post about 4 days ago (I actually saw this post a while back but thought it was only for dual boot purposes). Nice job on the layout and steps for the installation they are just about what I fought through for the past week (my wife calls it obsessive, I call it determination lol).
    12-24-2009 04:42 PM
  8. Jerry Hildenbrand's Avatar
    LOL. Youre welcome man. The important part of it all?

    You got it up and running Many moons ago, I had a professor, an old gentleman from Taiwan...He always used to say - "We aren't here to enjoy the results. We are only focused on the journey there."
    12-25-2009 01:03 AM
  9. dkoss's Avatar
    So true, I'm just glad that that their are guides such as yourself and the gentleman you quoted for those WTF moments.
    12-27-2009 10:16 PM
  10. YoungChrisG's Avatar
    gbhil I would hire you as my mentor if I had the funds to give you what you're worth! YOU DA MAN!!!! Lol!
    12-28-2009 10:49 AM
  11. Jerry Hildenbrand's Avatar
    So true, I'm just glad that that their are guides such as yourself and the gentleman you quoted for those WTF moments.
    We all have to learn. IMO there's no point in giving someone a list of commands without letting them know the whats and whys.

    gbhil I would hire you as my mentor if I had the funds to give you what you're worth! YOU DA MAN!!!! Lol!
    LOL. Hardly. I'm just here to share and learn about our gizmo's just like everyone else. Just glad i can help even in a little way.
    12-29-2009 01:24 AM
  12. YoungChrisG's Avatar
    Hey gbhill, I have a quick question about doing this. I'm about to update my desktop to Win 7 Ultimate. Will this have an affect on using your tutorial or should I stay at Win Vista?
    01-03-2010 07:27 AM
  13. Jerry Hildenbrand's Avatar
    I don't think Wubi (the windows installer for Ubuntu) will run on 7. Yet.

    Now would be a good time to back everything up and wipe that HDD. A dual boot system with a 16 gig USB stick as a shared drive is what I use, and as long as you know your hardware it's just as easy to build.
    01-03-2010 09:03 AM
  14. GivenToFly's Avatar

    7. Create a Virtual Device. Open your term and type
    Code:
    nano
    This will open a console text editor. We have to fix another bug before we can continue. In the editor that opened type:
    Code:
    sdkman.force.http=true
    then CTRL+X . It will ask you if you want to save the buffer (file). Type y for yes. It then asks for a name, type
    Code:
    ~/.android/androidtool.cfg
    then enter.
    When I get to this point, I get "Error writing, no such file or directory"
    01-03-2010 10:27 PM
  15. Jerry Hildenbrand's Avatar
    When I get to this point, I get "Error writing, no such file or directory"
    Try creating it first.

    Code:
    mkdir ~/.android
    nano should be able to do this, but that's the first thing I would try.
    01-03-2010 11:28 PM
  16. GivenToFly's Avatar
    Try creating it first.

    Code:
    mkdir ~/.android
    nano should be able to do this, but that's the first thing I would try.
    Was just gonna edit, because I figured that out, but now I got another problem. Eclipse can't find the android SDK. I tried pointing it to android-sdk-linux folder, then to every other folder in there i can find, but got nothin. The android sdk manager says "SDK Location is android-sdk-linux, but when i open that folder manually, I don't see anything there other than the originally downloaded stuff. Should I see some other things there?
    01-04-2010 12:16 AM
  17. Jerry Hildenbrand's Avatar
    Make sure you're in your home directory, and highlight the SDK folder but don't click to open it, then hit ok in the file browser window.
    You'll need to hit apply, then OK in the Eclipse window.
    01-04-2010 12:40 AM
  18. GivenToFly's Avatar
    did all that. Completely uninstalled everything that the android manager did, then re-downloaded, and did it again, and its working now. Weird. That happed to me for some other stuff I've done since i put Ubuntu on this computer. Thanks for all your help, and your super fast replies.
    01-04-2010 12:53 AM
  19. YoungChrisG's Avatar
    I don't think Wubi (the windows installer for Ubuntu) will run on 7. Yet.

    Now would be a good time to back everything up and wipe that HDD. A dual boot system with a 16 gig USB stick as a shared drive is what I use, and as long as you know your hardware it's just as easy to build.
    I'll bet you don't have any helpful how-to's on doing that up your sleeve do ya my friend?
    01-04-2010 12:59 AM
  20. Jerry Hildenbrand's Avatar
    did all that. Completely uninstalled everything that the android manager did, then re-downloaded, and did it again, and its working now. Weird. That happed to me for some other stuff I've done since i put Ubuntu on this computer. Thanks for all your help, and your super fast replies.
    Lol. Sounds about right. There's a big trade off for using Ubuntu. It makes Linux more friendly and easier to use, but 'normal' Linux packages don't always work well. I'm glad you got it working.

    I'll bet you don't have any helpful how-to's on doing that up your sleeve do ya my friend?
    1. Use some software (like Ghost) to clone your drive to a DVD. This way if you change your mind you can restore everything back the way it was.
    2. Pop a Parted live CD in GParted -- Live CD/USB/PXE/HD and wipe and repartition your HDD, leaving about 50 gigs free space for Linux.
    3. Re-install Windows, but don't touch the empty 50 gigs
    4. Either use windows to find exactly what hardware you're using and find out what it takes to make it work with Linux, or just use Ubuntu. Ubuntu will work with any hardware that supports Linux, usually right out of the box.
    5. Install Linux on the empty 50 gig partition, making sure you follow the prompts during install to have a dual boot with Windows system.
    6. Format your external storage (I use USB sticks) FAT32 in Linux, and it's readable under Linux and Windows for a nice easy shared drive.

    Numbers 1 2 and 3 give you a fun starting point
    If you decide to go with it and make it that far, holler.
    01-04-2010 05:27 PM
  21. pbrennan42's Avatar
    If you wanna do a useful How-To, hows about one on opening IMG files, altering the contents and then turning them back into IMG files?

    You can do stuff on installing perl and using scripts and how best to navigate around perl on both windows and linux...



    Phil.
    01-04-2010 05:34 PM
  22. Jerry Hildenbrand's Avatar
    LOL Phil.

    I will have to be honest - I'm not the man to ask about Windows programming or the environment. Also my Perl scripting skills aren't the best.

    I can and would be happy to write a how to for unyaffing boot images in Linux, as that i know.
    01-04-2010 06:50 PM
  23. YoungChrisG's Avatar
    Lol. Sounds about right. There's a big trade off for using Ubuntu. It makes Linux more friendly and easier to use, but 'normal' Linux packages don't always work well. I'm glad you got it working.


    1. Use some software (like Ghost) to clone your drive to a DVD. This way if you change your mind you can restore everything back the way it was.
    2. Pop a Parted live CD in GParted -- Live CD/USB/PXE/HD and wipe and repartition your HDD, leaving about 50 gigs free space for Linux.
    3. Re-install Windows, but don't touch the empty 50 gigs
    4. Either use windows to find exactly what hardware you're using and find out what it takes to make it work with Linux, or just use Ubuntu. Ubuntu will work with any hardware that supports Linux, usually right out of the box.
    5. Install Linux on the empty 50 gig partition, making sure you follow the prompts during install to have a dual boot with Windows system.
    6. Format your external storage (I use USB sticks) FAT32 in Linux, and it's readable under Linux and Windows for a nice easy shared drive.

    Numbers 1 2 and 3 give you a fun starting point
    If you decide to go with it and make it that far, holler.
    Ok I now have a dual boot Windows 7/ Ubuntu system Apparently the Wubi installer does infact work for Windows 7 in case anyone else was interested ;D The Wubi site doesn't say it but I gave it a whirl and it worked flawlessly!
    gbhil- I think I'm going to hold off on this because I'm shortly going to be taking your earlier advice and create a full Linux system using linuxfromscratch.com after receiving my Dell Inspirion in about a weeks time. I'm going to use Ubuntu for now to familiarize myself with the Linux side of life and to create the ADB Shell for Android (on the agenda for tomorrow) Thank you for all your wonderful help as I am sure I will be needing it in the future.
    Oh and one last side note for those who haven't ran Ubuntu....... It ROCKS!
    01-04-2010 06:55 PM
  24. Jerry Hildenbrand's Avatar
    Ok I now have a dual boot Windows 7/ Ubuntu system Apparently the Wubi installer does infact work for Windows 7 in case anyone else was interested ;D The Wubi site doesn't say it but I gave it a whirl and it worked flawlessly!
    gbhil- I think I'm going to hold off on this because I'm shortly going to be taking your earlier advice and create a full Linux system using linuxfromscratch.com after receiving my Dell Inspirion in about a weeks time. I'm going to use Ubuntu for now to familiarize myself with the Linux side of life and to create the ADB Shell for Android (on the agenda for tomorrow) Thank you for all your wonderful help as I am sure I will be needing it in the future.
    Oh and one last side note for those who haven't ran Ubuntu....... It ROCKS!
    Great choice IMO. Both the system (everyone has a Dell and all the info to get one to work natively in Linux is easy to find) and going with 2 computers vs dual boot.
    01-04-2010 07:07 PM
  25. pbrennan42's Avatar
    Boot / Splash Screens - Android @ MoDaCo - Paul refers to a load of Perl scripts in here...
    01-04-2010 07:19 PM
41 12
LINK TO POST COPIED TO CLIPBOARD