Android SDK Integration

Install TrackNova in an Android app with minimal developer effort.

The target developer experience is simple: add one dependency, initialize once in Application.onCreate(), allow automatic install tracking, and only call event methods when needed.

Base URL https://trk.tracknova.in
SDK Version 0.1.0
Maven Coordinate io.tracknova:sdk-android:0.1.0

Quickstart

The intended integration path is:

  1. Add one SDK dependency.
  2. Store appKey, keyId, and signingSecret in your build secret flow.
  3. Initialize the SDK once in Application.onCreate().
  4. Leave automatic install tracking enabled.
  5. Track only the in-app events you want reported.

1. Add the SDK dependency

Use a single dependency line in the Android app. Avoid manual request signing code in the host application.

build.gradle.kts
repositories {
    google()
    mavenCentral()
}

dependencies {
    implementation("io.tracknova:sdk-android:0.1.0")
}

2. Handle credentials safely

TrackNova issues one credential set per registered mobile app:

  • appKey
  • keyId
  • signingSecret
Public docs guidance: do not paste the signing secret into source-controlled Gradle files. Keep it in a secure build or secret-management flow and expose it to the app only at build time.

What to do

Issue credentials in TrackNova, store them in your secure CI or secret manager, and inject them into the build pipeline for the Android app.

What to avoid

Do not commit the signing secret to Git, do not place it in shared plaintext docs, and do not teach developers to hardcode it into tracked project files.

Your Android app can still read values from BuildConfig or another runtime configuration surface, but those values should be fed by secure build-time injection, not manually pasted into public or versioned files.

3. Initialize once in Application

This should be the only required startup code for automatic install tracking. The runtime code stays clean even when the credential source is handled securely upstream.

Application.kt
class App : Application() {
    override fun onCreate() {
        super.onCreate()

        val config = TrackNovaConfig.Builder(
            baseUrl = "https://trk.tracknova.in",
            credentialProvider = TrackNovaConfig.CredentialProvider {
                TrackNovaConfig.Credentials(
                    appKey = BuildConfig.TRACKNOVA_APP_KEY,
                    keyId = BuildConfig.TRACKNOVA_KEY_ID,
                    signingSecret = BuildConfig.TRACKNOVA_SIGNING_SECRET,
                )
            },
        )
            .automaticInstallTracking(true)
            .build()

        TrackNova.initialize(applicationContext, config)
    }
}
Safe pattern: keep the app code simple, but source the credential values from secure build-time injection managed by your engineering or release pipeline.

Install endpoint: POST https://trk.tracknova.in/api/v1/sdk/install
Event endpoint: POST https://trk.tracknova.in/api/v1/sdk/event

4. Track events only when needed

If the app only needs install attribution, this can be added later.

Common starter events

A practical starter set is install, signup, trial_started, purchase, and subscription_renewed.

Authoritative event list

The actual event names your app should send should come from TrackNova’s app setup UI, where mappings can differ by app, tenant, and commercial configuration.

purchase event
TrackNova.trackEvent(
    TrackNovaEvent(
        name = "purchase",
        revenue = BigDecimal("49.99"),
        currency = "USD",
        value = mapOf("plan" to "annual"),
    ),
)
Use public docs for conventions and examples. Use the app-specific “Available Event Names” panel inside TrackNova as the source of truth for the exact event names your Android app should emit.

Verification checklist

  1. Register the Android app in TrackNova.
  2. Store appKey, keyId, and signingSecret in your secure build workflow.
  3. Install the SDK and initialize it without committing secret material to source control.
  4. Install the app on a test device from the intended distribution path.
  5. Confirm the install appears in Mobile Analytics.
  6. Trigger a test event and confirm it appears in event reporting.