# Android SDK Methods and Properties

## OzLivenessSDK <a href="#h.srint1odv7up" id="h.srint1odv7up"></a>

A singleton for Oz SDK.

### clearActionVideos <a href="#h.v7emb3puz0to" id="h.v7emb3puz0to"></a>

Deletes all action videos from file system.

**Parameters**

\-

**Returns**

\-

### createStartIntent <a href="#h.o3q1axfvyzkv" id="h.o3q1axfvyzkv"></a>

Creates an intent to start the Liveness activity.

| **Parameter** | **Type**                    | **Description**            |
| ------------- | --------------------------- | -------------------------- |
| actions       | [OzAction](#h.2nyke2meu4aw) | A list of possible actions |

**Returns**

\-

### getErrorFromIntent <a href="#h.dyb7eskvgo2q" id="h.dyb7eskvgo2q"></a>

Utility function to get the SDK error from OnActivityResult's intent.

| **Parameter** | **Type** | **Description**    |
| ------------- | -------- | ------------------ |
| data          | Intent   | The object to test |

**Returns**

The [error text](#error-description) – String.

### getLicensePayload <a href="#h.zeqs2fsfeouy" id="h.zeqs2fsfeouy"></a>

Retrieves the SDK license payload.

**Parameters**

\-

**Returns**

The license payload ([LicensePayload](#h.9bjpbnuuoup5)) – the object that contains the extended info about licensing conditions.

### getResultFromIntent <a href="#h.ebozypf5fj8t" id="h.ebozypf5fj8t"></a>

Utility function to get SDK results from OnActivityResult's intent.

| **Parameter** | **Type** | **Description**    |
| ------------- | -------- | ------------------ |
| data          | Intent   | The object to test |

**Returns**&#x20;

A list of OzAbstractMedia objects.

### init <a href="#h.710uqx6hv1hw" id="h.710uqx6hv1hw"></a>

Initializes SDK with license sources.

| **Parameter**  | **Type**                            | **Description**                                    |
| -------------- | ----------------------------------- | -------------------------------------------------- |
| context        | Context                             | The Context class                                  |
| licenseSources | \[[LicenseSource](#h.au17vzy38ai3)] | A list of license references                       |
| statusListener | StatusListener                      | Optional listener to check the license load result |

**Returns**&#x20;

\-

### log <a href="#h.p6ixdyi0k6gr" id="h.p6ixdyi0k6gr"></a>

Enables logging using the Oz Liveness SDK logging mechanism.

| **Parameter** | **Type** | **Description** |
| ------------- | -------- | --------------- |
| tag           | String   | Message tag     |
| log           | String   | Message log     |

**Returns**&#x20;

\-

### setApiConnection

Connection to API.

| **Parameter**  | **Type**                            | **Description** |
| -------------- | ----------------------------------- | --------------- |
| connection     | [OzConnection](#class-ozconnection) | Connection type |
| statusListener | StatusListener\<String?>            | Listener        |

### setEventsConnection

Connection to the telemetry server.

<table data-header-hidden><thead><tr><th></th><th width="261.3333333333333"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td>connection</td><td><a href="#class-ozconnection">OzConnection</a></td><td>Connection type</td></tr><tr><td>statusListener</td><td>StatusListener&#x3C;String?></td><td>Listener<br></td></tr></tbody></table>

### logout <a href="#h.r6rxruqff192" id="h.r6rxruqff192"></a>

Deletes the saved token.

**Parameters**&#x20;

\-

**Returns**&#x20;

\-

### getEventSessionId

Retrieves the telemetry session ID.

**Parameters**

\-

**Returns**

The telemetry session ID (String parameter).

### version

Retrieves the SDK version.

**Parameters**

\-

**Returns**

The SDK version (String parameter).

### generateSignedPayload

Generates the payload with media signatures.

| **Parameter**         | **Type**                           | **Description**            |
| --------------------- | ---------------------------------- | -------------------------- |
| media                 | [OzAbstractMedia](#h.s2ye0si7dzc2) | An array of media files    |
| folderMeta (optional) | \[string:any]                      | Additional folder metadata |

**Returns**

Payload to be sent along with media files that were used for generation.

## AnalysisRequest <a href="#h.hrrahr7tz7s8" id="h.hrrahr7tz7s8"></a>

A class for performing checks.

### run <a href="#h.mpjaunji9r0p" id="h.mpjaunji9r0p"></a>

The analysis launching method.

<table data-header-hidden><thead><tr><th width="272.3333333333333"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td>onStatusChange</td><td><p>A callback function as follows:</p><p><code>onStatusChange(status: AnalysisRequest.</code><a href="#h.qww0i8kvhvdr"><code>AnalysisStatus</code></a><code>) { handleStatus() }</code></p></td><td>The function is executed when the status of the AnalysisRequest changes.</td></tr><tr><td>onError</td><td><p>A callback function as follows:</p><p><code>onError(error: OzException) { handleError() }</code></p></td><td>The function is executed in case of errors.</td></tr><tr><td>onSuccess</td><td><p>A callback function as follows:</p><p><code>onSuccess(result:</code> <a href="#constructor-data-class-requestresult"><code>RequestResult</code></a><code>) {</code></p><p>            <code>handleResults() }</code></p></td><td>The function is executed when all the analyses are completed.</td></tr></tbody></table>

### class Builder <a href="#h.r9wznxjqamq3" id="h.r9wznxjqamq3"></a>

A builder class for AnalysisRequest.

#### *build* <a href="#h.ye0zb9vjlrj0" id="h.ye0zb9vjlrj0"></a>

Creates the AnalysisRequest instance.

**Parameters**&#x20;

\-

**Returns**&#x20;

The [AnalysisRequest ](#h.hrrahr7tz7s8)class instance.

#### *addAnalysis* <a href="#h.tivaod4n3ilf" id="h.tivaod4n3ilf"></a>

Adds an analysis to your request.

| **Parameter** | **Type**                    | **Description**          |
| ------------- | --------------------------- | ------------------------ |
| analysis      | [Analysis](#h.kt3ifyywae8e) | A structure for analysis |

**Returns**&#x20;

Error if any.

#### *addAnalyses* <a href="#h.x9adic91op60" id="h.x9adic91op60"></a>

Adds a list of analyses to your request. Allows executing several analyses for the same folder on the server side.

| **Parameter** | **Type**                       | **Description**               |
| ------------- | ------------------------------ | ----------------------------- |
| analysis      | \[[Analysis](#h.kt3ifyywae8e)] | A list of Analysis structures |

**Returns**&#x20;

Error if any.

#### *addFolderMeta* <a href="#h.p3kte51gjg7n" id="h.p3kte51gjg7n"></a>

Adds metadata to a folder you create (for the server-based analyses only). You can add a pair key-value as additional information to the folder with the analysis result on the server side.

| **Parameter** | **Type** | **Description**     |
| ------------- | -------- | ------------------- |
| key           | String   | Key for metadata.   |
| value         | String   | Value for metadata. |

**Returns**&#x20;

Error if any.

#### *uploadMedia* <a href="#h.yjcx68vgbcjk" id="h.yjcx68vgbcjk"></a>

Uploads one or more media to a folder.

| **Parameter** | **Type**                              | **Description**                                 |
| ------------- | ------------------------------------- | ----------------------------------------------- |
| mediaList     | \[[OzAbstractMedia](#h.s2ye0si7dzc2)] | An OzAbstractMedia object or a list of objects. |

**Returns**&#x20;

Error if any.

#### *setFolderId* <a href="#h.xgpv2kyfuxmd" id="h.xgpv2kyfuxmd"></a>

For the previously created folder, sets a folderId. The folder should exist on the server side. Otherwise, a new folder will be created.

| **Parameter** | **Type** | **Description**      |
| ------------- | -------- | -------------------- |
| folderID      | String   | A folder identifier. |

**Returns**&#x20;

Error if any.

## OzConfig <a href="#h.c69s4peyk55n" id="h.c69s4peyk55n"></a>

Configuration for OzLivenessSDK (use OzLivenessSDK.config).

### setSelfieLength

Sets the length of the **Selfie** gesture (in milliseconds).

| **Parameter** | **Type** | **Description**                                                                                                 |
| ------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| selfieLength  | Int      | The length of the **Selfie** gesture (in milliseconds). Should be within 500-5000 ms, the default length is 700 |

**Returns**

Error if any.

### allowDebugVisualization <a href="#h.tooafwala5ol" id="h.tooafwala5ol"></a>

The possibility to enable additional debug info by clicking on version text.

| **Parameter**           | **Type** | **Description**                     |
| ----------------------- | -------- | ----------------------------------- |
| allowDebugVisualization | Boolean  | Enables or disables the debug info. |

### attemptSettings <a href="#h.s4bb8vgzwig3" id="h.s4bb8vgzwig3"></a>

The number of attempts before SDK returns error.

| **Parameter**    | **Type**                             | **Description**             |
| ---------------- | ------------------------------------ | --------------------------- |
| attemptsSettings | [OzAttemptsSettings](#h.mcnxhgqzwow) | Sets the number of attempts |

### uploadMediaSettings <a href="#h.2mu10566u3yp" id="h.2mu10566u3yp"></a>

Settings for repeated media upload.

|                     |                                                       |                                                      |
| ------------------- | ----------------------------------------------------- | ---------------------------------------------------- |
| **Parameter**       | **Type**                                              | **Description**                                      |
| uploadMediaSettings | [OzUploadMediaSettings](#class-ozuploadmediasettings) | Sets the number of attempts and timeout between them |

### faceAlignmentTimeout <a href="#h.2mu10566u3yp" id="h.2mu10566u3yp"></a>

Timeout for face alignment (measured in milliseconds).

| **Parameter**        | **Type** | **Description** |
| -------------------- | -------- | --------------- |
| faceAlignmentTimeout | Long     | A timeout value |

### livenessErrorCallback <a href="#h.g9xu13hroynu" id="h.g9xu13hroynu"></a>

Interface implementation to retrieve error by Liveness detection.

| **Parameter**         | **Type**     | **Description**  |
| --------------------- | ------------ | ---------------- |
| livenessErrorCallback | ErrorHandler | A callback value |

### localizationCode <a href="#h.69yoyxdqrlmq" id="h.69yoyxdqrlmq"></a>

Locale to display string resources.

| **Parameter**    | **Type**                              | **Description** |
| ---------------- | ------------------------------------- | --------------- |
| localizationCode | [OzLocalizationCode](#h.6x3wdw11shxa) | A locale code   |

### logging <a href="#h.kjt81fqbie5" id="h.kjt81fqbie5"></a>

Logging settings.

| **Parameter** | **Type**                     | **Description**  |
| ------------- | ---------------------------- | ---------------- |
| logging       | [OzLogging](#h.e9nrtxg93gro) | Logging settings |

### useMainCamera <a href="#h.om2lpu694wc6" id="h.om2lpu694wc6"></a>

Uses the main (rear) camera instead of the front camera for liveness detection.

| **Parameter** | **Type** | **Description**                                                             |
| ------------- | -------- | --------------------------------------------------------------------------- |
| useMainCamera | Boolean  | <p><code>True</code>– rear camera,<br> <code>False</code>– front camera</p> |

### disableFramesCountValidation

Disables the option that prevents videos to be too short (3 frames or less).

| **Parameter**                | **Type** | **Description**                                                                       |
| ---------------------------- | -------- | ------------------------------------------------------------------------------------- |
| disableFramesCountValidation | Boolean  | <p><code>True</code>– validation is off,<br> <code>False</code>– validation is on</p> |

## UICustomization <a href="#h.c69s4peyk55n" id="h.c69s4peyk55n"></a>

Customization for OzLivenessSDK (use `OzLivenessSDK.config.customization`).

### hideStatusBar

Hides the status bar and the three buttons at the bottom. The default value is `True`.

### toolbarCustomization <a href="#h.fnp80tmzu0op" id="h.fnp80tmzu0op"></a>

A set of customization parameters for the toolbar.

| **Parameter**      | **Type**                                                                    | **Description**                                            |
| ------------------ | --------------------------------------------------------------------------- | ---------------------------------------------------------- |
| closeIconRes       | Int (@DrawableRes)                                                          | An image for the close button                              |
| closeIconTint      | [Color](#h.au17vzy38ai3-1)                                                  | Close button color                                         |
| titleTextFont      | Int (@FontRes)                                                              | Toolbar title text font                                    |
| titleTextFontStyle | Int (values from android.graphics.Typeface properties, e.g., Typeface.BOLD) | Toolbar title text font style                              |
| titleTextSize      | Int                                                                         | Toolbar title text size (in sp, 12-18)                     |
| titleTextAlpha     | Int                                                                         | Toolbar title text opacity (in %, 0-100)                   |
| titleTextColor     | [Color](#h.au17vzy38ai3-1)                                                  | Toolbar title text color                                   |
| backgroundColor    | [Color](#h.au17vzy38ai3-1)                                                  | Toolbar background color                                   |
| backgroundAlpha    | Int                                                                         | Toolbar background opacity (in %, 0-100)                   |
| isTitleCentered    | Boolean                                                                     | Defines whether the text on the toolbar is centered or not |
| title              | String                                                                      | Text on the toolbar                                        |

### centerHintCustomization <a href="#h.cql8r016fga9" id="h.cql8r016fga9"></a>

A set of customization parameters for the center hint that guides a user through the process of taking an image of themselves.

| **Parameter**          | **Type**                                                                   | **Description**                                                    |
| ---------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| textFont               | String                                                                     | Center hint text font                                              |
| textStyle              | Int (values from android.graphics.Typeface properties, e.g.,Typeface.BOLD) | Center hint text style                                             |
| textSize               | Int                                                                        | Center hint text size (in sp, 12-34)                               |
| textColor              | [Color](#h.au17vzy38ai3-1)                                                 | Center hint text color                                             |
| textAlpha              | Int                                                                        | Center hint text opacity (in %, 0-100)                             |
| verticalPosition       | Int                                                                        | Center hint vertical position from the screen bottom (in %, 0-100) |
| backgroundColor        | [Color](#h.au17vzy38ai3-1)                                                 | Center hint background color                                       |
| backgroundOpacity      | Int                                                                        | Center hint background opacity                                     |
| backgroundCornerRadius | Int                                                                        | Center hint background frame corner radius (in dp, 0-20)           |

### hintAnimation

A set of customization parameters for the hint animation.

| **Parameter**       | **Type**                   | **Description**                                                   |
| ------------------- | -------------------------- | ----------------------------------------------------------------- |
| hintGradientColor   | [Color](#h.au17vzy38ai3-1) | Gradient color                                                    |
| hintGradientOpacity | Int                        | Gradient opacity                                                  |
| animationIconSize   | Int                        | A side size of the animation icon square                          |
| hideAnimation       | Boolean                    | A switcher for hint animation, if `True`, the animation is hidden |

### faceFrameCustomization <a href="#h.xd1bg6jem9h8" id="h.xd1bg6jem9h8"></a>

A set of customization parameters for the frame around the user face.

| **Parameter**          | **Type**                        | **Description**                                                    |
| ---------------------- | ------------------------------- | ------------------------------------------------------------------ |
| geometryType           | [GeometryType](#h.ezntmzpm1j2k) | The frame type: oval, rectangle, circle, square                    |
| cornerRadius           | Int                             | Rectangle corner radius (in dp, 0-20)                              |
| strokeDefaultColor     | [Color](#h.au17vzy38ai3-1)      | Frame color when a face is not aligned properly                    |
| strokeFaceInFrameColor | [Color](#h.au17vzy38ai3-1)      | Frame color when a face is aligned properly                        |
| strokeAlpha            | Int                             | Frame opacity (in %, 0-100)                                        |
| strokeWidth            | Int                             | Frame stroke width (in dp, 0-20)                                   |
| strokePadding          | Int                             | A padding from the stroke to the face alignment area (in dp, 0-10) |

### backgroundCustomization <a href="#h.9daa8pc8crk" id="h.9daa8pc8crk"></a>

A set of customization parameters for the background outside the frame.

| **Parameter**   | **Type**                   | **Description**                  |
| --------------- | -------------------------- | -------------------------------- |
| backgroundColor | [Color](#h.au17vzy38ai3-1) | Background color                 |
| backgroundAlpha | Int                        | Background opacity (in %, 0-100) |

### versionTextCustomization <a href="#h.kijzx8ejqwmc" id="h.kijzx8ejqwmc"></a>

A set of customization parameters for the SDK version text.

| **Parameter** | **Type**                   | **Description**                         |
| ------------- | -------------------------- | --------------------------------------- |
| textFont      | Int (@FontRes)             | SDK version text font                   |
| textSize      | Int                        | SDK version text size (in sp, 12-16)    |
| textColor     | [Color](#h.au17vzy38ai3-1) | SDK version text color                  |
| textAlpha     | Int                        | SDK version text opacity (in %, 20-100) |

### antiscamCustomization <a href="#h.cql8r016fga9" id="h.cql8r016fga9"></a>

A set of customization parameters for the alert message that warns user about their actions being recorded. This message is placed above the oval.

| **Parameter**     | **Type**                   | **Description**                                               |
| ----------------- | -------------------------- | ------------------------------------------------------------- |
| textMessage       | String                     | Antiscam message text                                         |
| textFont          | String                     | Antiscam message text font                                    |
| textSize          | Int                        | Antiscam message text size (in px, 12-18)                     |
| textColor         | [Color](#h.au17vzy38ai3-1) | Antiscam message text color                                   |
| textAlpha         | Int                        | Antiscam message text opacity (in %, 0-100)                   |
| backgroundColor   | [Color](#h.au17vzy38ai3-1) | Antiscam message background color                             |
| backgroundOpacity | Int                        | Antiscam message background opacity                           |
| cornerRadius      | Int                        | Background frame corner radius (in px, 0-20)                  |
| flashColor        | [Color](#h.au17vzy38ai3-1) | Color of the flashing indicator close to the antiscam message |

### logoCustomization

Logo customization parameters. Custom logo should be allowed by license. By default, logo is placed on the bottom left.

| **Parameter**      | **Type**                  | **Description**   |
| ------------------ | ------------------------- | ----------------- |
| image              | Bitmap (@DrawableRes)     | Logo image        |
| size               | Size                      | Logo size (in dp) |
| verticalPosition   | Int (0-100), default: 100 | Vertical offset   |
| horizontalPosition | Int (0-100), default: 0   | Horizontal offset |

## Variables and Objects <a href="#h.cus902e8glm0" id="h.cus902e8glm0"></a>

### enum OzAction <a href="#h.2nyke2meu4aw" id="h.2nyke2meu4aw"></a>

Contains the action from the captured video.

<mark style="background-color:red;">On January 1, 2027, the One Shot gesture will become unavailable. Please plan your</mark> [<mark style="background-color:red;">migration</mark>](/oz-knowledge/guides/developer-guide/migration-guides/migration-from-one-shot-gesture.md)<mark style="background-color:red;">.</mark>

| **Case**  | **Description**                    |
| --------- | ---------------------------------- |
| OneShot   | The best shot from the video taken |
| Blank     | A selfie with face alignment check |
| Scan      | Scan                               |
| HeadRight | Head turned right                  |
| HeadLeft  | Head turned left                   |
| HeadDown  | Head tilted downwards              |
| HeadUp    | Head lifted up                     |
| EyeBlink  | Blink                              |
| Smile     | Smile                              |

### class LicensePayload <a href="#h.9bjpbnuuoup5" id="h.9bjpbnuuoup5"></a>

Contains the extended info about licensing conditions.

| **Parameter** | **Type**  | **Description**         |
| ------------- | --------- | ----------------------- |
| expires       | Float     | The expiration interval |
| features      | Features  | License features        |
| appIDS        | \[String] | An array of bundle IDs  |

### sealed class  OzAbstractMedia <a href="#h.s2ye0si7dzc2" id="h.s2ye0si7dzc2"></a>

A class for the captured media that can be:

#### ***OzDocumentPhoto***

A document photo.

| **Parameter**             | **Type**                      | **Description**                                                           |
| ------------------------- | ----------------------------- | ------------------------------------------------------------------------- |
| tag                       | [OzMediaTag](#h.dnhv9rthhagx) | A tag for a document photo.                                               |
| photoPath                 | String                        | An absolute path to a photo.                                              |
| additionalTags (optional) | String                        | Additional tags if needed (including those not from the OzMediaTag enum). |
| metaData                  | Map\<String, String>          | Media metadata                                                            |

#### ***OzShotSet***&#x20;

A set of shots in an archive.

| **Parameter**             | **Type**                      | **Description**                                                          |
| ------------------------- | ----------------------------- | ------------------------------------------------------------------------ |
| tag                       | [OzMediaTag](#h.dnhv9rthhagx) | A tag for a shot set                                                     |
| archivePath               | String                        | A path to an archive                                                     |
| additionalTags (optional) | String                        | Additional tags if needed (including those not from the OzMediaTag enum) |
| metaData                  | Map\<String, String>          | Media metadata                                                           |

#### ***OzVideo***

A Liveness video.

| **Parameter**                 | **Type**                      | **Description**                                                          |
| ----------------------------- | ----------------------------- | ------------------------------------------------------------------------ |
| tag                           | [OzMediaTag](#h.dnhv9rthhagx) | A tag for a video                                                        |
| videoPath                     | String                        | A path to a video                                                        |
| bestShotPath (optional)       | String                        | URL of the best shot in PNG                                              |
| preferredMediaPath (optional) | String                        | URL of the API media container                                           |
| additionalTags (optional)     | String                        | Additional tags if needed (including those not from the OzMediaTag enum) |
| metaData                      | Map\<String, String>          | Media metadata                                                           |

### enum OzMediaTag <a href="#h.dnhv9rthhagx" id="h.dnhv9rthhagx"></a>

Contains an action from the captured video.

<mark style="background-color:red;">On January 1, 2027, the One Shot gesture will become unavailable. Please plan your</mark> [<mark style="background-color:red;">migration</mark>](/oz-knowledge/guides/developer-guide/migration-guides/migration-from-one-shot-gesture.md)<mark style="background-color:red;">.</mark>

| **Case**           | **Description**                                 |
| ------------------ | ----------------------------------------------- |
| Blank              | A video with no gesture                         |
| PhotoSelfie        | A selfie photo                                  |
| VideoSelfieOneShot | A video with the best shot taken                |
| VideoSelfieScan    | A video with the scanning gesture               |
| VideoSelfieEyes    | A video with the blink gesture                  |
| VideoSelfieSmile   | A video with the smile gesture                  |
| VideoSelfieHigh    | A video with the lifting head up gesture        |
| VideoSelfieDown    | A video with the tilting head downwards gesture |
| VideoSelfieRight   | A video with the turning head right gesture     |
| VideoSelfieLeft    | A video with the turning head left gesture      |
| PhotoIdPortrait    | A photo from a document                         |
| PhotoIdBack        | A photo of the back side of the document        |
| PhotoIdFront       | A photo of the front side of the document       |

### sealed class LicenseSource <a href="#h.au17vzy38ai3" id="h.au17vzy38ai3"></a>

A class for license that can be:

#### ***LicenseAssetId***

Contains the license ID.

| **Parameter** | **Type** | **Description** |
| ------------- | -------- | --------------- |
| id            | Int      | License ID      |

#### ***LicenseFilePath***

Contains the path to a license.

| **Parameter** | **Type** | **Description**               |
| ------------- | -------- | ----------------------------- |
| path          | String   | An absolute path to a license |

### class AnalysisStatus <a href="#h.qww0i8kvhvdr" id="h.qww0i8kvhvdr"></a>

A class for analysis status that can be:

#### ***RunningAnalysis***

This status means the analysis is launched.

| **Parameter** | **Type**                    | **Description**                                                           |
| ------------- | --------------------------- | ------------------------------------------------------------------------- |
| analysis      | [Analysis](#h.kt3ifyywae8e) | Contains information on what media to analyze and what analyses to apply. |

#### ***UploadingMedia***

This status means the media is being uploaded.

| **Parameter** | **Type**                           | **Description**                                 |
| ------------- | ---------------------------------- | ----------------------------------------------- |
| media         | [OzAbstractMedia](#h.s2ye0si7dzc2) | The object that is being uploaded at the moment |
| index         | Int                                | Number of this object in a list                 |
| from          | Int                                | Objects quantity                                |
| percentage    | Int                                | Completion percentage                           |

### enum Type <a href="#h.fr9jc6r5rcc" id="h.fr9jc6r5rcc"></a>

The type of the analysis.

| **Case**               | **Description**                                                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| BIOMETRY               | The algorithm that allows comparing several media and check if the people on them are the same person or not               |
| QUALITY                | The algorithm that aims to check whether a person in a video is a real human acting in good faith, not a fake of any kind. |
| DOCUMENTS (deprecated) | The analysis that aims to recognize the document and check if its fields are correct according to its type.                |

{% hint style="info" %}
Currently, the `DOCUMENTS` analysis can't be performed in the on-device mode.
{% endhint %}

### enum Mode <a href="#h.wu8r2jgbdoba" id="h.wu8r2jgbdoba"></a>

The mode of the analysis.

| **Case**      | **Description**                                                                                                                                                      |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ON\_DEVICE    | The on-device analysis with no server needed                                                                                                                         |
| SERVER\_BASED | The server-based analysis                                                                                                                                            |
| HYBRID        | The hybrid analysis for Liveness: if the score received from an on-device analysis is too high, the system initiates a server-based analysis as an additional check. |

{% hint style="info" %}
We recommend using server-based analyses whenever possible, as on-device ones tend to produce less accurate results.
{% endhint %}

### class Analysis <a href="#h.kt3ifyywae8e" id="h.kt3ifyywae8e"></a>

Contains information on what media to analyze and what analyses to apply.

| **Parameter**         | **Type**                                             | **Description**                                                                                                                            |
| --------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| type                  | Type                                                 | The type of the analysis                                                                                                                   |
| mode                  | Mode                                                 | The mode of the analysis                                                                                                                   |
| mediaList             | \[[OzAbstractMedia](#h.s2ye0si7dzc2)]                | An array of the OzAbstractMedia objects                                                                                                    |
| params (optional)     | Map\<String, Any>                                    | Additional parameters                                                                                                                      |
| sizeReductionStrategy | [SizeReductionStrategy](#enum-sizereductionstrategy) | Defines what type of media is being sent to the server in case of the hybrid analysis once the on-device analysis is finished successfully |

### enum Resolution <a href="#h.75elfp43805x" id="h.75elfp43805x"></a>

The general status for all analyses applied to the folder created.

| **Case**           | **Description**                                                                     |
| ------------------ | ----------------------------------------------------------------------------------- |
| FAILED             | One or more analyses failed due to some error and couldn't get finished             |
| DECLINED           | The check failed (e.g., faces don't match or some spoofing attack detected)         |
| SUCCESS            | Everything went fine, the check succeeded (e.g., faces match or liveness confirmed) |
| OPERATOR\_REQUIRED | The result should be additionally checked by a human operator                       |

### class OzAttemptsSettings <a href="#h.mcnxhgqzwow" id="h.mcnxhgqzwow"></a>

Holder for attempts counts before SDK returns error.

| **Parameter** | **Type** | **Description**                                                                |
| ------------- | -------- | ------------------------------------------------------------------------------ |
| singleCount   | Int      | Attempts on a single action/gesture                                            |
| commonCount   | Int      | Total number of attempts on all actions/gestures if you use a sequence of them |

### enum OzLocalizationCode <a href="#h.6x3wdw11shxa" id="h.6x3wdw11shxa"></a>

Contains the locale code according to [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).

| **Case** | **Description**        |
| -------- | ---------------------- |
| EN       | English                |
| HY       | Armenian               |
| KK       | Kazakh                 |
| KY       | Kyrgyz                 |
| TR       | Turkish                |
| ES       | Spanish                |
| PT-BR    | Portuguese (Brazilian) |

### class OzLogging <a href="#h.e9nrtxg93gro" id="h.e9nrtxg93gro"></a>

Contains logging settings.

| **Parameter**       | **Type**       | **Description**                                                     |
| ------------------- | -------------- | ------------------------------------------------------------------- |
| allowDefaultLogging | Boolean        | Allows logging to LogCat                                            |
| allowFileLogging    | Boolean        | Allows logging to an internal file                                  |
| journalObserver     | StatusListener | An event listener to receive journal events on the application side |

### sealed class Color <a href="#h.au17vzy38ai3" id="h.au17vzy38ai3"></a>

A class for color that can be (depending on the value received):

#### ***ColorRes***

| Parameter | Type | Description                                      |
| --------- | ---- | ------------------------------------------------ |
| resId     | Int  | Link to the color in the Android resource system |

#### ***ColorHex***

| **Parameter** | **Type** | **Description**           |
| ------------- | -------- | ------------------------- |
| hex           | String   | Color hex (e.g., #FFFFFF) |

#### ***ColorInt***

<table data-header-hidden><thead><tr><th width="239.33333333333331"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td>color</td><td>Int</td><td>The Int value of a color in Android</td></tr></tbody></table>

### enum GeometryType <a href="#h.ezntmzpm1j2k" id="h.ezntmzpm1j2k"></a>

Frame shape settings.

| **Case**  | **Description**   |
| --------- | ----------------- |
| Oval      | Oval frame        |
| Rectangle | Rectangular frame |
| Circle    | Circular frame    |
| Square    | Square frame      |

### class AnalysisError

Exception class for AnalysisRequest.

| Parameter    | Type   | Description   |
| ------------ | ------ | ------------- |
| apiErrorCode | Int    | Error code    |
| message      | String | Error message |

### class SourceMedia

Structure that describes media used in AnalysisRequest.

| Parameter    | Type                               | Description         |
| ------------ | ---------------------------------- | ------------------- |
| mediaId      | String                             | Media identifier    |
| mediaType    | String                             | Type of the media   |
| originalName | String                             | Original media name |
| ozMedia      | [OzAbstractMedia](#h.s2ye0si7dzc2) | Media object        |
| tags         | List\<String>                      | Tags for media      |

### class ResultMedia

Structure that describes the analysis result for the single media.

| **Parameter**   | **Type**                                           | **Description**              |
| --------------- | -------------------------------------------------- | ---------------------------- |
| confidenceScore | Float                                              | Resulting score              |
| isOnDevice      | Boolean                                            | Mode of the analysis         |
| resolution      | [Resolution](#h.75elfp43805x)                      | Consolidated analysis result |
| sourceMedia     | [SourceMedia](#constructor-data-class-sourcemedia) | Source media                 |
| type            | [Type](#h.fr9jc6r5rcc)                             | Type of the analysis         |

### class RequestResult

Consolidated result for all analyses performed.

| **Parameter**   | **Type**                                      | **Description**              |
| --------------- | --------------------------------------------- | ---------------------------- |
| analysisResults | List<[AnalysisResult](#class-analysisresult)> | Analysis result              |
| folderId        | String                                        | Folder identifier            |
| resolution      | [Resolution](#h.75elfp43805x)                 | Consolidated analysis result |

### class AnalysisResult

Result of the analysis for all media it was applied to.

| **Parameter**     | **Type**                                                 | **Description**                                    |
| ----------------- | -------------------------------------------------------- | -------------------------------------------------- |
| resolution        | [Resolution](#h.75elfp43805x)                            | Consolidated analysis result                       |
| type              | [Type](#h.fr9jc6r5rcc)                                   | Type of the analysis                               |
| mode              | [Mode](#h.wu8r2jgbdoba)                                  | Resulting score                                    |
| resultMedia       | List<[ResultMedia](#constructor-data-class-resultmedia)> | A list of results of the analyses for single media |
| confidenceScore   | Float                                                    | Resulting score                                    |
| analysisId        | String                                                   | Analysis identifier                                |
| params            | @RawValue Map\<String, Any>                              | Additional folder parameters                       |
| error             | [AnalysisError](#analysiserror)                          | Error if any                                       |
| serverRawResponse | String                                                   | Response from backend                              |

### class OzConnection

Defines the authentication method.

#### OzConnection.fromServiceToken

Authentication via token.

| **Parameter**      | **Type**                | **Description**          |
| ------------------ | ----------------------- | ------------------------ |
| host               | String                  | API address              |
| token              | String                  | Access token             |
| sslPins (optional) | List<[sslPin](#sslpin)> | Whitelisted certificates |

#### OzConnection.fromCredentials

Authentication via credentials.

| **Parameter**      | **Type**                | **Description**          |
| ------------------ | ----------------------- | ------------------------ |
| host               | String                  | API address              |
| username           | String                  | User name                |
| password           | String                  | Password                 |
| sslPins (optional) | List<[sslPin](#sslpin)> | Whitelisted certificates |

#### class OzUploadMediaSettings

Defines the settings for the repeated media upload.

|                 |          |                                     |
| --------------- | -------- | ----------------------------------- |
| **Parameter**   | **Type** | **Description**                     |
| attemptsCount   | Int      | Number of attempts for media upload |
| attemptsTimeout | Int      | Timeout between attempts            |

### enum SizeReductionStrategy

Defines what type of media is being sent to the server in case of the hybrid analysis once the on-device analysis is finished successfully. By default, the system uploads the compressed video.

| **Case**           | **Description**                                       |
| ------------------ | ----------------------------------------------------- |
| UPLOAD\_ORIGINAL   | The original video                                    |
| UPLOAD\_COMPRESSED | The compressed video                                  |
| UPLOAD\_BEST\_SHOT | The best shot taken from the video                    |
| UPLOAD\_NOTHING    | Nothing is sent (note that no folder will be created) |

### sslPin

Contains information about the [whitelisted certificates](/oz-knowledge/guides/developer-guide/sdk/oz-mobile-sdk/security-recommendations.md).

|               |                          |                                    |
| ------------- | ------------------------ | ---------------------------------- |
| **Parameter** | **Type**                 | **Description**                    |
| hash          | String                   | SHA256 key hash in base64          |
| expiredAt     | UNIX timestamp, UTC time | The date of certificate expiration |

## Data Container

The methods below apply to the new feature – [OzCapsula data container](/oz-knowledge/general/readme/proprietary-format-ozcapsula-data-container.md) that has been implemented in 8.22.

#### addContainer

This method replaces `addAnalysis` in the `AnalysisRequest` structure when you use the data container flow.

**Input**

|                 |              |                                                                                                                                        |
| --------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| **Parameter**   | **Type**     | **Description**                                                                                                                        |
| OzDataContainer | bytearray\[] | An encrypted file containing media and collateral info, the output of the [createMediaCaptureScreen](#createmediacapturescreen) method |

#### createMediaCaptureScreen

Captures media file with all information you need and packages it into a data container.

**Input**

| **Parameter**  | **Type**                                            | **Description**                                                 |
| -------------- | --------------------------------------------------- | --------------------------------------------------------------- |
| request        | [CaptureRequest](#public-data-class-capturerequest) | Detects a request for video capture                             |
| session\_token | String                                              | Stores additional information to protect against replay attacks |

**Output**

| **Parameter**   | **Type**     | **Description**                                        |
| --------------- | ------------ | ------------------------------------------------------ |
| OzDataContainer | bytearray\[] | An encrypted file containing media and collateral info |

#### public data class CaptureRequest

Detects a request for video capture.

| **Parameter**                  | **Type**                                                    | **Description**                                                                                 |
| ------------------------------ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| analysisProfileList            | List<[AnalysisProfile](#public-data-class-analysisprofile)> | A list of objects that contain information on media and analyses that should be applied to them |
| folderMeta (optional)          | Map\<String, Any>                                           | Additional folder metadata                                                                      |
| additionalMediaList (optional) | List<[MediaRequest](#public-sealed-class-mediarequest)>     | Media files that you need to upload to server, but it’s not necessary for analyses              |
| cameraPosition (optional)      | String                                                      | <p><code>front</code> (default) – front camera</p><p><code>back</code> – rear camera</p>        |

#### public data class AnalysisProfile

Contains information on media files and analyses that should be applied to them.

| **Parameter**     | **Type**                                                                                                                                            | **Description**                |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| mediaList         | List<[MediaRequest](#public-sealed-class-mediarequest)>                                                                                             | A list of media to be analyzed |
| type              | String ([Type](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/sdk/oz-mobile-sdk/android/pages/VCUMVrFbFl9Y2E7Flmdx#h.fr9jc6r5rcc)) | Analysis type                  |
| params (optional) | Map\<String, Any>                                                                                                                                   | Additional analysis parameters |

#### public sealed class MediaRequest

Stores information about a media file.

{% hint style="warning" %}
Please note: you should add `actionMedia` OR `userMedia`, these parameters are mutually exclusive.
{% endhint %}

| **Parameter** | **Type**                                                                                                                                               | **Description**                                               |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
| id            | String (UUID v4)                                                                                                                                       | Media ID                                                      |
| actionMedia   | [OzAction](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/sdk/oz-mobile-sdk/android/pages/VCUMVrFbFl9Y2E7Flmdx#h.2nyke2meu4aw)        | An action that user should perform in a video                 |
| userMedia     | [OzAbstractMedia](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/sdk/oz-mobile-sdk/android/pages/VCUMVrFbFl9Y2E7Flmdx#h.s2ye0si7dzc2) | An external media file, e.g., a reference or a document photo |

## Error Description

| **Error Code**                                     | **Error Message**                                                                       | **Description**                                                    |
| -------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| ERROR = 3                                          | Error.                                                                                  | An unknown error has happened                                      |
| ATTEMPTS\_EXHAUSTED\_ERROR = 4                     | Error. Attempts exhausted for liveness action.                                          | The number of action [attempts](#h.mcnxhgqzwow) is exceeded        |
| VIDEO\_RECORD\_ERROR = 5                           | Error by video record.                                                                  | An error happened during video recording                           |
| NO\_ACTIONS\_ERROR = 6                             | Error. OzLivenessSDK started without actions.                                           | No [actions](#h.2nyke2meu4aw) found in a video                     |
| FORCE\_CLOSED = 7                                  | Error. Liveness activity is force closed from client application.                       | A user closed the Liveness screen during video recording           |
| DEVICE\_HAS\_NO\_FRONT\_CAMERA = 8                 | Error. Device has not front camera.                                                     | No front camera found                                              |
| DEVICE\_HAS\_NO\_MAIN\_CAMERA = 9                  | Error. Device has not main camera.                                                      | No rear camera found                                               |
| DEVICE\_CAMERA\_CONFIGURATION\_NOT\_SUPPORTED = 10 | Error. Device camera configuration is not supported.                                    | Oz Liveness doesn't support the camera configuration of the device |
| FACE\_ALIGNMENT\_TIMEOUT = 12                      | Error. Face alignment timeout in OzLivenessSDK.config.faceAlignmentTimeout milliseconds | Time limit for the [face alignment](#h.2mu10566u3yp) is exceeded   |
| ERROR = 13                                         | The check was interrupted by user                                                       | User has closed the screen during the Liveness check.              |


---

# Agent Instructions: 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:

```
GET https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/sdk/oz-mobile-sdk/android/android-sdk-methods-and-properties.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
