Android (Kotlin) with AllStak

Capture crashes, errors, ANRs, and performance from your Android app with the AllStak Android SDK.

Source repository:
AllStak/allstak-android
Source README:
README.md
SDK version:
0.2.0
Installation source:
Maven (sa.allstak)
Last verified:
2026-05-31

Installation

Add the Gradle dependency (optional OkHttp and Timber modules).

dependencies {
    implementation("sa.allstak:allstak-android:0.2.0")
    // optional:
    implementation("sa.allstak:allstak-android-okhttp:0.2.0")
    implementation("sa.allstak:allstak-android-timber:0.2.0")
}

Configuration

Initialize explicitly in Application, or use zero-code manifest meta-data (androidx.startup auto-init).

AllStak.init(this) {
    apiKey = "ask_live_xxx"
    environment = "production"
    release = "1.4.0+42"
}

Basic example

Zero-code alternative — add meta-data to AndroidManifest.xml.

<application>
    <meta-data android:name="sa.allstak.android.API_KEY" android:value="ask_live_xxx" />
    <meta-data android:name="sa.allstak.android.ENVIRONMENT" android:value="production" />
</application>

Capturing errors

Crashes are captured automatically (enableUncaughtExceptionHandler). Capture handled errors manually.

AllStak.captureException(e, metadata = mapOf("orderId" to "ORD-123"))
AllStak.captureMessage("Checkout started", level = "info")

Tracking requests

Use the allstak-android-okhttp module to instrument OkHttp — installAllStak() on the builder, AllStakOkHttp.client(), or AllStakOkHttp.instrument(existingClient). It injects trace headers (traceparent, x-allstak-trace-id).

val client = OkHttpClient.Builder()
    .installAllStak()
    .build()

Best practices

  • Use manifest meta-data or AllStak.init in Application.
  • Add the OkHttp module to trace network calls.
  • release auto-detects from versionName+versionCode if omitted.