> For the complete documentation index, see [llms.txt](https://docs.caf.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.caf.io/caf-sdk/android/standalone-modules/readme2.md).

# CafSDK

Welcome to the documentation for **CafSDK**, a unified and modular Android SDK that provides robust solutions for document detection and face liveness validation.

***

* [CafSDK for Android](#cafsdk-for-android)
  * [Overview](#overview)
  * [Features](#features)
  * [Requirements](#requirements)
  * [Installation](#installation)
    * [Gradle Configuration](#gradle-configuration)
      * [Java 8 Compatibility](#java-8-compatibility)
      * [Adding SDK Dependency](#adding-sdk-dependency)
  * [Usage](#usage)
  * [Module Architecture](#module-architecture)

***

## Overview

**CafSDK** is a comprehensive Android SDK that integrates two primary functionalities:

* **Document Detection:** Powered by the [DocumentDetector](/caf-sdk/android/standalone-modules/document-detector.md) framework and TensorFlow Lite.
* **Face Liveness Validation:** Offered via the [CafFaceLiveness](/caf-sdk/android/standalone-modules/caffaceliveness.md) module, which supports both **iProov** and **FaceTec 2D** providers. These providers can be used independently or in combination, giving you the flexibility to tailor the solution to your needs.

This unified approach allows developers to include only the necessary modules, reducing bloat and simplifying integration.

***

## Features

* **Modularity:** Integrate the full SDK or select individual components.
* **Ease of Integration:** Using BoM (bill of material) for version management ensures compatibility between SDKs, avoiding conflicts and speeding up integration and use.
* **Security and Accuracy:** Leverages advanced frameworks (e.g., TensorFlow Lite, iProov, FaceTec) for robust document and face validation.

***

## Requirements

| Requirement                                     | Version |
| ----------------------------------------------- | ------- |
| Minimum Android SDK API version (minSdk)        | 26      |
| Android SDK API version to compile (compileSDK) | 34      |
| Kotlin version                                  | 1.9.10  |
| Gradle version                                  | 8.4     |
| Android Gradle Plugin (AGP) version             | 8.3.2   |

***

## Installation

### Gradle Configuration

Add these lines to your `settings.gradle`.

```kotlin
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://repo.combateafraude.com/android/release") }
        maven { url = uri("https://raw.githubusercontent.com/iProov/android/master/maven/") }
        maven { setUrl("https://maven.fpregistry.io/releases") }
        maven { setUrl("https://jitpack.io") }
    }
}
```

#### Java 8 Compatibility

If Java 8 is not enabled, add support to your `build.gradle`:

```kotlin
android {
    ...
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
```

#### Adding SDK Dependency

Include the FaceLiveness SDK in your `build.gradle` dependencies:

```kotlin
dependencies {
    // Declare Bill of Material dependency.
    implementation(platform("io.caf.sdk:caf-sdk-bom:1.2.0"))

    // Select which SDK you can use.
    implementation("io.caf.sdk:document-detector")
    // implementation("io.caf.sdk:caffaceliveness-lite")
}
```

## Usage

Documentation:

[DocumentDetector](/caf-sdk/android/standalone-modules/document-detector.md)[CafFaceLiveness](/caf-sdk/android/standalone-modules/caffaceliveness.md)

## Module Architecture

The unified CafSDK is organized into several modular components:

* `CafSDK`: The umbrella module for core functionalities.
* `DocumentDetector`: Provides secure document detection using TensorFlow Lite.
* `CafFaceLiveness`: Manages face liveness validation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.caf.io/caf-sdk/android/standalone-modules/readme2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
