I want to get list of all connected hosts to my android usb device.
UsbManager manager = (UsbManager)parent.getSystemService(Context.USB_SERVICE);
UsbAccessory[] accessoryList = manager.getAccessoryList();
if(accessoryList == null){
Log.w(TAG, "AccessoryList is null");
}
This is returning null to LogCat.
Also in BroadcastReceiver,
UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
is also returning null.
My PC is connected to android and on running the application, the app is asking for Permission to connect to USB host.
What is wrong? Please help me out.