This sample app demonstrates how to integrate the Clickio Consent SDK into a basic Android application using Kotlin.
In particular, it shows how to:
- Initialize the SDK with your site configuration
- Show a consent dialog on app launch
- Open the dialog again manually in resurface mode
- Display all received consent data on button click
Installation is simple:
- Clone or download the sample project.
- Open it in Android Studio.
- Build and run the app on a device or emulator.
No additional configuration is needed to get started — everything is included in the sample.
Initializes the Clickio Consent SDK in the Application
class:
class App : Application() {
override fun onCreate() {
super.onCreate()
with(ClickioConsentSDK.getInstance()) {
setLogsMode(LogsMode.VERBOSE)
initialize(
context = this@App,
config = ClickioConsentSDK.Config("241131", "en") // Replace "241131" with your own Site ID
)
}
}
}
- The
241131
in the lineconfig = ClickioConsentSDK.Config("241131", "en")
can be replaced with your own site identifier provided by Clickio.
Shows Consent Dialog on SDK's readiness and ads, defines a simple UI with three buttons:
-
"Open Consent Window in Resurface mode"
Opens the consent dialog in resurface mode, allowing the user to review or change their preferences. -
"Reload Consent Data from SharedPreferences"
Retrieves all stored consent data fromSharedPreferences
and displays it on screen. Useful for debugging and verifying SDK behavior. -
"Clear Data"
Clears defaultSharedPreferences