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:

  • Android API level 21


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 "$dotFaceLiteVersion"

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 using 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.


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

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

Basic Setup


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 only be used 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 at developers who want to build their own UI using the DOT Android Face Lite functionality. UI components are built 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 a good quality image of a human face.

Non-UI Components

Face Detector

The FaceDetector interface provides a face detection functionality.

Create a FaceDetector:

FaceDetector faceDetector = FaceDetectorFactory.create();

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

FaceDetector.Result result = faceDetector.detect(bgraRawImage);

Face Auto Capture Controller

The FaceAutoCaptureController interface provides a stateful face auto capture functionality.

Create FaceAutoCaptureController:

FaceAutoCaptureControllerConfiguration configuration = new FaceAutoCaptureControllerConfiguration.Builder(validators)
FaceAutoCaptureController faceAutoCaptureController = FaceAutoCaptureControllerFactory.create(configuration);

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


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.

In the case you want to restart the face auto capture process, call the restart() method.


UI Components

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 a circle placeholder for a face on the screen. The component is embedded into the application as a fragment from the Android Support Library. The fragment is abstract, so it must be subclassed.

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

public class DemoFaceAutoCaptureFragment extends FaceAutoCaptureFragment {

    public void onCreate(@Nullable Bundle savedInstanceState) {

    public void onCandidateSelectionStarted() {
        // Callback implementation

    public void onCaptured(@NonNull FaceAutoCaptureResult result) {
        // Callback implementation

    public void onProcessed(@NonNull FaceAutoCaptureDetection detection) {
        // Callback implementation

    public void onStopped() {
        // Callback implementation

    protected void onNoCameraPermission() {
        // Callback implementation

In order to configure the behavior of FaceAutoCaptureFragment, use FaceAutoCaptureConfiguration:

FaceAutoCaptureConfiguration faceAutoCaptureConfiguration = new FaceAutoCaptureConfiguration.Builder().build();

Bundle arguments = new Bundle();
arguments.putSerializable(FaceAutoCaptureFragment.CONFIGURATION, faceAutoCaptureConfiguration);

Fragment fragment = new DemoFaceAutoCaptureFragment();

    .replace(, fragment)

As soon as the fragment is created, the camera preview starts. To start the auto capture process, call the start() method. You can start the process any time.

In the 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. The process is automatically finished when candidate selection ends. After that, onCaptured() callback is called.

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

In the case you want to restart the face auto capture process, call the restart() method. The whole process will start from the beginning.

In the case you want to stop the face auto capture process prematurely, call the stopAsync() method. The onStopped() callback 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">Center your face</string>
<string name="dot_face_auto_capture_instruction_candidate_selection">Stay still&#8230;</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>

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" />