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:

Latest version: 0.4.7

dependencies {
implementation("ai.secureprivacy.sdk:mobile-consent:LATEST_VERSION") // Replace LATEST_VERSION with the version shown above
// 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"

Dependency Versions & Compatibility

The SDK uses stable, production-tested versions of third-party libraries to ensure reliability.

You can override these versions if needed — Gradle will automatically resolve to the highest version.

👉 See Dependency Compatibility Guide for full details.

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 sets up the SDK, enables access to its features, and returns an instance of SPConsentEngine.

⚠️ SPConsentEngine is session-bound. If you call SPConsentEngine.clearSession(), re-run SPConsentEngine.initialise(...) and use the new instance before any further SDK calls.

👉 See Session Lifecycle & Reinitialization.

The Secure Privacy Mobile Consent SDK is fully compatible with Android TV.

  • The core SDK behavior remains the same as Android mobile.
  • SDK UI automatically adapts for D-pad (remote) navigation.
  • Consent banners and preference center are optimized for large screens.
  • No extra configuration, flags, or dependencies are required.

The SDK automatically detects Android TV and adjusts UI/behaviour as needed.

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

👉 View the Example App