One of the most popular demos at this year's Google I/O conference was an Android-powered labyrinth game (see Figure 1). Using a Motorola Xoom Android tablet, players attempted to navigate a huge, hole-ridden maze using a bowling-sized ball. It wasn't easy -- making minute corrections using the Xoom's gyroscope -- but a few talented attendees made it through unscathed.
|Figure 1. Google I/O Labyrinth: A popular Android-powered game using a Motorola Xoom.|
The labyrinth game showcased one of the exciting new developer opportunities on the Android platform: the Android Open Accessory Development Kit (ADK). Compatible with Android 3.1 and 2.3.4 devices, the ADK provides developers with a simple, highly supported means of interacting with external USB hardware through a special new accessory mode.
The ADK is compatible with devices running Android 2.3.4 and higher. Not all devices support the accessory mode, though. If your application uses or requires Android Open Accessories, you should specify this requirement in your application manifest file using the uses-feature tag, like this:
<uses-feature android:name="android.hardware.usb.accessory" />
Compatible USB accessories, called Android USB accessories, must meet strict hardware requirements in order to operate correctly. As a developer, you can create different types of USB accessories using development board kits.
|Figure 2. PhoneDrone Board for Android: The PhoneDrone board is built around an Arduino controller.|
Board Kits Available in the ADK
Several companies are already producing Android Open Accessory-compatible development board kits for a variety of purposes, including RT Corp, Microchip, DIY Drones, and Modern Device. Most of these kits are Arduino-based, although PIC is used in at least one case. Android USB accessories must be capable of initiating connections with the Android device. The accessory actually acts as the host, overcoming any limitations existing on legacy Android devices, and conveniently powers the Android device as well.
|Figure 3. PIC24F-based Board from Microchip: Microchip makes a PIC24F-based board compatible with the ADK.|
While this may seem to flip the USB host-to-device relationship on its head, the end result actually makes a lot of sense for many accessories. For instance, imagine plugging your tablet into your car. Your car has power, so it might as well be the one doing the charging and being the USB host. The same goes for something like a treadmill. One could even imagine a bicycle accessory that feeds data to an Android app and is attached to a dynamo on the bike for generating power as you ride!
Not all the boards discussed here are available immediately. This list is sure to expand as developers explore the capabilities of the accessory development kit.
- If you're into radio-controlled devices, you'll like the PhoneDrone board for Android, which is built around an Arduino controller (see Figure 2). Made by DIY Drones, this board retails for around $100 USD, but is not currently available.
- Microchip makes a PIC24F-based board compatible with the ADK (see Figure 3). It's expected to be available in August for a price of around $80 USD.
- Modern Devices makes a board called the Freeduino USB Host Board. It has a preorder cost of about $65 USD and seems to be generally available with a couple of weeks of order time. These are virtually the same as the boards handed out at the Google I/O 2011 conference to a few lucky developers.
- RT Corp also makes a board, which is similar -- if not identical -- to the boards handed out at Google I/O 2011. Priced at ~$390, these are the most expensive and are also Arduino compatible.