Skip to main content
To run the SDK a Verisoul Project ID is required. Schedule a call here to get started.

System Requirements

  • Android 7.0 (API level 24) or higher
  • Kotlin 1.5 or higher
  • Gradle 7.0 or higher
  • SDK Size: ~410 KB

Installation

Add Maven Repository

Add these lines to your settings.gradle file.

Add Dependency

Add these lines to your build.gradle file.

For Groovy DSL

For Kotlin DSL

Add these lines to your libs.versions.toml file. Under the [versions] add:
Under the [libraries] add:

Usage

Initialize the SDK

Call init() before you intend to retrieve a Verisoul session_id. The example below initializes in your Application class’s onCreate() method; if you do this, make sure to register the Application class in your AndroidManifest.xml. Application class:
AndroidManifest.xml:
The init() method initializes the Verisoul SDK with your project credentials. Only initialize the SDK if you plan to retrieve a session_id and call the Verisoul API for that session. Parameters:
  • context: Your application context
  • environment: The environment to use VerisoulEnvironment.Prod for production or VerisoulEnvironment.Sandbox for testing
  • projectId: Your unique Verisoul project identifier

Get Session ID

The getSessionId() method returns the current session identifier after the SDK has collected sufficient device data. This session ID is required to request a risk assessment from Verisoul’s API. Important Notes:
  • Session IDs are short-lived and expire after 24 hours
  • The session ID becomes available once minimum data collection is complete (typically within seconds)
  • You should send this session ID to your backend, which can then call Verisoul’s API to get a risk assessment
Example:

Provide Touch Events

In order to gather touch events and compare them to device accelerometer sensor data, the app will need to provide touch events to Verisoul. The way to achieve this is to create BaseActivity, to override dispatchTouchEvent function and pass the data to Verisoul like shown below.
In the application, just use BaseActivity as an Activity base class.

Error Codes

The SDK throws VerisoulException with the following error codes:

Exception Structure

All errors are thrown as VerisoulException with the following properties:

Google Play Data Safety

For information on how to complete the Google Play Data Safety section when using the Verisoul SDK, please refer to our Data Safety Instructions.

Example

For a complete working example, see the Android Sample App.