---
title: Initialization
canonical: https://developer.unico.io/dual-api/developers/sdks-and-tools/android/initialization
locale: en
generated_by: markdown-export
---

## Where to initialize

Initialize the SDK on **application load** — typically in the `Application` class or in the `onCreate` of your entry Activity. SDK authentication with the backend takes a few seconds, so initializing early avoids lag between the user tapping the capture button and the camera opening. See [Best practices](/developers/sdks-and-tools/android/resources) for more details.

## Configuration via AcessoBioConfigDataSource

Create a class that implements `AcessoBioConfigDataSource` and exposes the credentials obtained from the Onboarding team:

### Kotlin

  ```kotlin title="UnicoConfig.kt"
  import com.acesso.acessobio_android.onboarding.AcessoBioConfigDataSource

  class UnicoConfig : AcessoBioConfigDataSource {
    override fun getBundleIdentifier(): String = BUNDLE_IDENTIFIER
    override fun getHostKey(): String = SDK_KEY
  }
  ```

### Java

  ```java title="UnicoConfig.java"
  import com.acesso.acessobio_android.onboarding.AcessoBioConfigDataSource;

  public class UnicoConfig implements AcessoBioConfigDataSource {
    @Override
    public String getBundleIdentifier() {
      return BUNDLE_IDENTIFIER;
    }

    @Override
    public String getHostKey() {
      return SDK_KEY;
    }
  }
  ```

## Environment selection

The choice between **sandbox** and **production** is made during initialization. Pass the desired environment via `setEnvironment` when building the SDK instance:

### Kotlin

  ```kotlin
  var acessoBioBuilder: IAcessoBioBuilder = AcessoBio(activity, createCallback()).apply {
    setEnvironment(Environment.UAT)
  }
  ```

### Java

  ```java
  IAcessoBioBuilder acessoBioBuilder = new AcessoBio(activity, createCallback());
  acessoBioBuilder.setEnvironment(Environment.UAT);
  ```

For the full list of available environment types, refer to [API Reference > Initialization API](/developers/sdks-and-tools/android/api-reference/initialization-api).

## Configuring camera mode

Build the `UnicoCheckCamera` instance from the `acessoBioBuilder`, configuring smart capture behaviour and locale:

### Kotlin

  ```kotlin
  val unicoCheckCamera: UnicoCheckCamera = acessoBioBuilder
      .setAutoCapture(true)
      .setSmartFrame(true)
      .setLocale(LocaleTypes.EN_US)
      .build()
  ```

### Java

  ```java
  UnicoCheckCamera unicoCheckCamera = acessoBioBuilder
      .setAutoCapture(true)
      .setSmartFrame(true)
      .setLocale(LocaleTypes.EN_US)
      .build();
  ```