Integration Documentation(CustomView Mode)

This document introduces how to integrate the SDK without depending on the UI module.

Installation

  1. Add the repository

  2. Add the dependencies in your project's gradle:

  3. If your application has package size constraints or you need to reduce the app bundle size, you can optimize by excluding the model file module from the dependencies in step 2. This modification reduces the SDK package size by approximately 1.4MB. The model files will be downloaded automatically when users first launch the SDK. Please be aware that network connectivity issues may cause download failures.

Migration Guides

If you are upgrading from an older version of the Liveness SDK, please refer to this document to understand the changes.

Usage

  1. Initialization SDK.

    The init method need to be called in your application class

  2. Check License

    The license is obtained by your server calling our openAPI, you need to check license before starting the liveness detection activity.

  3. Create LivenessView in XML. Below is the suggested syntax.

    The LivenessView must remain square, with a maximum width of 1.3 times the screen width.

  4. Create launch configuration.

    Before starting live detection, you need to create a launch configuration object. Below is a demonstration along with an introduction to the method.

  5. Start detection.

    Set the configs created in the previous step to livenessView as the launch configuration

  6. Get liveness results.

    LivenessResult is static, meaning you can access the liveness results from any page.

  7. Destroy the LivenessView.

    In the finish method of the activity, you need to manually end the detection to free up resources.