Legacy On Android SDK
1.7.0
1.7.0
  • Introduction
  • Overview
    • Requirements
    • Prerequisites
    • Downloading
    • Setup
    • Initialization
      • Custom headers
    • BiometridOn
      • Create process
      • Get current step
      • Get previous step
      • Get remaining steps
      • Get completed steps
      • Get process data
      • Submit form
      • Submit file
      • Submit selfie with ID card
      • Submit form with files
      • Submit multiple files
      • Submit ID document
      • Video conference
    • Liveness Detection
      • Basic detection
      • Liveness Customisation
      • Generate Liveness Surface
  • Enums
    • StepType
    • VideoConferenceState
    • Doctype
Powered by GitBook
On this page
  • Initialisation
  • Implementation example
  1. Overview
  2. Liveness Detection

Liveness Customisation

LivenessCustomization is an object required to initialise and alter many visual aspects of Biometrid's liveness detection surface.

Initialisation

Required values :

  • View Id

    • Represent the id given by the developer where Biometrid's liveness engine will appear

  • Liveness token

    • Token required by the client to enable the liveness engine

  • Public key

    • key generated to enable the connection between client and server

Required values (Custom service deployment):

  • View Id

    • Represent the id given by the developer where Biometrid's liveness engine will appear

  • Liveness token

  • Liveness token

  • Public key

  • Package name

  • Expiry date

  • Key (contact our support for more details on this matter)

Implementation example

public class ExampleActivity extends Activity implements OnProcessCallback {
    private String filepath_front, filepath_back;
   
    //This variables are here just to provide some feedback on the expected structure and are not valid for the actual procedure
    private String public_key = "-----BEGIN PUBLIC KEY------\n" + 
                                    "MAAd1o3lksadgakOINYU09KJHNSACD" + 
                                    "akOIN9813HJMAJSBC109KJHNSACsad" +
                                    "sadgakOINY13HJMAJSBC109NSAC234" +
                                    "-----END PUBLIC KEY------" +
                                    
    private String liveness_token = "jkhfdaKJHF897123NGJHKJHS";

    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_example);

        //Object initialisation
        LivenessCustomisation customisation = new LivenessCustomisation();

        
        //Change company logo
        customisation.setAppLogo(R.drawable.logo)
            
        //Only required in some cases
        //customisation.setViewId(R.id.liveness_surface); 
        
        //A liveness token and public key are mandatory for the engine to properly work
        customisation.setLivenessToken(liveness_token);
        customisation.setPublicKey(public_key);
        
        //Required only for custom service deployments
        customisation.setAppId(getApplicationContext().getPackageName());
        customisation.setExpiryDate("Insert expiry date here");
        customisation.setLicenseKey("Insert license key here");

        
        /*
        This object is expected as a parameters on the startLivenessDetectionn method.
        For more details check the "Submit selfie with liveness" section of this documentation.
        */
    }

    @Override
    public void onDataSubmissionCallback(Boolean status, StepType previous, StepType next, JsonObject json, Errors e) {
        
    } 

     @Override
    public void onPusherEventsCallback(@NonNull String s, @NonNull String event, @NonNull JSONObject jsonObject, @Nullable Errors errors) {

    }

...
}

PreviousBasic detectionNextGenerate Liveness Surface

Last updated 5 years ago