# On-Device Mode

The common way of Oz Mobile SDK to work is the server-based mode, when the Liveness and Biometry analyses are performed on a server as shown in the scheme below:

![](/files/9N8IZvCGFYW2WWJJ60sb)

But there's also an option to perform checks without server calls or even Internet connection. This option stands for on-device analyses.

![](/files/MIBuxStuZhgRJmabr26j)

The on-device analyses are being performed faster and more secure as all data is processed directly on device, nothing is being sent anywhere. In this case, you don’t need a server at all, neither need you the API connection.

{% hint style="info" %}
However, the API connection might be needed for some additional functions like telemetry or server-side SDK configuration.
{% endhint %}

The on-device analysis mode is useful when:

* you do not collect, store or process personal data;
* you need to identify a person quickly regardless of network conditions such as a distant region, inside a building, underground, etc.;
* you’re on a tight budget as you can save money on the hardware part.

### Launching the On-Device Analysis <a href="#h.rdlxn6nub647" id="h.rdlxn6nub647"></a>

To launch the on-device check, set the appropriate `mode` for Android or iOS SDK.

Android:

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
analysisCancelable = AnalysisRequest.Builder()
    .addAnalysis(Analysis(Analysis.Type.QUALITY, Analysis.Mode.ON_DEVICE, mediaToAnalyze))
```

{% endtab %}

{% tab title="Java" %}

```java
analysisCancelable = new AnalysisRequest.Builder()
    .addAnalysis(new Analysis(Analysis.Type.QUALITY, Analysis.Mode.ON_DEVICE, mediaList)) 
```

{% endtab %}
{% endtabs %}

iOS:

```swift
let analysis = Analysis.init(media: mediaToAnalyze, type: .quality, mode: .onDevice)
```

For details, please refer to the Checking Liveness and Face Biometry sections for [iOS](/oz-knowledge/guides/developer-guide/sdk/oz-mobile-sdk/ios/checking-liveness-and-face-biometry.md) and [Android](/oz-knowledge/guides/developer-guide/sdk/oz-mobile-sdk/android/checking-liveness-and-face-biometry.md).


---

# 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/on-device-mode.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.
