Android SDK

The Android SDK is the primary runtime integration for Snapbug.

Use it to stream inspection data from your app into the Chrome Extension, the optional local service flow, or a direct localhost/desktop connection.

Requirements

  • Android minSdk 23
  • Kotlin/AGP toolchain compatible with your app (the SDK ships as regular AARs)

Install

Add the core runtime in debug and the no-op twin in release:

dependencies {
    debugImplementation("ai.snapbug:snapbug:0.1.0")
    releaseImplementation("ai.snapbug:snapbug-no-op:0.1.0")
}

If you use a version catalog:

[versions]
snapbug = "0.1.0"
 
[libraries]
snapbug = { module = "ai.snapbug:snapbug", version.ref = "snapbug" }
snapbug-no-op = { module = "ai.snapbug:snapbug-no-op", version.ref = "snapbug" }

Start the SDK

Initialize Snapbug once from your main Activity:

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Snapbug.start(this)
    }
}

This one line enables the default plugin set: network, database, analytics, crash reporter, device info, deep links, logs, and the debug feedback overlay.

Optional configuration

You can customize the integration with the DSL — pick the overlay mode, toggle plugins on/off, or configure individual plugins:

Snapbug.start(this) {
    overlay = OverlayMode.BUBBLE   // BUBBLE (default), FAB, or NONE
    crashReporter { catchFatalErrors = true }
    database { room() }
    debugFeedback { screenNameProvider = { currentScreenName } }
    logs = true                    // logcat streaming (on by default)
}

Overlay modes:

  • BUBBLE — system floating bubble (requires the SYSTEM_ALERT_WINDOW permission). Default.
  • FAB — a Compose FAB, no special permissions, requires Snapbug.Overlay in your Compose tree.
  • NONE — no overlay UI, data collection only.

Logs

The logs plugin streams your app's logcat output (filtered to your process) into the Logs inspector in real time. It is part of the default plugin set — Log.d/i/w/e, println, and stack traces of uncaught exceptions all show up without extra setup. Disable it with logs = false in the start DSL.

Connection modes

Recommended: Chrome Extension

Use room-code pairing and WebRTC transport. This is the main onboarding path for new users.

Optional: local service

Run snapbug serve if you need AI workflows from the extension.

Direct: localhost/desktop

Connect through the local service or the desktop app over local ports 9023 and 9024.

Network security

If you use the direct localhost path on Android 9+, allow cleartext traffic to localhost and 127.0.0.1.

The Chrome Extension WebRTC path does not need this configuration.

Common plugin modules

Depending on your use case, you may also add more focused artifacts such as:

  • network interceptors (OkHttp, Ktor, gRPC)
  • crash reporter
  • analytics
  • database support (Room)
  • debug feedback

When a runtime artifact has a no-op pair, keep the debug/release swap symmetrical.

Next docs