Posts Tagged linux
Configuring an Android development platform on Ubuntu 9.04
Posted by visual77 in programming on December 30, 2009
Since I thoroughly dig Linux for all things development, I’m going to use a Virtual Machine running Ubuntu 9.04 to work on my Droid app, remind@home. I’ll later keep track of the project in a Subversion repository. I still don’t know where I will host my repository, but the short list is likely to be either Sourceforge or Google Code.
I’m using the directions on the Android Developer page to configure my SDK using Eclipse as the Java IDE. Here are the steps I had to follow to set up Ubuntu 9.04 as an Android development platform:
- Install Java 6 JDK by typing ‘sudo apt-get install sun-java6-jdk‘ on the command line.
- Install the Eclipse IDE. I initially tried this with apt to install the version of Eclipse from the repository, but this is version 3.2 (as of 2009-12-30) and the ADT recommends version 3.4 or newer. Later on in the configuration process, I had some difficulty installing ADT and ended up installing Eclipse 3.5 from source. Here’s how:
- Download the latest version of Eclipse classic (3.5.1 as of 2009-12-30) from the Eclipse download page.
- Extract the folder into your home directory. This does not appear to need compilation or any such fun stuff.
- Open the eclipe folder and run eclipse.
- Install the Android Development Tools (ADT) for Eclipse. Open Eclipse and go to Help -> Install New Software. Inside the dialog, click ‘Add’ and add the following:
ADT : https://dl-ssl.google.com/android/eclipse/
Check the box net to ‘Developer Tools’ and hit next. Follow the series of dialog boxes to install ADT. Restart Eclipse when done. - Download the Android SDK for Linux from the Android developer page. Extract the folder into your home directory.
- Open Eclipse and configure the Android SDK’s location within Eclipse. Go to Window -> Preferences. Select the Android menu on the left and click Browse to choose the SDK location. Navigate to the /home/<user>/android-sdk-linux_86/ folder and hit OK. Hit OK to close the Preferences dialog.
- Install the Android platforms that you want to develop applications on. Go to Window -> Android SDK and AVD Manager. Click Available Packages on the left and choose which packages you want to install. Since this is my first app and I’m not concerned about it being usable on anything other than my Motorola Droid, I only chose Android 2.0 and Android 2.0.1. In the future, I can install more SDKs to ensure my software works through multiple devices. Click ‘Install Selected’ when done to install the desired SDKs.
- Create an Android Virtual Device (AVD) to begin work on. While still in the Android SDK and AVD Manager you opened in step 5, click ‘Virtual Devices’ on the left and click ‘New’. Name your device and choose your SDK. I named my device ‘motorola-droid’ and chose Android 2.0.1 and left all other settings the same and clicked ‘Create AVD’.
- From here, all that is left to do is start writing your app. I followed the Hello World tutorial available on the Android developer site. If you followed the directions for configuring Eclipse 3.5 on Ubuntu 9.04 with the Android Development Tools, you should have no problem compiling and running this app. However, The directions say it should be as easy as going to Run -> Run to launch the program, but I had some errors came up when I tried that method. Instead, go to the projects window on the left side and right click your project name ‘HelloAndroid’ and go to Run As -> Android Application to launch the program. It appears that the Run menu contains configuration settings to add a new configuration type (going to Run -> Run Configurations pulls up this menu) but I have yet to figure out how to add Android Application to that menu.
Now that I have a working development environment, I can get started on my remind@home application. I will continue to blog as that project moves forward.