Install
Install on Android
Add the Sankofa Android SDK to your app via Maven Central, with auto-registered lifecycle tracking and offline-first event queueing.
The Sankofa Android SDK is a single Kotlin-first library, distributed through Maven Central as dev.sankofa.sdk:sankofa-android. It bundles six products (Analytics, Catch, Switch, Config, Pulse, Replay), auto-registers across all Activities, and uses WorkManager for reliable background flushing. OTA Deploy is not exposed on Android — for hybrid apps that need OTA, use the React Native SDK.
Requirements
- Android Studio Hedgehog or newer
minSdk 24(Android 7.0)compileSdk 34+recommended- Kotlin 1.9+ (Java 8 is also supported)
1. Add the dependency
dependencies {
implementation("dev.sankofa.sdk:sankofa-android:1.0.0")
}dependencies {
implementation 'dev.sankofa.sdk:sankofa-android:1.0.0'
}<dependency>
<groupId>dev.sankofa.sdk</groupId>
<artifactId>sankofa-android</artifactId>
<version>1.0.0</version>
<type>aar</type>
</dependency>Make sure mavenCentral() is in your repositories list (the default for new Android Studio projects).
2. Bump minSdk and enable Java 8
The SDK targets minSdk 24 and uses Java 8 features. Update your module's Gradle config if needed:
android {
namespace = "com.example.app"
compileSdk = 35
defaultConfig {
minSdk = 24
targetSdk = 35
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}3. Initialize in Application.onCreate
The SDK must initialize before the first Activity, so place the call in your Application subclass.
import android.app.Application
import dev.sankofa.sdk.Sankofa
import dev.sankofa.sdk.SankofaConfig
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Sankofa.init(
context = this,
apiKey = BuildConfig.SANKOFA_KEY,
config = SankofaConfig(
endpoint = "https://api.sankofa.dev",
recordSessions = true,
maskAllInputs = true,
debug = BuildConfig.DEBUG,
),
)
}
}Register the application class in your manifest:
<application
android:name=".MyApplication"
android:label="@string/app_name">
...
</application>Pass the API key through BuildConfig (recommended) or via local.properties so it never lands in version control.
Common config options
endpointStringdefault https://api.sankofa.devrecordSessionsBooleandefault truemaskAllInputsBooleandefault truedebugBooleandefault falsetrackLifecycleEventsBooleandefault trueflushIntervalSecondsIntdefault 30batchSizeIntdefault 504. Verify the install
Sankofa.track("install_check", mapOf("from" to "android-quickstart"))Run the app, then open app.sankofa.dev → Live events. The event should appear with an android source label.