Android SDK Initial Integration Guide

Use this guide to integrate the UR Code Scan+Match Android SDK into Your App.

Other Device SDKs Integration Guides:


Prerequisite

Download and Install Android Studio.

Create a New App in Android Studio

  1. Open Android Studio. Go to File → New Project → Empty Views Activity. Choose a name for Your App's project and select Java as the language.

Link the FaceTec Android UR Code Scan+Match SDK to Your New App

  1. Download and extract the FaceTec Android URScanMatchSDK. Copy facetec-ur-scan-match-sdk-#####.aar from the FaceTec Android UR Scan+Match SDK to the root of Your App's folder.
  2. Open build.gradle (Module) in both the Sample App and Your App. Copy the implementations from the Sample App to Your App:
    implementation 'com.facetec.urcodes:facetec-ur-scan-match-sdk:<FACETEC_SDK_VERSION>@aar'
  3. In Your App, open settings.gradle and add facetec-sdk-#####.aar as a dependency:
    • Add flatDir{ dirs '.' } to dependencyResolutionManagement{repositories{ }}.
    • Click "sync now".
  4. On success, Your App will build with no errors.

Import Default Config and Run

  1. Open the FaceTec UR Scan+Match Sample App and copy the config.java file over to Your App. Remove anything that causes a compile error.
  2. In your MainActivity.java, add FaceTecURScanMatchSDKInstance and urScanMatchSDKInstance.
  3. In your MainActivity.java’s onCreate, add the following:
    FaceTecURScanMatchSDK.initialize(this, Config.LICENSE_TEXT, new FaceTecURScanMatchSDK.InitializeCallback() {
          @Override
          public void onSuccess(FaceTecURScanMatchSDKInstance sdkInstance) {
            urScanMatchSDKInstance = sdkInstance;
        }
    
        @Override
        public void onError(FaceTecURScanMatchInitializationError error) {
    
        }
    });
  4. Open res/layout/activity_main.xml and add a button.
  5. Go to MainActivity.java, link the button, and set the button to start a FaceTec UR Scan+Match Session:
            button = findViewById(R.id.startButton);
            button.setOnClickListener(view -> {
                urScanMatchSDKInstance.startURCodeMatch(this);
            });
  6. On success, Your App is ready to build and run!

Network Security

Although the UR Scan+Match SDK provides various layers of security, Network Protections can only be configured at the Application Level. The Android Network Security Configuration Guide provides comprehensive documentation on how to secure Your Application's Network Traffic.

In particular, FaceTec recommends that Your Team implement Certificate Pinning to prevent Man-in-the-Middle Attacks.