【问题标题】:Error in android program安卓程序出错
【发布时间】:2013-07-12 23:25:18
【问题描述】:

我正在使用 android 4.2.2,即 API 17,但调用需要 API 级别 12(当前最小值为 8):android.hardware.usb.UsbManager#openDevice

public List<UsbSerialDriver> probe(final UsbManager manager, final UsbDevice usbDevice) 
    {
        if (!testIfSupported(usbDevice, FtdiSerialDriver.getSupportedDevices())) 
        {
            return Collections.emptyList();
        }
        final UsbDeviceConnection connection = ***manager.openDevice(usbDevice)***;
        if (connection == null) 
        {
            return Collections.emptyList();
        }
        final UsbSerialDriver driver = new FtdiSerialDriver(usbDevice, connection);
        return Collections.singletonList(driver);
    }

【问题讨论】:

标签: android performance android-layout android-intent android-emulator


【解决方案1】:

here所述:

public UsbDeviceConnection openDevice(UsbDevice 设备)

在 API 级别 12 中添加 打开设备,以便用于发送和 *使用 UsbRequest 接收数据。*

参数 device 要打开的设备 返回 UsbDeviceConnection,或 如果打开失败则返回 null

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多