Skip to main content
  1. Add the SDK Dependency
Add the following dependency to your app-level build.gradle file
implementation("io.github.twinnettechnologies:twinnet-analytics:1.0.1");
In your project-level build.gradle make sure the following plugins are configured:
plugins {
    id("com.android.application") version "8.2.0" apply false
    id("org.jetbrains.kotlin.android") version "1.9.10" apply false
}
  1. Initializing Analytics SDK in Android
Initialize the SDK in your Application class to start tracking sessions, events, and insights.
class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        Analytics.initialize(
            this,
            "YOUR_API_KEY",
            "YOUR_ORG_ID
        )
    }
}
ParameterDescription
applicationAndroid application context
apiKeyYour Project API key
orgIdYour organization ID (e.g. twinnet_demo)
✅ Best Practice
Always call initialize() inside your Application class — not inside an Activity — to ensure complete session tracking.
class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        Analytics.Companion.initialize(
            this,
            "YOUR_API_KEY",
            "YOUR_ORG_ID"
        )
    }
}