You are viewing an older revision! See the latest version
mbed with Android ADK
mbed with Android ADK¶
Introduction¶
With the growth of android as the mobile OS of choice for many producers, Google recently released a accessory development library/kit (ADK) for developing hardware addons for devices. Although these libraries only work on version 2.3.4 or 3.1 or later, the ADK provides a robust USB serial link from platform to app. This cookbook page is about integrating it with mbed, and how to create apps with it.
The mbed side¶
The mbed side is relatively simple, using the USBHost libraries and the AndroidAccessory bolt on, it allows simple commands for sending and receiving data quickly. The skeleton program here acts as a simple serial terminal for the computer, allowing you to type in strings then send them with enter:
The android side¶
The android side is quite a headache if one is new to android, and the documentation on Accessories fairly sparse, however an abstraction library has been written to help stop all of the usual problems. This simplifies using the ADK to a few lines:
As well as adding to the onCreate() and whatever read/write mechanisms employed, one also needs to add some lines to the Manifest XML file as described: