Android Kotlin
Install the Android SDK from Maven Central and initialize it in your Application class.
Install
Add the dependency to your module's build.gradle.kts. The artifact lives on Maven Central, so no extra repository is required.
app/build.gradle.kts
dependencies {
implementation("dev.capreolus:capreolus-android:0.1.0")
}Initialize
Call Capreolus.start from your Application.onCreate() so the SDK boots before any activity runs.
AcmeApp.kt
import android.app.Application
import dev.capreolus.android.Capreolus
class AcmeApp : Application() {
override fun onCreate() {
super.onCreate()
Capreolus.start(
this,
apiKey = "pub_xxx",
apiUrl = "https://api.capreolus.app"
)
}
}Don't forget to register the application class in your AndroidManifest.xml:
AndroidManifest.xml
<application
android:name=".AcmeApp"
... >
</application>Public API
| Symbol | Purpose |
|---|---|
Capreolus.start(context, apiKey, apiUrl) | Bootstraps the SDK. Idempotent. |
Capreolus.identify(userId, traits) | Associate the current session with a user. |
Capreolus.track(event, properties) | Emit a custom event. |
Capreolus.flush() | Force-send queued events. |
Capreolus.reset() | Clear the cached user identity (call on logout). |
Privacy
The SDK does not request the Advertising ID permission and works on Android 7.0 (API 24) and above. ProGuard / R8 rules are bundled with the artifact, so you don't need to maintain a keep file.
For apps targeting the Google Play Data Safety form, the SDK collects an anonymous install id and crash diagnostics — both classified as "App functionality".