Biometrid Android SDK
3.0.2
3.0.2
  • Introduction
  • Standard SDK
    • Initialization
    • Requirements
    • Enums
    • Installation
      • Gradle
    • Process Management
      • Create Process
      • Previous Step
      • Get Step State
    • Update Step Management
      • Update Step
    • Liveness Validation
    • Photo Capture
      • Configurations
    • Auto Capture
      • Configurations
    • NFC Passport Reader
      • Scan result
      • Configurations
    • Biometric Authentication
    • Device Location
    • Presence Detection
      • Configurations
  • Full SDK
    • Initialization
    • Requirements
    • Installation
      • Gradle
    • Start
    • Photo Capture
    • Liveness Validation
    • Callbacks
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Standard SDK

Presence Detection

Performs a real time user presence detection by scanning the user face features.

BiometridStandard.getInstance().startPresenceDetection(activity, processCallback);

AppCompatActivity activity

The current activity.

ProcessCallback callback

The process result callback.

Implementation example

class ExampleActivity extends AppCompatActivity implements InitializationCallback {
    String TAG = getClass().getSimpleName();
    String BIOMETRID_API_SERVER_URL = "your server URL";
    String BIOMETRID_APP = "your app";
    String BIOMETRID_CREDENTIAL = "your credential";
    
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        BiometridStandard.getInstance().initialize(
                BIOMETRID_API_SERVER_URL ,
                BIOMETRID_APP,
                BIOMETRID_CREDENTIAL,
                Language.English,    
                this);
    }
    
    @Override
    public void initializationCallback(boolean status, @Nullable Errors errors) {
        if(status) getLocation();
    }

    public void getLocation() {
        BiometridStandard.getInstance().startPresenceDetection(this, new ProcessCallback() {
            @Override
            public void genuinePresenceCallback(@Nullable Boolean status, @Nullable Boolean processing, @Nullable Errors errors) {
                if (errors != null) {
                    Log.e(TAG, "genuinePresenceCallback -> error: " + errors.getMessage());
                } else {
                    Log.d(TAG, "genuinePresenceCallback -> status: " + status);
                }
        });
    }
}

locationCallback

Description

Boolean? status

The result status.

Boolean? processing

Wether the current process is uploading the detected face features.

Errors? errors

Detected errors.

PreviousDevice LocationNextConfigurations

Was this helpful?