Skip to content Skip to sidebar Skip to footer

Getdevicelist() Always Empty

I'm trying to use an Arduino Board along with my Odys Neo x8 tablet but it seems, that the UsbManager doesn't recognize the device alright. I connected the arduino to the tablet vi

Solution 1:

I have used the following code which works very fine with keyboard, mouse and Mass Storage device to connect with Pandaboard,

  UsbManager usbManager = (UsbManager) getSystemService(USB_SERVICE);
  HashMap<String, UsbDevice> devicelist = usbManager.getDeviceList();
  Iterator<UsbDevice> deviceIterator = devicelist.values().iterator();

  while(deviceIterator.hasNext()) {
    UsbDevice usbDevice = deviceIterator.next();
    Log.i(Log_Tag, "Model     : " +usbDevice.getDeviceName());
    Log.i(Log_Tag, "Id        : " +usbDevice.getDeviceId());
  }

This should work with Arduino too.

Solution 2:

The Arduino board needs a driver which needs to be installed before it can be accessed.

I am not sure if you have a port of the driver for Android.

Edit:

Also check out this answer in another thread.

Post a Comment for "Getdevicelist() Always Empty"