Reader Appeared/Disappeared

RFID SDK for Android 2.0.3.148

Applicable Devices : Handheld readers

Overview

This Tutorial provides a walk-through of the steps to perform Pre-Filter configuration using RFID3 API

Create The Project

  • Start by creating a new project in Android Studio. For help, see the Android Studio tutorial.
  • Refer Hello RFID to prepare basic setup to work with RFID Reader and then follow this guide

Details

Transport connections and disconnections needs to be handled under following call back functions


    void RFIDReaderAppeared(ReaderDevice device);
    void RFIDReaderDisappeared(ReaderDevice device);

To attach and detach event handlers


    readers.attach(rfidReaderEventHandler);
    readers.deattach(rfidReaderEventHandler);            

Defining and Handling callback handlers


    @Override
    public void RFIDReaderAppeared(ReaderDevice readerDevice) {
        // Initiate connection
    }
    
    @Override
    public void RFIDReaderDisappeared(ReaderDevice readerDevice) {
        //disconnect and dispose  
    }      

NOTE: readerDevice param in the callback function will not be the same readerdevice context that was used by the app to initiate connection. User needs to use the information in the reader device to get the actual readerDevice context in the app and then use that for disconnection.