RFID SDK for Android Programming Practices

RFID SDK for Android 2.0.2.124

Overview

This guide provides a details about general programming practices to work with RFID3 API

SDK concurrency guidelines

Use synchronization method to cover connection, configuration, and disconnection blocks.

  • Connection related APIs
  • 
    synchronized (lock) { 
        readers.GetAvailableRFIDReaderList(); 
        reader.Connect(); 
        // Code related to configuration and initial setup after connection 
        ConfigureRfidReader(); 
    }
    

    Incase of Fixed readers

    
        synchronized (lock) { 
        reader.Connect(); 
        // Code related to configuration and initial setup after connection 
        ConfigureRfidReader(); 
    }
    
  • Disconnection related APIs
  • 
    synchronized (lock) { 
        reader.disconnect(); 
        readers.Dispose(); 
    }                                                    
                                                        

Calling from Main UI Thread

The following APIs must be called from background thread

  • GetAvailableRFIDReaderList - Not applicable incase of Fixed readers
  • connect
  • disconnect
  • Dispose