Skip to content

Setup and Installation

The Secure Privacy Consent Management SDK provides developers with an easy way to manage user consent within their applications. By integrating this SDK, you can ensure compliance with privacy regulations while offering users control over their data preferences.

To use the Secure Privacy Consent Management SDK, you need an Application ID. Sign up for a free trial at Secure Privacy to get your Application ID.

To begin using the Secure Privacy SDK for Android, include the SDK dependency in your project along with some additional dependencies.

  1. Add the SDK dependency to your build.gradle:
dependencies {
implementation("ai.secureprivacy.sdk:mobile-consent:0.3.0-beta")
// Standard libraries
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
// Required libraries for the SDK
implementation(libs.retrofit)
implementation(libs.gson)
implementation(libs.converterGson)
implementation(libs.converterScalars)
implementation(libs.cryptoKtx)
}
  1. Ensure the following library versions are included in your libs configuration:
retrofit = "2.11.0"
gson = "2.11.0"
converterGson = "2.11.0"
converterScalars = "2.11.0"
cryptoKtx = "1.1.0-alpha06"

To initialize the SDK, call the following method with your applicationId in your main activity or app initialization code. You may also include secondaryApplicationId, which is an optional parameter used to display a secondary consent banner in your app:

val spConsentEngine = SPConsentEngine.initialise(
activity, SPAuthKey(
applicationId = "YOUR_APPLICATION_ID",
secondaryApplicationId = "YOUR_SECONDARY_APPLICATION_ID"
)
)

This will set up the SDK and enable access to its features and returns an instance of SPConsentEngine.

Check out Secure Privacy Android SDK – Example App on GitHub!

👉 View the Example App