Android
Integrating Verisoul in Android Apps
Verisoul provides a native Android SDK that allows you to implement fraud prevention in your Android applications. This guide covers the installation, configuration, and usage of the Verisoul Android SDK.
Installation
Repository Setup
Add the Verisoul repository to your project’s settings.gradle
file:
Add Dependency
Add the Verisoul SDK dependency to your app’s build.gradle
file:
For Groovy DSL
For Kotlin DSL
If you’re using the Kotlin DSL with a version catalog, add these lines to your libs.versions.toml
file:
Under the [versions]
section:
Under the [libraries]
section:
Permissions
The SDK requires internet access, which is automatically added to your manifest through the SDK’s manifest.
Initialization
Initialize the Verisoul SDK in your Application class:
Don’t forget to register your Application class in the AndroidManifest.xml
:
When initialized, the Verisoul library will gather initial device data and generate a session ID that will be uploaded to the Verisoul backend.
Usage
Getting the Session ID
Once the minimum amount of data is gathered, the session ID becomes available. The session ID is needed to request a risk assessment from Verisoul’s API. Note that session IDs are short-lived and will expire after 24 hours.
Providing Touch Events
To gather touch events and compare them to device accelerometer sensor data, you need to provide touch events to Verisoul. Create a BaseActivity
class, override the dispatchTouchEvent
function, and pass the data to Verisoul:
Then use this BaseActivity
as the base class for your activities:
Next Steps
- Learn about Backend Integration for API implementation
- See Integration Best Practices
- Explore iOS Integration for Apple devices
- See the Android Sample App for a complete implementation