5

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 via an OTG-adapter so that the tablet will work in host mode, the Arduino is successfully receiving power from the device. I'm fetching the list of available USB-devices on the tablet as follows:

sUsbController = new UsbController(this, mConnectionHandler, 0, 0);
        HashMap<String, UsbDevice> devlist = sUsbController.mUsbManager.getDeviceList();
        TextView t = ((TextView)findViewById(R.id.textView));
        t.setText("Found " + Integer.toString(devlist.size()) + " devices");

And inside the class UsbController:

mUsbManager = (UsbManager) mApplicationContext
            .getSystemService(Context.USB_SERVICE);

But unfortunately, the list remains empty, even if i start filtering using the VID and the PID (the two zeros). Any suggestions on how to fix this?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Tim Specht
  • 3,068
  • 4
  • 28
  • 46

2 Answers2

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.

Arpan
  • 613
  • 7
  • 18
0

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.

Community
  • 1
  • 1
Sudar
  • 18,954
  • 30
  • 85
  • 131
  • I followed [link](http://android.serverbox.ch/?p=549) on implementing it, so yes, it got a driver somehow. Here's the complete one: http://pastebin.com/hANbdq3U – Tim Specht Nov 09 '12 at 07:17
  • no :( i checked with a programm called "USB device info" from the market, there nothing is listed under accessible for android (tried USB stick, keyboard and Arduino) but under "Linux" (so accessed via the file-system) they are visible... – Tim Specht Nov 09 '12 at 07:30