Hi All,
I have a USB based sensor that would draw about 300mA and would like to use 
it with my Android phone.  I have tried to play around with the API's and 
write a small application that would just list out the devices that were 
connected to the USB bus.  

A small code snippet that I am trying to use to print out the connected 
devices is:

*****
EditText lsusbText = (EditText) findViewById(R.id.lsusbTextID);
lsusbText.setText("");
Log.i(TAG, "Querying USB devices");

UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
while(deviceIterator.hasNext()){
    UsbDevice device = deviceIterator.next();
    //your code
    lsusbText.append(device.getDeviceName());
}

My manifest has:
<uses-feature android:name="android.hardware.usb.host" />
    
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>

*****

I noticed that the results are not showing any devices connected.  After 
researching a bit and poking around in the forums, it seems that only 
specific hardware devices support USB Host mode.  I have a Samsung Nexus S 
phone, and am inclined to believe that this phone does not support the USB 
host mode?  I also tried plugging in a mouse via an OTG adapter, but the 
USB mouse didn't receive power after it was plugged in.  The Android API's 
also suggest this:
"Note: Support for USB host and accessory modes are ultimately dependant on 
the device's hardware, regardless of platform level."
Is there a listing of the Android powered devices that support USB host 
mode?  Also, out of curiosity, why is there a hardware requirement for USB 
host?  Is it the specific type of USB connector that the phone has (Micro-A 
vs Micro-B)?  Is it something related to the USB Bus power?  Any 
information regarding the hardware requirements, which devices currently 
support this, etc would be great.  I also found that there is a libusb port 
to Android, which would allow access at a lower level.  However, this would 
potentially still require the hardware to support the USB host mode. 
 Additionally, I have seen things about a kernel mod required.  I'm 
guessing the kernel stuff was for older image releases, and that Android 
4.1 has this kernel mod built in.

I unfortunately found that the documentation for WiFi direct is similarly 
ambiguous in that although WiFi direct is something that is enabled and 
available for use in the API, the hardware may not support it.  However, I 
haven't found any documentation which tells developers which devices 
support/don't support the functionality.  

Thanks in advance,
Kiran

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to