# Android AOA 2.0 Help



## dcplaya (Jun 9, 2011)

Has anyone messed around with the Android AOA 2.0 yet? I want to send HID signals to Android (play, pause, skip track, volume) using an Arduino but the AOA page doesn't give much information. An example of how to send a skip track signal to Android would be the most helpful thing in the world to me.

Also, if someone can suggest a way to do audio out via USB to L/R analog RCA jacks for Android that would get my little project a huge leap forward!

The AOA 2.0 page http://developer.android.com/tools/adk/aoa2.html#detecting


----------



## skylinedreamer (Sep 4, 2014)

I guess you would have already found your answer. Anyways here it goes. 

Look into:

AOA 2.0 HID and Android Key Mapping (Look at HID Consumer Page (0x0c) section)

Steps to activate HID Class:


Check AOA Version Number (Proceed only if its Version 2) [ACCESSORY_GET_PROTOCOL]
Register HID Device with Device ID and size of Report Descriptor [ACCESSORY_REGISTER_HID]
Send HID Report Descriptor [ACCESSORY_SET_HID_REPORT_DESC]
Send HID Command [ACCESSORY_SEND_HID_EVENT]

A Sample HID Consumer Report Descriptor:

0x05, 0x0c, // Usage Page (Consumer Devices)
0x09, 0x01, // Usage (Consumer Control)
0xa1, 0x01, // Collection (Application)
0x19, 0x00, // Usage Minimum (0),
0x2A, 0x3C, 0x02, // Usage Maximum (0x23C),
0x15, 0x00, // Logical Minimum (0)
0x26, 0x3C, 0x02, // Logical Maximum (0x23C)
0x75, 0x10, // Report Size (10)
0x95, 0x01, // Report Count (1)
0x81, 0x00, // Input (Data,Array,Absolute)
0xC0 // End Collection

Ex: If you want to send a "Play/Pause" command, send "0x00cd" as a Control Request as follows:

/* Control request for sending HID events.
*
* requestType: USB_DIR_OUT | USB_TYPE_VENDOR
* request: ACCESSORY_SEND_HID_EVENT
* value: Accessory assigned ID for the HID device
* index: 0
* data the HID report for the event
*/
#define ACCESSORY_SEND_HID_EVENT 57


----------



## lowfiend (Jan 14, 2015)

Dear :

I have a question.

If I want to send

0x07 0x000a Keyboard g and G 0x0022 KEY_G 1.6 0x0023 KEYCODE_G

1

What can I do?

address : https://source.android.com/devices/input/keyboard-devices.html


----------

