Creating Project using Android Studio

RFID SDK For Android 2.0.2.82

Overview

This tutorial will aid you creating a new Android application project using Android Studio.

Creating The Project

Open Android Studio. If you have a previous project open, close the project by clicking Close Project from the File menu.

  1. Select Start a new Android Studio project under Quick Start section.

    img

  2. In the new project wizard we need to assign Application Name specific to your tutorial of RFID feature along with Company Domain and click "Next".

    img

  3. Select the Minimum SDK that supports the SDK features your project requires and click Next.

    img

  4. Select Blank Activity option on Add an activity to Mobile screen and click Next.

    img

  5. Click Finish and your new Android Studio project will be created.

    img

Enable the RFID SDK in project

Importing RFID SDK as Module

After completing the steps in Creating The Project

  1. Unzip *.aar from Zebra_RFIDAPI3_SDK package to folder named RFIDAPI3Library outside of the project directory
  2. Create build.gradle in RFIDAPI3Library folder with following content and rename *.aar to 'API3_LIB-release.aar'
  3. 
    configurations.maybeCreate("default")
    artifacts.add("default", file('API3_LIB-release.aar'))
    
  4. Select New Import Module from the File menu.
  5. img

  6. Browse path to folder RFIDAPI3Library
  7. img

  8. Now click the Finish button.
  9. Once RFID SDK Module RFIDAPI3Library imported successfully, project will look like following
  10. img

Your project is now ready with RFID SDK for Android Module

RFID3 API Library as a dependency in gradle.build

After completing the steps in Importing module

  1. Select Project Structure from the File menu.
  2. In the Project Structure window select app from the left pane under Modules.
  3. Select Dependencies on the right pane and select Module dependency
  4. img

  5. In Choose Modules add RFIDAPI3Library as the dependencies. Press OK to finish and close all dialogue boxes

    img

  6. In Project window left hand side, expan gradle list and open build.gralde (Module.app) to confirm

    img

  7. 
        implementation project(':RFIDAPI3Library')
    

Import RFID3 API package

After completing the steps in Adding dependency in gradle.build

  1. Open MainActivity.java in editor
  2. Add import com.zebra.rfid.api3 in MainActivity.java
  3. 
    import com.zebra.rfid.api3.*;
    

Your project is now ready to use the RFID SDK for Android