USB communication between Android (accessory mode) and Windows PC (host) USB communication between Android (accessory mode) and Windows PC (host) windows windows

USB communication between Android (accessory mode) and Windows PC (host)


You should have an application on the host side (Windows in your case) that will ask the Android to enter accessory mode. When it asks, you will be presented with the option to give permission or not. You have null accessory because there is no accessory connected, that has followed the AOAP to initiate a communication. So it is possible to have accessory device, that is not running Android and to communicate with it using AOAP.

You can find an example for the Android side in the samples from your android SDK, in USB folder.


Yeah, you need use WinUSB/libusb API in Windows side to do the host work, turn the Android into accessory mode, and then talk each other


The reason you got 0 accessory because you don't have accessory devices hooked to your Android USB port, you scenario is using Windows PC as the host (You may try write acustomized WinUSB driver) and the Android device is a pure USB device, it has nothing to do with AOA, when you send mode switch request from host computer (Windows or macOS), the Android device turn into accessory mode and itself is an accessory, you will find one accessory by using getAccessoryList.BTW, I got both Windows and macOS working with Android via libusb.