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