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
- 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
- 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.
- 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' - In Your App, open settings.gradle and add facetec-sdk-#####.aar as a dependency:
- Add
flatDir{ dirs '.' }todependencyResolutionManagement{repositories{ }}. - Click "sync now".
- Add
- On success, Your App will build with no errors.
Import Default Config and Run
- 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.
- In your MainActivity.java, add
FaceTecURScanMatchSDKInstanceandurScanMatchSDKInstance. - 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) { } }); - Open res/layout/activity_main.xml and add a button.
- 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); }); - 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.