How to get list of USB accessories connected to android device?
<p>I have a Lollipop based android box. The box has a USB port similarly to micro USB port in Android phones. I want to check if any host is connected to the USB port with the android box in device mode similarly to when a phone is connected to a PC. At the minimum, I just need to check if something is connected to this USB port and at best get some info(manufacturer, model, serial) of the host connected. I don't need any data communication.</p>

<p>I have tried </p>

<pre><code>UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
manager.getAccessoryList();
</code></pre>

<p>but it turns up empty even though I have connected my laptop to it and adb and file transfers are working.</p>

<p>Although on further reading it seems android USB accessories API is limited to special android accessories only.</p>