User App Tutorial

RFID SDK for Android 2.0.2.82

Applicable Devices : FX7500 and FX9600.

Overview

This Tutorial provides a walk-through of the steps to get user app info 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

User App Info tutorial is for install, uninstall, start, stop, auto start and get current user app status.

Setting it up

The following are the steps to get the user app info details.

  • Create Reader Management Object
  • Create a LoginInfo object and Login to the Reader.
  • Perform User App api operations.

Creating a ReaderManagement object.


// create and initialize the Reader Management object.
    ReaderManagement readerManagement = new ReaderManagement(); 
                                                                                                      
                                                

Creating a LoginInfo object and perform login operation.


//Creating a LoginInfo object and perform login operation.
    LoginInfo loginInfo = new LoginInfo("hostName", "userName", "password", SECURE_MODE.HTTP, false);
    try {
            readerManagement.login(loginInfo,READER_TYPE.FX);
        } catch (InvalidUsageException e) {
            e.printStackTrace();
        } catch (OperationFailureException e) {
           e.printStackTrace();
        }

Performing operation

Install User App.


//  Install User App.
    String currentDir = new StringBuilder().append(Environment.getExternalStorageDirectory().getAbsoluteFile() + File.separator ).toString();
        try {            
                readerManagement.UserApp.install(currentDir);         
           
        } catch (OperationFailureException | InvalidUsageException e) {           

        }

Uninstall User App.


//  Uninstall User App.
    String currentDir = new StringBuilder().append(Environment.getExternalStorageDirectory().getAbsoluteFile() + File.separator ).toString();
    try {
        readerManagement.UserApp.uninstall(currentDir);

    } catch (OperationFailureException | InvalidUsageException e) {

    }

Start User App.


//  Start User App.
    String currentDir = new StringBuilder().append(Environment.getExternalStorageDirectory().getAbsoluteFile() + File.separator ).toString();
    try {
            readerManagement.UserApp.start(currentDir);

    } catch (OperationFailureException | InvalidUsageException e) {
    }
                                                

Stop User App.


//  Stop User App.
    String currentDir = new StringBuilder().append(Environment.getExternalStorageDirectory().getAbsoluteFile() + File.separator ).toString();
    try {
            readerManagement.UserApp.stop(currentDir);

    } catch (OperationFailureException | InvalidUsageException e) {
	}
                                            

Get Run Status.


//  Get Run Status.
    String currentDir = new StringBuilder().append(Environment.getExternalStorageDirectory().getAbsoluteFile() + File.separator ).toString();
        try {
                readerManagement.UserApp.getRunStatus(currentDir);

        } catch (OperationFailureException | InvalidUsageException e) {

        }                                        

Auto Start.


//  Auto Start.
    String currentDir = new StringBuilder().append(Environment.getExternalStorageDirectory().getAbsoluteFile() + File.separator ).toString();
    try {
            readerManagement.UserApp.autoStart(currentDir,true);

    } catch (OperationFailureException | InvalidUsageException e) {

    }
                                        

Closer look

  • hostName i.e. IP of the reader.
  • userName i.e. user name of the reader.
  • password i.e. password of the reader.