Skip to main content
The Klaritics Android SDK collects analytics from Android applications and sends them to your self-hosted Klaritics instance. This guide covers Gradle setup, initialization, event logging, and user identification.

Installation

Add the Maven dependency to your module-level build.gradle or build.gradle.kts:
Replace x.x.x with the latest version number.

Initialization

Initialize the SDK in your Application class or main entry point before logging any events:
The SDK will not initialize until both appId and serverHost are provided.

Logging events

Use logAppEvent for standard analytics events and logClientEvent for client-specific events.

User identification

Link events to a known user with setUserIdentifier:
Retrieve the SDK-generated device identifier:

Important naming note

The client-facing class is Klaritics. Do not use KlariticsSDK, KlariticsCore, or any other variant in your application code.