Skip to main content

SDK Installation (Android)

Detour provides an Android SDK (com.swmansion:detour) for deferred deep links, app links, and scheme links.

Beta

Android SDK 1.0.0 is currently in beta. APIs and integration details may still change before stable release.

Before installation, make sure your app is created in the Detour Dashboard and you have:

  • appId from API configuration
  • publishable apiKey from API configuration
  • Android link integration snippet from App configuration

Requirements

  • Android min SDK: 21 (Android 5.0+)
  • Kotlin: 2.0+
  • JVM target: 11

Add dependency

dependencies {
implementation("com.swmansion:detour:1.0.0")
}

Configure credentials

Store credentials in config/environment and pass them through BuildConfig (same pattern as SDK examples):

// app/build.gradle.kts
buildConfigField("String", "DETOUR_API_KEY", "\"${secrets["DETOUR_API_KEY"] ?: ""}\"")
buildConfigField("String", "DETOUR_APP_ID", "\"${secrets["DETOUR_APP_ID"] ?: ""}\"")
// Activity/Application code
val config = DetourConfig(
apiKey = BuildConfig.DETOUR_API_KEY,
appId = BuildConfig.DETOUR_APP_ID
)

Initialize SDK once

Call Detour.initialize(...) once before processing links.

Detour.initialize(applicationContext, config)

You can initialize in Application.onCreate() or in the first activity before calling processLink() / getDeferredLink().

Manifest integration

Add VIEW intent filters for links you want Android to dispatch to your app:

  • verified App Links (https://...) from Dashboard snippet
  • optional custom URI scheme (myapp://...)

Example SDK apps use this pattern in AndroidManifest.xml and handle both app links and scheme links in one flow.

Next steps

  1. Wire DetourDelegate or manual processing in SDK Usage.
  2. Pick the closest runnable pattern in Examples.