> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/verify/liveness/integration/liveness-sdk/android-sdk/getting-started.md).

# Getting Started

This guide walks through integrating the VIDA Liveness SDK into your Android application — adding the repository and SDK dependency, configuring your activation key, and setting up the liveness request. If your account uses ID Fraud Shield, the additional steps are called out along the way.

{% hint style="info" %}
**Before you begin: Get your keys**\
To access the VIDA SDK you need a Repo API Key and an Activation Key. If you don't have them yet, reach out to the [**VIDA support team.**](mailto:support@vida.id)\
\
**Using ID Fraud Shield?**

The `userId` is **optional from Liveness SDK `v1.9.6+`** — if you do not provide one, the SDK uses a default value — but we recommend setting your own so fraud rules can be applied per user.

On versions earlier than `v1.9.6`, the `userId` is **required** when ID Fraud Shield is enabled. Not setting it will result in an error.
{% endhint %}

## 1. Add the VIDA Repository

In your project's `build.gradle` file, add the following to include Vida's repository and credentials. Replace `REPO-API-KEY` with the Repo API Key provided by VIDA.

<details>

<summary>Response</summary>

{% code expandable="true" %}

```groovy
maven {
   url "https://sdk-repo.dev.vida.id/android"
   credentials(HttpHeaderCredentials) {
       name = "x-api-key"
       value = "REPO-API-KEY"
   }
   authentication {
       header(HttpHeaderAuthentication)
   }
}
```

{% endcode %}

</details>

## 2. Add the SDK Dependency

In your app's `build.gradle` file, add the SDK dependency for your environment. Add the ID Fraud Shield dependency only if ID Fraud Shield is enabled for your account. Replace\
`X.Y.Z` with the SDK version you are using.

#### Production Environment

<details>

<summary>Response</summary>

{% code expandable="true" %}

```groovy
//Production 
implementation "id.vida:liveness:X.Y.Z"// For Production 

//If ID Fraud Shield is Enabled. 
implementation "id.vida:idFraudShield:1.0.2" 
implementation "id.vida:idFraudShield-sandbox:1.0.2"

//implementation "id.vida:idFraudShield:X.Y.Z" for Production
//implementation "id.vida:idFraudShield-sandbox:X.Y.Z" for Sandbox
```

{% endcode %}

</details>

#### Sandbox Environment

<details>

<summary>Response</summary>

{% code expandable="true" %}

```groovy
//Sandbox 
implementation "id.vida:liveness-sandbox:X.Y.Z" // For sandbox

//ID Fraud Shield is Enabled.
implementation "id.vida:idFraudShield-sandbox:X.Y.Z" // For sandbox  
```

{% endcode %}

</details>

### Permissions

{% hint style="info" %}
**You don't add these permissions manually**\
\
Liveness and ID Fraud Shield are separate libraries. Bundling ID Fraud Shield alongside Liveness doesn't combine them into a single SDK - it simply pulls in an additional library as part of the execution flow. The permissions each library needs are independent and scoped to that library, so the ID Fraud Shield permissions are **not** declared under Liveness.\
\
You don't need to declare any of these permissions in your manifest yourself - they are merged into your app automatically when it compiles, from the dependencies you added above. To learn more about the additional library, see the [**ID Fraud Shield SDK**](/identity-stack/verify/liveness/overview/id-fraud-shield.md) documentation.
{% endhint %}

In your app's `AndroidManifest.xml` file, add the following permissions

<details>

<summary>Response</summary>

{% code expandable="true" %}

```xml
Permissions - Required for All Integrations:
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Permissions - Required for ID Fraud Shield:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
```

{% endcode %}

</details>

#### What each permissions is for

The reference below shows the permissions each library declares, so you're aware of what your app will request. Permissions marked All ship with the Liveness SDK, those marked\
ID Fraud Shield ship with the ID Fraud Shield SDK and only apply when that library is included.

<table><thead><tr><th width="228.0625">Permission</th><th width="283.89453125">Purpose</th><th>Required For</th></tr></thead><tbody><tr><td><code>CAMERA</code></td><td>Capture the user's face for liveness detection</td><td>All</td></tr><tr><td><code>INTERNET</code></td><td>Communicate with VIDA servers</td><td>All</td></tr><tr><td><code>ACCESS_NETWORK_STATE</code></td><td>Check network connectivity before a request</td><td>All</td></tr><tr><td><code>ACCESS_WIFI_STATE</code></td><td>Read Wi-Fi connection details</td><td>All</td></tr><tr><td><code>ACCESS_COARSE_LOCATION</code></td><td>Approximate location as a fraud-risk signal</td><td>ID Fraud Shield</td></tr><tr><td><code>ACCESS_FINE_LOCATION</code></td><td>Precise location as a fraud-risk signal</td><td>ID Fraud Shield</td></tr><tr><td><code>USE_BIOMETRIC</code></td><td>Device biometric verification</td><td>ID Fraud Shield</td></tr><tr><td><code>USE_FINGERPRINT</code></td><td>Fingerprint verification on older devices</td><td>ID Fraud Shield</td></tr><tr><td><code>READ_GSERVICES</code></td><td>Read Google Services device identifiers for device fingerprinting</td><td>ID Fraud Shield</td></tr></tbody></table>

{% hint style="info" %}
**Note on location permissions**

Location is used only as a fraud-risk signal during verification. If your app targets the Google Play Store or is subject to a security review, be prepared to declare this purpose, as location\
access is commonly flagged during review.
{% endhint %}

## 3. Add SDK Activation Key

In your application's `AndroidManifest.xml` file, add the SDK activation key. Replace `VIDA-ACTIVATION_KEY` with the activation key provided by Vida.

```xml
<meta-data android:name="vida_activation_key" android:value="VIDA-ACTIVATION_KEY" />
```

## 4. Configure the liveness request&#x20;

The `VIDALivenessRequest` object defines the configuration for the liveness flow.

<table><thead><tr><th width="132.90234375">Property</th><th width="105.67578125">Type</th><th width="149.1640625">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td>String</td><td>Required</td><td>API key provided by VIDA.</td></tr><tr><td><code>licenseKey</code></td><td>String</td><td>Required</td><td>License key provided by VIDA.</td></tr><tr><td><code>eKYCID</code></td><td>String</td><td>Optional</td><td>ID for the user's eKYC for which the liveness is to be done.</td></tr><tr><td><code>userId</code></td><td>String</td><td>Optional (if ID Fraud Shield Enabled)</td><td>UserId to be tracked in <code>idFraudShield</code>. If you do not provide one, the SDK uses a default value. Recommended when <code>idFraudShield</code> is enabled for the flow, so fraud rules can be applied per user.</td></tr></tbody></table>
