Skip to content
Codeskop

Android installation

Add the Codeskop Android SDK to your app with a single Gradle dependency.

Requirements

  • Android minSdk 24 (Android 7.0) or higher.
  • Kotlin. The SDK's API is designed for Kotlin callers.
  • For network capture: OkHttp 4 in your app (directly, or through Retrofit). The adapter uses your app's OkHttp and doesn't bundle its own.

Add the dependencies

The SDK is published to Maven Central, which every Android project already includes, so you don't need an extra repository. Add it to your app module:

app/build.gradle.kts
dependencies {    // Crashes, ANRs, users and sync. Brings in tracker-core automatically.    implementation("com.codeskop.sdk:tracker-android:0.3.0")     // Optional: failing requests and latency from OkHttp / Retrofit.    // Also needs one line on your OkHttpClient (see "Network capture").    implementation("com.codeskop.sdk:tracker-okhttp:0.3.0")}

If you use a Gradle version catalog:

gradle/libs.versions.toml
[versions]codeskop = "0.3.0"[libraries]codeskop-android = { module = "com.codeskop.sdk:tracker-android", version.ref = "codeskop" }codeskop-okhttp = { module = "com.codeskop.sdk:tracker-okhttp", version.ref = "codeskop" }
app/build.gradle.kts
dependencies {    implementation(libs.codeskop.android)    implementation(libs.codeskop.okhttp)}

Keep every artifact on the same version

tracker-core, tracker-android and tracker-okhttp are released together. Always use the same version for all of them. The current version is 0.3.0.

The three modules

The SDK is split into three artifacts. Most apps add tracker-android, and tracker-okhttp if they use OkHttp or Retrofit.

tracker-core: the engine

Platform-independent Kotlin Multiplatform code shared by Android, iOS and Flutter. It holds the public Codeskop API you call from your app (identify, reset, recordException, setEnabled, flush), plus everything that happens to an event before it leaves the device: redaction, sampling, the durable on-device queue, compressed batch upload, retries, and remote config with the kill-switch.

You don't add it yourself on Android. tracker-android brings it in. Depend on it directly only from shared Kotlin Multiplatform code.

tracker-android: crashes, devices and customers

The Android runtime. It's the one you install. It:

  • starts the SDK, either from your manifest with no code or from Application.onCreate;
  • captures crashes, native crashes and ANRs, with the crash handler installed before the SDK makes any network call, so crashes during startup are kept too;
  • attaches the device and app context to every event: model, manufacturer, Android version, app version, package and locale. The dashboard uses it to show which devices, OS versions and releases an issue affects;
  • stores events on disk and uploads them with WorkManager, as soon as the device is online;
  • sends lightweight foreground heartbeats, which power the live active-user count.

How it recognizes your customers. On first launch, tracker-android creates a random install ID, stored in encrypted storage on the device. It isn't tied to the hardware or the advertising ID, and every event carries it. When a user signs in, call Codeskop.identify(userId) with your own user ID. From then on, events carry that ID too, so one customer is recognized across sessions, reinstalls and devices, and every issue shows how many distinct users it hit. See Identify users.

tracker-okhttp: network calls

An OkHttp interceptor and event listener that record failing requests (4xx, 5xx, timeouts, connection errors) and the timing of every request, with no per-endpoint setup. It works with anything built on OkHttp, including Retrofit and Ktor's OkHttp engine.

Adding the dependency isn't enough. OkHttp has no global hook, so you also register the adapter on the client your app uses:

NetworkModule.kt
import com.codeskop.sdk.okhttp.codeskop val client = OkHttpClient.Builder()    .codeskop()   // failed requests + timing for every call    .build()

More in Network capture, including where the results appear on the dashboard.

Permissions and manifest entries

The SDK's manifest merges these into your app. You don't need to add them yourself:

  • android.permission.INTERNET: to send events.
  • android.permission.ACCESS_NETWORK_STATE: to sync as soon as the device is back online.
  • An AndroidX App Startup entry, used for zero-code initialization. It does nothing unless you add your key to the manifest.

The SDK also depends on AndroidX WorkManager and App Startup. If your app already uses them, Gradle resolves a single shared version.

R8 / ProGuard

No setup needed. The keep rules the SDK needs ship inside the library and are applied to your release build automatically, whether you use R8 or ProGuard.

Readable stack traces in release builds

If your app is minified, crash stack traces show obfuscated class and method names, just like in any other crash tool. Keep the mapping.txt that R8 produces for each release so you can map traces back to your source.

Next steps