DOT Android Face Lite library



DOT Android Face Lite provides components for face capture and related functionalities which are easy to integrate into an Android application.


DOT Android Face Lite has the following requirements:

  • Minimum Android API level 21

  • Minimum Kotlin Gradle plugin version 1.6.0 (if used)


Maven Repository

DOT Android Face Lite is distributed as an Android library (.aar package) stored in the Innovatrics maven repository.

In order to integrate DOT Android Face Lite into your project, the first step is to include the Innovatrics maven repository and Google repository to your top level build.gradle file.

allprojects {
    repositories {
        maven {
            url ''

Then, specify the dependency on DOT Android Face Lite library in the module’s build.gradle file. Dependencies of this library will be downloaded alongside the library.

dependencies {
    implementation "$dotVersion"

In order to optimize application size, we also recommend adding the following excludes to your application’s build.gradle file.

android {
    packagingOptions {

Supported Architectures

DOT Android Face Lite provides binaries for these architectures:

  • armeabi-v7a

  • arm64-v8a

  • x86

  • x86_64

If your target application format is APK and not Android App Bundle, and the APK splits are not specified, the generated APK file will contain binaries for all available architectures. Therefore we recommend to use APK splits. For example, to generate arm64-v8a APK, add the following section into your module build.gradle:

splits {
    abi {
        enable true
        include 'arm64-v8a'
        universalApk false

If you do not specify this section, the resulting application can become too large in size.


In order to use DOT SDK in other apps, it must be licensed. The license can be compiled into the application as it is bound to the application ID specified in build.gradle:

defaultConfig {
    applicationId ""

The application ID can be also retrieved in runtime by calling DotSdk.getApplicationId().

In order to obtain the license, please contact your Innovatrics’ representative specifying the application ID. If the application uses build flavors with different application IDs, each flavor must contain a separate license. Put the license file into the raw resource folder.


DOT Android Face Lite declares the following permission in AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

Basic Setup


Before using any of the components, you need to initialize DOT SDK with the license and DotFaceLiteLibrary object.

InitializeDotSdkUseCase class in the Samples project shows how to initialize DOT SDK with DotFaceLiteLibrary. DotSdk.initialize() method should be called on background thread.

Keep in mind that if you try to use any component without initialization, it will throw an exception.


When a process (e.g. onboarding) using the DOT Android Face Lite has been completed, it is usually a good practice to free the resources used by it.

You can perform this by calling DotSdk.deinitialize(). If you want to use the DOT Android Face Lite components again after that point, you need to call DotSdk.initialize() again. This shouldn’t be performed within the lifecycle of individual Android components.


Although logging is disabled by default, it can be enabled explicitly by using the following method from the class.


The appropriate place for this call is within the onCreate() method of your subclass of Each TAG of a log message starts with the prefix dot-face-lite:.

This setting enables logging for all DOT Android libraries.
Keep in mind that logging should be used just for debug purposes as it might produce a lot of log messages.



DOT Android Face Lite provides both non-UI and UI components. Non-UI components are aimed to be used by developers who want to build their own UI using the DOT Android Face Lite functionality. UI components are build on top of non-UI components. These are available as abstract fragments and can be extended and then embedded into the application’s existing activity providing more control.

List of Non-UI Components


A component for performing face detection on an image.


A component for capturing good quality image of human face.

List of UI Components


A visual component for capturing good quality images of a human face.


A visual component for capturing images suitable for MagnifEye liveness evaluation.

Non-UI Components

Face Detector

The FaceDetector interface provides a face detection functionality.

Create a FaceDetector:

val faceDetector = FaceDetectorFactory.create()

To perform detection, call the following method on the background thread:

val result = faceDetector.detect(bgraRawImage)

Face Auto Capture Controller

The FaceAutoCaptureController interface provides a stateful face auto capture functionality.

Create FaceAutoCaptureController:

val configuration = FaceAutoCaptureController.Configuration(
    minValidFramesInRowToStartCandidateSelection = minValidFramesInRowToStartCandidateSelection,
    candidateSelectionDurationMillis = candidateSelectionDurationMillis,
    detectionNormalizedRectangle = detectionNormalizedRectangle,
val faceAutoCaptureController = FaceAutoCaptureControllerFactory.create(configuration)

To capture a good quality face image, repeatedly call the process() method using the camera frames:

val processingResult = faceAutoCaptureController.process(bgraRawImage, timestampMillis)

The controller evaluates the image requirements for each frame. Once there are minValidFramesInRowToStartCandidateSelection valid frames in a row, candidate selection is started with duration of candidateSelectionDurationMillis milliseconds. After the candidate selection is finished, the best face image candidate is returned and the face auto capture process is over.

UI Components

Fragment Configuration

Components containing UI are embedded into the application as fragments from Android Support Library. All fragments are abstract. They must be subclassed and override their abstract methods.

Fragments requiring runtime interaction provide public methods, for example start().

class DemoFaceAutoCaptureFragment : FaceAutoCaptureFragment() {

    override fun onCreate(savedInstanceState: Bundle?) {


The FaceAutoCaptureFragment requires a configuration. To provide configuration data, you should override the provideConfiguration() method in your subclass implementation. This method should return an instance of the FaceAutoCaptureFragment.Configuration data class with the desired parameters.

class DemoFaceAutoCaptureFragment : FaceAutoCaptureFragment() {

    override fun provideConfiguration() = Configuration(
        cameraFacing = CameraFacing.FRONT,
        cameraPreviewScaleType = CameraPreviewScaleType.FIT,


Camera permission

A fragment (UI component) will check the camera permission (Manifest.permission.CAMERA) right before the camera is started. If the camera permission is granted the fragment will start the camera. If the camera permission is not granted the fragment will use Android API - ActivityResultContracts.RequestPermission to request the camera permission. Android OS will present the system dialog to the user of the app. If the user explicitly denies the permission at this point, onNoCameraPermission() callback is called. Implement this callback in order to navigate the user further in your app workflow.

Orientation Change

In order to handle the orientation change in multi-window mode correctly, configure the activity in your AndroidManifest.xml file as follows:

    android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation" />

Face Auto Capture

The fragment with instructions for obtaining quality face images suitable for further processing.

In order to configure the behaviour of FaceAutoCaptureFragment, use FaceAutoCaptureFragment.Configuration (see Fragment Configuration).

To use the fragment, create a subclass of FaceAutoCaptureFragment and override appropriate callbacks.

To start the face auto capture process call the start() method. You can start the process any time.

In case you want to handle detection data, implement onProcessed() callback. This callback is called with each processed camera frame. The callback onCandidateSelectionStarted() is called only once for the whole process, when candidate selection is started. When the face auto capture process finishes successfully, the result will be returned via the onCaptured() callback.

In case you want to force the capture event, call the requestCapture() method. The most recent image will be returned via the onCaptured() callback asynchronously.

Call start() method again in case you need to start over the face auto capture process. You can also call start() method to stop and start over ongoing process as well.

In case you want to stop the face auto capture process prematurely, call the stopAsync() method. The callback in the method argument indicates that the processing is over.

Quality Attributes of the Output Image

You may adjust quality requirements for the output image. To perform this, you can use pre-defined instances - QualityAttributeThresholds - from QualityAttributeThresholdPresets with recommended thresholds and pass it to FaceAutoCaptureFragment.Configuration by setting the qualityAttributeThresholds. You can also create your own instance of QualityAttributeThresholds from scratch or based on pre-defined instances according to your needs.

Possible ways how to create QualityAttributeThresholds:

// The standard preset
val standard = QualityAttributeThresholdPresets.standard

// Modified thresholds based on the standard preset
val modified = QualityAttributeThresholdPresets.standard.copy(
    minConfidence = minConfidence,
    maxDevicePitchAngle = null,

// Custom thresholds
val custom = QualityAttributeThresholds(
    minConfidence = minConfidence,
    maxDevicePitchAngle = maxDevicePitchAngle,

Available presets (pre-defined instances with thresholds) in QualityAttributeThresholdPresets:

MagnifEye Liveness

The fragment with instructions for obtaining face data suitable for MagnifEye liveness evaluation.

In order to configure the behaviour of MagnifEyeLivenessFragment, use MagnifEyeLivenessFragment.Configuration (see Fragment Configuration).

To use the fragment, create a subclass of MagnifEyeLivenessFragment and override appropriate callbacks.

To start the MagnifEye liveness process call the start() method. You can start the process any time.

In case you want to handle detection data, implement onProcessed() callback. This callback is called with each processed camera frame. When the MagnifEye liveness process finishes successfully, the result will be returned via the onFinished() callback.

In case you want to stop the MagnifEye liveness process prematurely, call the stopAsync() method. The callback in the method argument indicates that the processing is over.

Customization of UI components


You can override the string resources in your application and provide alternative strings for supported languages using the standard Android localization mechanism.

<string name="dot_face_auto_capture_instruction_face_not_present">Position your face into the circle</string>
<string name="dot_face_auto_capture_instruction_candidate_selection">Stay still&#8230;</string>
<string name="dot_face_auto_capture_instruction_device_pitch_too_high">Hold your phone at eye level</string>
<string name="dot_face_auto_capture_instruction_face_centering">Center your face</string>
<string name="dot_face_auto_capture_instruction_face_too_close">Move back</string>
<string name="dot_face_auto_capture_instruction_face_too_far">Move closer</string>
<string name="dot_face_auto_capture_instruction_lighting">Turn towards light</string>
<string name="dot_face_magnifeye_liveness_instruction_eye_centering">Fit your eye into square</string>

You may customize the colors used by DOT Android Face Lite in your application. To use custom colors, override the specific color.

<color name="dot_detection_layer">#ffffffff</color>
<color name="dot_instruction_background">#fff8fbfb</color>
<color name="dot_instruction_candidate_selection_background">#ff00bfb2</color>
<color name="dot_instruction_text">#ff131313</color>
<color name="dot_placeholder">#ffffffff</color>
<color name="dot_placeholder_candidate_selection">#ff00bfb2</color>
<color name="dot_placeholder_overlay">#80131313</color>

Text views and buttons can be styled by overriding the parent style in the application.

<style name="TextAppearance.Dot.Medium" parent="TextAppearance.AppCompat.Medium" />
<style name="TextAppearance.Dot.Medium.Instruction" />



7.5.1 - 2024-04-15

  • Section about optimization of application size to integration manual.

  • Minor UI issue with positioning of instruction view.

  • Rare UI issue in detection layer in FILL scale type on some devices.

7.5.0 - 2024-04-03

  • Class MagnifEyeLivenessFragment.Configuration.

  • Method MagnifEyeLivenessFragment.provideConfiguration().

  • Class FaceAutoCaptureFragment.Configuration

  • Method FaceAutoCaptureFragment.provideConfiguration().

  • Class FaceAutoCaptureController.Configuration.

  • Method FaceAutoCaptureControllerFactory.create(FaceAutoCaptureController.Configuration).

  • Constructor of QualityAttributeThresholds.

  • Callback onStopped as an argument to method FaceAutoCaptureFragment.stopAsync().

  • Callback onStopped as an argument to method MagnifEyeLivenessFragment.stopAsync().

  • Property QualityAttributeThresholdPresets.standard to QualityAttributeThresholdPresets.standardBuilder.

  • Deprecated MagnifEyeLivenessConfiguration.Builder, use MagnifEyeLivenessFragment.Configuration instead.

  • Deprecated MagnifEyeLivenessConfiguration, use MagnifEyeLivenessFragment.Configuration instead.

  • Deprecated MagnifEyeLivenessFragment.CONFIGURATION, override MagnifEyeLivenessFragment.provideConfiguration() method to provide configuration instead.

  • Deprecated FaceAutoCaptureConfiguration.Builder, use FaceAutoCaptureFragment.Configuration instead.

  • Deprecated FaceAutoCaptureConfiguration, use FaceAutoCaptureFragment.Configuration instead.

  • Deprecated FaceAutoCaptureFragment.CONFIGURATION, override FaceAutoCaptureFragment.provideConfiguration() method to provide configuration instead.

  • Deprecated FaceAutoCaptureControllerConfiguration.Builder, use FaceAutoCaptureController.Configuration instead.

  • Deprecated FaceAutoCaptureControllerConfiguration, use FaceAutoCaptureController.Configuration instead.

  • Deprecated FaceAutoCaptureControllerFactory.create(FaceAutoCaptureControllerConfiguration), use FaceAutoCaptureControllerFactory.create(FaceAutoCaptureController.Configuration) instead.

  • Deprecated QualityAttributeThresholds.Builder, use QualityAttributeThresholds constructor instead.

  • Deprecated QualityAttributeThresholdPresets.standardBuilder, use QualityAttributeThresholdPresets.standard instead.

  • Method FaceAutoCaptureFragment.onStopped(). Use FaceAutoCaptureFragment.stopAsync() method argument onStopped instead.

  • Method MagnifEyeLivenessFragment.onStopped(). Use MagnifEyeLivenessFragment.stopAsync() method argument onStopped instead.

7.4.1 - 2024-03-27

  • Target Android API level to 34.

  • API availability issue.

7.4.0 - 2024-03-18

  • Technical release. No changes.

7.3.0 - 2024-02-23

  • Permission android.permission.INTERNET in Android manifest.

7.2.2 - 2024-02-07

  • Technical release. No changes.

7.2.1 - 2024-02-05

  • Property REQUIRE_SECURE_ENV with value 1 under the <application> in Android manifest.

  • API availability issue.

7.2.0 - 2023-12-28

  • Camera preview and image analysis resolution selection strategy in UI components for FILL scale type.

7.1.0 - 2023-12-14

  • Technical release. No changes.

7.0.2 - 2023-12-05

  • Technical release. No changes.

7.0.1 - 2023-11-21

  • Technical release. No changes.

7.0.0 - 2023-11-02

  • Class DotSdk.

  • Class DotSdkConfiguration.

  • Interface DotLibrary.

  • License file is required. To obtain one, please contact

  • Class DotFaceLiteLibrary reworked.

6.5.2 - 2023-10-20

  • Technical release. No changes.

6.5.1 - 2023-10-19

  • Minor UI issue in MagnifEye Liveness UI component.

  • Stability issue.

6.5.0 - 2023-10-04

  • Technical release. No changes.

6.4.0 - 2023-09-20

  • Class TiltAngles.

  • Class DevicePitchTooHighValidator.

  • String resource dot_face_auto_capture_instruction_device_pitch_too_high.

  • Property FaceAutoCaptureController.Sample.deviceTiltAngles.

  • Property FaceAutoCaptureDetection.deviceTiltAngles.

  • Property FaceAutoCaptureFrameParameters.deviceTiltAngles.

  • Method QualityAttributeThresholds.Builder.maxDevicePitchAngle().

  • Signature of FaceAutoCaptureController.process() method.

6.3.0 - 2023-08-17

  • Update MagnifEyeLivenessResult.content.

  • UI state after configuration change.

  • Preview and image resolution in UI components on some devices.

6.2.1 - 2023-07-27

  • Technical release. No changes.

6.2.0 - 2023-07-26

  • Method FaceAutoCaptureConfiguration.Builder.sessionToken().

  • Method MagnifEyeLivenessConfiguration.Builder.sessionToken().

  • Method FaceAutoCaptureControllerConfiguration.Builder.sessionToken().

6.1.0 - 2023-07-07

  • Method FaceAutoCaptureConfiguration.Builder.torchEnabled().

  • Method MagnifEyeLivenessConfiguration.Builder.torchEnabled().

  • MagnifEye Liveness UI components after restart.

  • Duplicate classes from package.

6.0.0 - 2023-06-14

  • Method FaceAutoCaptureConfiguration.qualityAttributeThresholds().

  • Object QualityAttributeThresholdPresets.

  • Property FaceAutoCaptureResult.content.

  • Property MagnifEyeLivenessResult.faceDetectorResult.

  • All methods in QualityAttributeThresholds.Builder() accept nullable arguments.

  • SizeTooSmallValidator default threshold.

  • SizeTooLargeValidator default threshold.

  • Definition of property DetectionPosition.sizeToImageShorterSideRatio now fits Face Size definition.

  • Method FaceAutoCaptureConfiguration.startQualityAttributeThresholds(). Use FaceAutoCaptureConfiguration.qualityAttributeThresholds() instead.

5.5.1 - 2023-06-06

  • UI state after components are finished.

5.5.0 - 2023-04-26

  • Technical release. No changes.

5.4.1 - 2023-03-28

  • Technical release. No changes.

5.4.0 - 2023-03-24

  • MagnifEye Liveness UI component (MagnifEyeLivenessFragment, MagnifEyeLivenessConfiguration and MagnifEyeLivenessResult).

  • String resource dot_face_magnifeye_liveness_instruction_eye_centering.

5.3.0 - 2023-03-20

  • Property FaceAutoCaptureController.ProcessingResult.phase.

  • Enum Phase.

  • Method FaceAutoCaptureFragment.start() (re)starts the process any time during the lifecycle of the component.

  • Property Use property FaceAutoCaptureController.ProcessingResult.phase instead.

  • Enum FaceAutoCaptureController.ProcessingResult.Event.

  • Method FaceAutoCaptureController.restart(). Create new instance of FaceAutoCaptureController instead.

  • Method FaceAutoCaptureFragment.restart(). Use FaceAutoCaptureFragment.start() instead.

5.2.0 - 2023-03-07

  • Technical release. No changes.

5.1.0 - 2023-02-06

  • Minimum Kotlin Gradle plugin version to 1.6.0.

5.0.0 - 2023-01-30

  • New SDK versioning: All libraries (DOT Document, DOT Face, DOT Face Lite and DOT NFC) are released simultaneously with a single version name. Libraries with the same version name work correctly at build time and at run time.

  • String resource dot_face_auto_capture_instruction_face_not_present.

  • Minimum Kotlin Gradle plugin version to 1.7.0.

1.1.6 - 2022-12-16

  • Stability issue in image conversion.

1.1.4 - 2022-11-02

  • SizeTooSmallValidator and SizeTooLargeValidator threshold valid interval is [0.0, inf].

  • QualityAttributeThresholds.sizeInterval valid values are in interval [0.0, inf].

1.1.3 - 2022-10-21

  • Property FaceAutoCaptureDetectionValidator.dependencyIdentifiers.

  • FaceAutoCaptureControllerConfiguration.Builder() throws an IllegalArgumentException.

1.1.2 - 2022-10-11

  • Target Android API level to 33.

  • Issues if the consumer application is obfuscated (consumer proguard rules).

1.1.1 - 2022-08-18

  • Minor UI issues in Face Auto Capture UI component.

1.1.0 - 2022-07-06

  • Method DotFaceLiteLibrary.getVersionName().

  • Update CameraX to 1.1.0.

  • Minimum Kotlin Gradle plugin version to 1.6.0.

1.0.2 - 2022-05-31

  • Stability issue in BgraRawImageFactory.

1.0.1 - 2022-05-19

  • API visibility issue.