Dear All;
I got an HID USB device , I build for it a windows application using c# then it was connected successfully after adding its VendorID and ProductID, the Device of Class=03,subClass=01,Portocol=0;
after I try to build an Application on Android and try connecting it , it was detected on the Mobile but in my application it was not detected, But I have tried other device of Class=02 and Class=01 they was detected ,
So I searched and I have found that Class03 was used as Android USB constant so it will be blacklisted , so I asked the manufacture to change the Firmware to class=01 and after they have done it , also still not working .
there is a sample of my application code :
if (myUsbManager == null)
return;
HashMap<String, UsbDevice> deviceList = myUsbManager.getDeviceList();
if (!deviceList.isEmpty()) {
StringBuffer sb = new StringBuffer();
for (UsbDevice device : deviceList.values()) {
sb.append(device.toString());
sb.append("\n");
edtText.setText(sb);
mLog("DeviceInfo: " + device.getVendorId() + " , "
+ device.getProductId());
if (device.getVendorId() == VendorID
&& device.getProductId() == ProductID) {
myUsbDevice = device;
mLog("USB DEVICE SAME VENDOR ID");
}
}
}
So I was in doubt if my code have an issue or this device in not compatible , but why it was read on the c# application but not on Android application . or is there anymore settings I have to add in my apk
Note that I have tried my apk to connect to Smartcard reader , USB Host , bluetooth devices , and many other devices and all was of class=01 and class=2 and was being read .