Skip to main content

Initialization

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 for more details.

Configuration via AcessoBioConfigDataSource

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

UnicoConfig.kt
import com.acesso.acessobio_android.onboarding.AcessoBioConfigDataSource

class UnicoConfig : AcessoBioConfigDataSource {
override fun getBundleIdentifier(): String = BUNDLE_IDENTIFIER
override fun getHostKey(): String = 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:

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

For the full list of available environment types, refer to API Reference > Initialization API.

Configuring camera mode

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

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

The true/false values for setAutoCapture and setSmartFrame do not alter the capture experience — they are used only for the internal logic of the SDK.