我试图创建一个可以检测到USB设备的应用程序。安卓设备的行为就像一个主机,我现在只需要读取连接设备的数据即可。
我导入android.hardware.usb.UsbDevice
一切正常,但任何usbDevice方法都存在问题。我可以阅读usbDevice.getDeviceName()方法,但不能使用例如getVersion(),为什么?
他说我不能解决这种方法。也关于其他方法。
private String readDevice(UsbDevice device) {
StringBuilder sb = new StringBuilder();
String a = device.getDeviceName(); //work
String b = device.getVersion(); //doesn't work
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句