When implementing an audio accessory such as a headset, headphone amplifier, microphone, DAC/ADC, or dock, consider how the accessory connects to Android devices. The following sections describe wired 3.5 mm headset connections, Universal Serial Bus (USB) connections, and Bluetooth connections for streaming music or other audio content.
Audio over 3.5 mm headset connector
Many Android devices include a 3.5 mm (“mini”) headset connector. In addition to traditional stereo output and mono input features, the 3.5 mm headset specification defines standard impedances and functions that enable interoperability between a range of Android devices and headsets.
Audio over USB
Android can use USB in several modes:
- Development. Does not support audio.
- Accessory. Provided by Android Open Accessory (AOA) 2.0 and provides limited audio capability, as described in Connecting custom audio over USB.
- Host. Enables the Android device to drive the USB bus and operate with a wide range of USB-based peripherals, including audio interfaces. Devices that implement host mode will be compatible with USB headsets that follow the USB headset specification. Host mode audio is described in USB digital audio.
Audio over Bluetooth
An accessory that connects with Android over Bluetooth can use an Advanced Audio Distribution Profile (A2DP) connection to stream music for playback. Playing audio over Bluetooth with A2DP is supported on Android 1.5 (API Level 3) and higher. An Android user can connect to an accessory that supports this profile using the system Settings > Bluetooth and play music directly to the accessory without a secondary application.
As of Android 3.0 (API Level 11), applications can operate an A2DP connection
using the
BluetoothA2dp
class. To provide a custom application for
output to an audio accessory, you must use Android 3.0 or higher.
Next steps
To get started building an audio accessory that uses a Bluetooth connection:
- Select a hardware platform or build a hardware device that can support Bluetooth communications and the A2DP connection profile.
- Review the ADK 2012
firmware
source code (
<adk-src>/adk2012/board/library/ADK2/
), which includes an example implementation of an audio playback accessory using a Bluetooth connection.
Note: The ADK 2012 source code includes an open source Bluetooth stack built for the Texas Instruments CC2564 chip, but is designed to work with any Bluetooth chip that implements a standard Host/Controller Interface (HCI).
MIDI over USB and Bluetooth LE
Both USB and Bluetooth Low Energy can be used as transports for the MIDI protocol. For details, see MIDI.