Hardware Reference
In-Depth Information
Chapter 4
Android ADK
Since the introduction of the Android operating system in 2007, Android has become one of the more popular
embedded Linux distributions available to consumers and hobbyist for development purposes. Google provides a vast
knowledge base to help with getting started in developing Android-specific applications; the Google documentation,
reference material, and SDK are available at http://developer.android.com .
The popularity of Android development for the hobbyist can be attributed to the ease and cost of the available
information. The draw for vendors to use Android as an operating system for many types of consumer electronics is that
Android provides a great starting point by having much of the development for an operating system completed, and by
providing the capacity for many different hardware configurations. As an operating system, Android provides a framework
for vendors to add their own unique functionality, while having a support structure and standards of compatibility for
third-party content developers. The market environment for Android mimics that of Linux—each system has variations
within its individual distributions. The differences between Android versions and the modifications by vendors have led
to a fragmentation in support for development. This became more apparent when Google announced the Accessory
Development Kit (ADK) in 2011.
The ADK was announced to provide a toolkit to developers so that third-party devices could be made to expand
the hardware functionality of systems running Android. The ADK was first released for version 3.1 and then ported
back to version 2.3.4. The fragmentation of Android devices has made it difficult to develop commercial devices that
could be supported on a majority of systems running Android. The amount of off-the-shelf device support that can
support the ADK protocols could change as more devices adopt the Ice Cream Sandwich version of Android. The ADK
is comprised of two parts: a protocol for the device and hardware for the actual accessory.
When Google released the ADK software and libraries for the operating system, it also released a hardware kit
that resembles an Arduino Mega with a shield attachment, and since then, many open source hardware developers
have made boards compatible with the original ADK device. Seeed Studio and Arduino both make an ADK board
that uses the ATMega 2560 chip. Both boards work the same and can be programmed in the Arduino development
environment. SparkFun Electronics makes an ADK-compatible board named IOIO (pronounced Yo-Yo ), but is based
on a PIC microcontroller and has a different programming environment.
At the heart of ADK methodology having a device that can act as a USB host give the impression that the Android
device is plugged into a computer to initiate communications. On the Arduino Mega ADK board, this is done by adding
an SPI-based USB host processor. The chip used in creating the host connection uses the SPI bus for data transmission
and is connected to the appropriate MOSI (master out slave in), MISO (master in slave out), SS (slave select), and
SCLK (serial clock) pins. The USB functionality also uses pin 7, making it unavailable for other uses. Arduino shields
are available to add the ADK functionality to other Arduino boards, such as the UNO and the basic Mega. Theses ADK
shields are created by third-party vendors, including SparkFun for the USB host ( www.sparkfun.com/products/9947 ).
A variety of different host shields are also available from Circuits@Home ( www.circuitsathome.com ).
Devices that use the USB host chip are not limited to working with Android; they are also capable of working
with other client devices, such as USB keyboards. But the focus in this chapter is Android-specific functionality with
the Arduino Mega ADK. Before the ADK was available, hobbyists and makers were using a method that involved the
Android Debugging Bridge (ADB) to add the functionality that is available with the ADK. The ADK can be used to add
controls for robotics, read from nonstandard sensors, and interface with machines such as the MakerBot.
 
Search WWH ::




Custom Search