0

I am trying to get my tablet(XOOM) work with my usb device.

However, as I created a test program based on the adbtest sample code [here]http://developer.android.com/resources/samples/USB/AdbTest/index.html and tested it, it could find the connected usb device if I do this: for (UsbDevice device : mManager.getDeviceList().values()) , but it could not open the device.

Another really weird thing is that as a broadcast receiver was created as shown in the adbtest code, the detach and attach action should both be detectable, but only detach action could be detected. Whenever I removed the usb device from the tablet, the detach event could be trigger, but attach event is never trigger. How come this happens? (In the filter.xml file, I just specified the correct vendor Id to filter out the unwanted devices).

Apart from that, if I plugged a mass storage usb device into the tablet, or detached the storage device from the tablet, or do this for (UsbDevice device : mManager.getDeviceList().values()) to find the existing devices, nothing happened.

Any guy knows the reason for this? Thanks!!

ProgramFOX
  • 6,131
  • 11
  • 45
  • 51
dan
  • 239
  • 3
  • 4
  • 10

1 Answers1

0

(This post is related to the previous question.)

Sorry without any code I can't help you. Although I wrote a whole page for you, I still got no reputation points. With my rep of 1 I can't even write a comment. Please consider marking my answer on your previous question as a correct answer. Keep in mind, that stackoverflow is not a discussion forum. So what we are doing here is not good.

Please clarify what you mean with

but it could not open the device

and provide some code.

For the attach action a search would have helped: this might be an answer

I guess that USB mass storage devices are not transparent to the android USB API because they are mounted by the underlying linux OS and you only get access to it via the file system. So the device might stay invisible while iterating over available devices.

I'm sorry for posting this as an answer, it would be a comment if it were possible.

Community
  • 1
  • 1
Alexander
  • 1,068
  • 6
  • 22
  • Hi, Alexander, I tried to vote your comment twice, but I could not because I had only 11 reputation. I need 4 more to vote you for sure! – dan May 06 '12 at 02:55