Android 3D Liveness Detection SDK User Guide(For Xamarin)

Development Preparation

  1. Contact us to register an account.

Overview

Demo

Install CV-Demo.apk to your phone and log in with the test account.

Installation

  1. Add source https://public-n3.advai.net/repository/nuget-hosted/
  2. Add package AdvanceAI.Android.Liveness

Usage

  1. Initialization SDK.

  2. Let the SDK handle camera permissions

  3. Set movement difficulty level(Called before the setLicenseAndCheck() method, otherwise it does not take effect

    You can specify the difficulty of the action detection according to your business requirements (Easy,Normal,Hard),default level is Normal

  4. Check license

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

  5. Start the liveness detection test and obtain the test result.

    The camera detection permission is not processed on the live detection page. Please do the permission detection before entering the page.
    Each time the liveness detection is successful, a unique livenessId and a clear photo of 600*600 pixels for this test will be returned.

    • You need to give the livenessId to your server, and the server will call openAPI to get the score of this test.

    • You can get the image directly through the methods provided by the SDK, or you can call the openAPI from the server.

      Sample Code

  6. Important Note to Order of Motions

    The default action sequence is [Blink]->[Shake Head]. To customize, you can follow one of the methods:

  7. Customize the size of the returned image

  8. Return multiple images (off by default)

    The SDK supports capturing a separate image for each action. If you turn this switch on, the SDK will run with a higher memory footprint due to the extra images being captured. If your App is already using a lot of memory, turning on this configuration may cause a memory overflow, so please choose carefully.

    Obtain image sequence (obtained after successful live detection):

  9. Customized action time

    Detection time for custom actions, all actions take effect after setting, unit: Millisecond

  10. User binding (strongly recommended).

    You can use this method to pass your user unique identifier to us, we will establish a mapping relationship based on the identifier。It is helpful for us to check the log when encountering problems.

  11. Turn on occlusion detection

    If you want to enable occlusion detection, please call the following method after initializing the SDK to set it

Error code

errorCoderaw native sdk codeDescription
PREPARE_TIMEOUTfail_reason_prepare_timeoutTimeout during the preparation stage
ACTION_TIMEOUTfail_reason_timeoutTimeout during the motion stage
MULTIPLE_FACEfail_reason_muti_faceMultiple faces detected during the motion stage
FACE_MISSINGfail_reason_facemiss_blink_mouthFace is missing during the motion stage(blink or open mouth)
FACE_MISSINGfail_reason_facemiss_pos_yawFace is missing during the motion stage(pos yaw)
MUCH_ACTIONfail_reason_much_actionMultiple motions detected during the motion stage
USER_GIVE_UPuser_give_upThe user clicked the top left back button during the detection process
NO_RESPONSE Network request failed
DEVICE_NOT_SUPPORTdevice_not_supportThe front camera of this device cannot be opened
UNDEFINED Other undefined errors
AUTH_PARAMETER_ERROR Authentication Error: Please ensure that the license has been initialized successfully.
AUTH_IAM_FAILED Authentication Error: Please ensure that the license has been initialized successfully.
WEAK_LIGHTliveness_weak_lightThe light is too weak
STRONG_LIGHTliveness_too_lightThe light is too strong
AUTH_BAD_NETWORK Failed to authorize network
CHECKING_BAD_NETWORK Network failed to upload image
MODEL_ERROR Model error
ALREADY_INIT Repeated loading
NO_UPLOAD_IMAGE Failed to capture the best uploaded image
AUTH_TICKET_DISABLE Ticket is expired
AUTH_ACCOUNT_ACCESS_DENIED Access for this account is denied
...(Other server side error codes)  

Customizable UI

Not supported.

FAQ

  1. Multilingual

    Currently SDK supports six languages/voice: Chinese, English, Indonesian, Vietnamese,Hendi,Thai.Automatically switch according to the current language of the mobile phone, no code setting is required..

  2. Code proguard configuration

    The SDK already has code proguard, no additional configuration is required.