In the opening day Google I/O Keynote, Android announced numerous cool new products. I had the pleasure of introducing our new Movie Rental Service for Android Market, and we also talked about our new Music Beta service as well as the Accessory Development Kit for the first time. Combining devices with cloud services is a Chocolate & Peanut Butter experience – each benefits from the other to create a whole larger than the sum of their parts, so I wanted to try out the ADK and do a project that captures this. My buddy Joe hooked me up with an ADK board a week before I/O so I could play around with the ADK and I did a project that combines the coolness of devices and hardware with the awesome new Music Beta service.
First a little background on the ADK. The board that Google was handing out at I/O is based on Arduino and has a built-in [email protected] USB Host shield. The details can be found at the Android Open Accessory page at the Android Developer portal. A library is provided for the Arduino board that allows you to identify your device and very easily detect when an Android Device is connected to it and transfer data.
I already had a box of Sure Electronics LED matrices left over from Maker Faire last year. That plus some ShiftBrite RGB LEDs and the judicious application of a laser beam to build an acrylic enclosure was sufficient to get the basic sign up and running. It sported a two-line display (64×8 pixels each) driven by my LED Matrix Library and a Music Beta by Google logo backlit through a diffuser panel by 6 ShiftBrites.
Then I linked to the Android ADK library and it was literally just a few lines of code to detect a device connection and read some data. The other very cool feature of Android Open Accessory is you can provide a URL in your device description metadata. When a user plugs in their Android Phone, if there isn’t a compatible application for your device the user can follow the link to download the supporting application directly from Android Market. In my case, I needed a simple service application that listened to the Intents the Music App sends when it changes track metadata. Then, the app writes the metadata to the Arduino board. So the end-user experience is seamless – anyone can walk up to the sign and plug in their phone and be up and running in a few seconds.
Once I’ve decompressed from I/O a bit, I’ll publish the source code and CAD files so others can put one of these together. For now here’s a video of the Music Beta Now Playing accessory in action. The fun spectrum analyzer animation is just for effect – it’s not actually analyzing the audio, but maybe some clever person can make that part more real.