> For the complete documentation index, see [llms.txt](https://doc.ozforensics.com/oz-knowledge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/sdk/oz-mobile-sdk/on-device-mode.md).

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

![](https://2532558063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5g6dgsxRbyrCvB0uAf8f%2Fuploads%2Fo8OlhguUpNfbitPT0WEV%2Fservercheck.jpg?alt=media\&token=eeb39acc-4809-4da2-80dc-13213709c560)

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

![](https://2532558063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5g6dgsxRbyrCvB0uAf8f%2Fuploads%2FMacXggh5hDkGQdZngtrF%2Fondevicecheck.jpg?alt=media\&token=79c8efd0-4901-4e54-885c-8fc1f19c34a0)

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
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://doc.ozforensics.com/oz-knowledge/guides/developer-guide/sdk/oz-mobile-sdk/on-device-mode.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.
