Read Me

Device Requirement

Install

  1. Install Usb Host Check.apk (root needed) for checking and turning up the usb host。
  2. Install USBRFIDReader.apk. Insert IC Reader into device, and then a dialog will come out. You can click "OK" to launch the app.

Getting Started

  1. Copy package com.syc.usbrfidreader to the src of project.
  2. Import package

    import com.syc.usbrfidreader;
    
  3. Modify the file AndroidManifest.xmlAndroid Usb Host

    <manifest ...>
        <uses-feature android:name="android.hardware.usb.host" />
        <uses-sdk android:minSdkVersion="12" />
        ...
        <application>
            <activity ...>
                ...
                <intent-filter>
                    <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
                </intent-filter>
    
                <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
            android:resource="@xml/device_filter" />
            </activity>
        </application>
    

  4. Create file res/xml/device_filter.xml, VID: 0xffff(65535), PID: 0x35(53)

    <?xml version="1.0" encoding="utf-8"?>
    
    <resources>
        <usb-device vendor-id="65535" product-id="53"/>
    </resources>
    
  5. In main activity

    UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
    UsbManager manager = (UsbManager) this.getSystemService(this.USB_SERVICE);
    
  6. Initialize ICReaderApi

    ICReaderApi api = new ICReaderApi(device, manager);
    
  7. Use the function of ICReaderApi, for example

    api.API_SetSerNum(newValue, buffer);