> 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/other/old-docs/mobile-sdk/android/uploading-and-analyzing-media.md).

# Uploading and Analyzing Media

### Server-Based Analyzes

Data to be uploaded and analyzed is stored in object sdkMediaResult, obtained after capturing and recording video. Upload it to the server and initiate required analyses via [Oz API](/oz-knowledge/guides/developer-guide/api/oz-api.md).

A simple scenario of interaction with Oz API can be implemented with the`uploadMediaAndAnalyze` method as described below.

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

```kotlin
val statusListener = object: StatusListener<List<OzAnalysisResult>> {
            override fun onStatusChanged(status: String?) { /*your code for showing status message*/ }
            override fun onSuccess(result:List <OzAnalysisResult>) { /*your code to handle analysis result*/ }
            override fun onError(error: OzException) { /*your code to handle analysis error*/ }
        }
        val analysisCancelable = OzLivenessSDK.uploadMediaAndAnalyze(
            mediaList,
            listOf(OzAnalysis.QUALITY, OzAnalysis.BIOMETRY),
            statusListener
        )
```

{% endtab %}

{% tab title="Java" %}

```java
StatusListener<List<OzAnalysisResult>> statusListener = new StatusListener<List<OzAnalysisResult>>() {
            @Override public void onStatusChanged(@Nullable String s) { /*your code for showing status message*/ }
            @Override public void onSuccess(List<OzAnalysisResult> result) { /* your code to handle analysis result */ }
            @Override public void onError(@NonNull OzException e) { /* your code to handle analysis error */ }
        };
        Cancelable analysisCancelable = OzLivenessSDK.INSTANCE.uploadMediaAndAnalyze(
            mediaList,
            Arrays.asList(OzAnalysis.QUALITY, OzAnalysis.BIOMETRY),
            statusListener
        );
```

{% endtab %}
{% endtabs %}

#### On-Device Analyzes

To run the on-device analyses instead of server-based, use the following methods:

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

```kotlin
OzLivenessSDK.runOnDeviceLivenessAnalysis(mediaList)
OzLivenessSDK.runOnDeviceBiometryAnalysis(mediaList)
```

{% endtab %}

{% tab title="Java" %}

```java
OzLivenessSDK.INSTANCE.runOnDeviceLivenessAnalysis(mediaList);
OzLivenessSDK.INSTANCE.runOnDeviceBiometryAnalysis(mediaList);
```

{% endtab %}
{% endtabs %}


---

# 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/other/old-docs/mobile-sdk/android/uploading-and-analyzing-media.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.
