Tuesday, October 11, 2011

Getting an Android device to work with the ADK

One of the neat features of the ADK (Android Open Accessory) is that it doesn't require the phone to act as a USB host. When you connect a USB device, one device is the host (generally the computer) to which multiple devices can be connected. While some newer Android devices can act as a host (so you can plug in external hard disks, etc) , many older ones cannot.

With the Open Accessory protocol, the device you plug in (i.e. the arduino device) acts as the host so your phone does not need to be. Despite this, the phone can still act as the "master" and give commands to the device.

For the GDD open call, they stated that you need to have access to either the Nexus S, Nexus 1, or Xoom. Now I don't have any of these phones, but I searched a bit and saw that the latest Cyanogen mod ROMs with Android version 2.3.4 mod support Open Accesory devices. I had already rooted my phone (an LG GT540) and was running a port of Cyanogen mod.

Needless to say, once I received my Open Accessory development kit in the mail, I tried connecting it to my phone. Nothing happened. After performing many google searches and coming up with very little, I posted a question on some forums and on Stack Overflow. The answer I got there was that having the 2.3.4 Android is not enough, you also need a later kernel version (at least 2.6.35). I hadn't really realised until this point that the linux kernel version and the Android version were not necessarily related, in that while particular "official" Android releases were designed for a particular kernel, the ROMs that people produced were often made to run on earlier kernel versions.

So at this point, I needed to wait until someone ported 2.6.35 to my phone. I toyed with the idea of downloading some half-finished ports and trying to get one to compile, but realised I don't have that sort of time / energy available now. So I decided instead to get a device that is known to work.

The phones (Nexus S or Nexus One) were not that cheap and even second hand ones were at least a few hundred dollars on ebay. Eventually I saw that the Acer Iconia A500 tablet was on sale at Harvey Norman and Officeworks for $386 so I eventually bought one. I didn't really need another phone, I liked the idea of trying out a tablet, and hoped (still hope) that after the GDD, I should be able to sell the tablet second hand for only a small loss.

Anyway, to finish the story - the Iconia A500 is a great tablet, very fast and a beautiful screen. I can't really say that I need a tablet, I prefer taking my old netbook on the bus to work for emailing for the keyboard. The kids love it though, it is a good size for angry birds and good for taking photos. The tablet came with Android 3.1, and didn't work out of the box with the ADK. However, after rooting the device and installing a 3.2 ROM (a few days later the official upgrade came anyway), the device worked!

No comments:

Post a Comment