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.
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
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:
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.
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:
Save the file as ~/eclipse/start.sh.
In your term:
Then anytime you want to start eclipse type:
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
This will open a console text editor. We have to fix another bug before we can continue. In the editor that opened type:
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
then enter.
Now we need to move to the android/tools dir and start the adv manager.
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
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.
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.
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
Code:
uname -a
Code:
cd ~
ls -l
Code:
GDK_NATIVE_WINDOWS=true $HOME/eclipse/eclipse
In your term:
Code:
cd ~/eclipse
chmod +x start.sh
Code:
cd ~/eclipse
./start.sh
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
Code:
sdkman.force.http=true
Code:
~/.android/androidtool.cfg
Now we need to move to the android/tools dir and start the adv manager.
Code:
cd ~/android-sdk-linux/tools
./android
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
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/
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.