Chocolate & Peanut Butter

chocolatepbIn 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 Circuits@Home 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.

nowplaying-sign

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.

 

7 comments

  1. Nicely done.

    Looking forward to seeing more details of the build.

  2. Wicked cool! Great idea and execution.

  3. Very nice, and very fast :-) i was thinking on making something like this, only my board isn’t even in yet..

    Great work.

  4. Hello,

    I am actually working on an ADK based connection to my car, but i am not getting the code right for my project to work, It would be cool if you could help me out a little, i just need to know how to build a programm that sends and receives only a few bytes, but i cant get the communication to work. If you could just give me a kick in the right direction, i would be very thankful.

    Greetings
    Tim

  5. any chance you can put the arduino code up

  6. Hi, nice work!

    Any chance you can post source code??

    Thanks!

  7. Any word on code being released? I’m trying to get metadata from the music app and can’t find any documentation on what intent / intents to use.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>