Skip to content

An update of benlypan's UsbHid project last modified in 2017. Builds with up-to-date Gradle/SDK etc as at December 2024

License

Notifications You must be signed in to change notification settings

tim-littlefair/UsbHid

 
 

Repository files navigation

UsbHid

The custom USB HID host library for Android. It supports SDK Version above than or equals to 12

Usage

compile "com.benlypan:UsbHid:0.1.0"

QuickStart

UsbHidDevice device = UsbHidDevice.factory(context, vid, pid);
device.open(this, new OnUsbHidDeviceListener() {
    @Override
    public void onUsbHidDeviceConnected(UsbHidDevice device) {
        byte[] sendBuffer = new byte[64];
        sendBuffer[0] = 0x01;
        device.write(sendBuffer);
        byte[] readBuffer = device.read(64);
    }

    @Override
    public void onUsbHidDeviceConnectFailed(UsbHidDevice device) {

    }
});

For detail, please read the source code.

License

MIT

About

An update of benlypan's UsbHid project last modified in 2017. Builds with up-to-date Gradle/SDK etc as at December 2024

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%