HowTo: Develop for Android on Jaunty Jackalope/Karmic
Titanium Android development on Ubuntu 9.04/9.10 aka Jaunty Jackalope/Karmic works out of the box if you use the emulator. This guide walks you through the configuration steps necessary to develop with a device.
Configuration
The test environment was Ubuntu 9.04 Desktop (Jaunty Jackalope) running in a VMWare Fusion VM. Patches and the following packages were installed.
Packages
sudo apt-get install build-essential
sudo apt-get install curl sun-java6-jdk
sudo apt-get install vim vim-gnome
Android Development Tools
Download the Android 1.5 r2 SDK for Linux from the download page at http://developer.android.com and copy it to /opt, extract the SDK, and fix up permissions.
cd /opt
sudo unzip android-sdk-linux_x86-1.5_r2.zip
sudo chmod -R 755 android-sdk-linux_x86-1.5_r2
To make it simpler to update to a newer SDK, create a sym-link to the SDK directory.
sudo ln /opt/android-sdk-linux_x86-1.5_r2 android-sdk
Titanium for Android requires the 1.5 SDK so add the following entries to your .profile to simplify accessing the Android development utilities from the command line.
# set PATH to include android sdk
PATH=”/opt/android-sdk/tools:/opt/android-sdk/platforms/android-1.5/tools:$PATH”
export PATH
Recognizing the Phone
If you haven't already configured your phone for development, consult the Android documentation for developing on a device. With your device connected to your development machine via USB, try to enumerate the devices. Unless a patch has been made to the main distribution, adb will fail to enumerate the attached device even though lsusb sees the USB device.
Enumerate Devices
The following command will return and empty device list.
adb devices
Using lsusb you should see something similar to the output below. The phone appears as High Tech Computer Corp.
user@ubuntu:~$ lsusb
Bus 001 Device 003: ID 0bb4:0c02 High Tech Computer Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Searching for solutions returned numerous entries that suggested making modifications in the udev system which did not solve the problem on the test system. However, this article, udev, hal, policykit and devicekit with Android Dev Phone 1 by Jason D. Clinton provided a solution. Note: His solution works for Jaunty, but indicates that it will fail in the future and promises to update the article with the new configuration.
For Ubuntu 9.04 follow these steps, skip to the next section for 9.10
Using the configuration below, create the file /etc/hal/fdi/policy/android.fdi and enter the data from Jason’s article.
sudo vim /etc/hal/fdi/policy/android.fdi
Contents:
<match key="usb_device.vendor_id" int="0x0bb4">
<match key="usb_device.product_id" int_outof="0x0c01;0x0c02">
<merge key="pda.platform" type="string">android</merge>
<append key="info.capabilities" type="strlist">access_control</append>
<merge key="access_control.file" type="copy_property">linux.device_file</merge>
<merge key="access_control.type" type="string">pda</merge>
</match>
</match>
To complete the configuration, you need to edit permissions using polkit-gnome-authorization. Browse to org.freedesktop.hal.device-access "Directly access PDA devices" and set Console and Active Console to Yes. Save the settings and adb should correctly enumerate the attached device.
polkit-gnome-authorization&

Adding a device in 9.10
sudo vim /etc/udev/rules.d/51-android.rules
Now insert this into the new file (note the 0bb4 is the vendor id for an HTC phone, you can use 22b8 for the Droid):
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Now make the file executable:
sudo chmod a+r /etc/udev/rules.d/51-android.rules
You can find other device id's here.
Developing With Titanium
At this point, your Jaunty install is ready for Android, all that is left is downloading and installing Titanium and gaining entry into the closed beta.
If you haven’t already applied and received your notification email, fill in and submit the Request Titanium Mobile form. While you are waiting on acceptance, go ahead and download and install Titanium for Desktop. Once you’re approved, Titanium Developer will notify you that the mobile SDK is available for download.
Titanium Mobile Dev Center