Skip to content Skip to sidebar Skip to footer

Usb Communication Between Android (accessory Mode) And Windows Pc (host)

I try to make an USB connection between my notebook (win7) and my android phone (Android 4.2). The notebook should act as host to power the android phone. The goal is that notebook

Solution 1:

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.

Solution 2:

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

Solution 3:

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 a customized 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.

Solution 4:

Ok, I guess I found the answer myself. The Android USB accessory mode is only possible between an android phone and another device that is running Android (such as Arduino). So this is not possible with this setting.

Post a Comment for "Usb Communication Between Android (accessory Mode) And Windows Pc (host)"