Android SDK
The Kape Android SDK is a Kotlin-first library that wraps the Low Level SDK and provides an idiomatic Android API. It integrates with Jetpack components, exposes coroutine-based APIs, and handles credential storage via Android DataStore.
Modules
| Module | Purpose |
|---|---|
| KapeCore | SDK initialization, configuration, encrypted DataStore storage, logging, log upload — see Logs Collector |
| KapeAuth | OpenID Connect authentication with PKCE |
| KapeVpn | Server locations, tunnel lifecycle, and the KapeVpnService foreground service |
Each module is published as a separate artifact. Integrations should depend only on what your app needs:
dependencies {
implementation("com.kape:kape-core:1.0.0") // Always required
implementation("com.kape:kape-auth:1.0.0") // For authentication
implementation("com.kape:kape-vpn:1.0.0") // For VPN connectivity
}
Quick Example
val settings = KapeSDKSettings.fromXml(context, R.xml.kape_sdk_settings)
val handle = KapeSdkHandle(settings, context)
val auth = KapeAuthClient(handle)
val vpn = KapeVpnManager(
handle,
protocols = listOf(KapeWireGuardSupport, KapeLightwaySupport, KapeOpenVpnSupport),
)
val locations = vpn.createLocationService()
// In a coroutine (e.g. viewModelScope.launch):
when (auth.login(context)) {
is LoginResult.Success -> {
locations.fetchLocations() // the handle has already picked the subscription
vpn.prepare(activity)?.let { consentLauncher.launch(it) } // one-time system consent
vpn.connect(KapeConnectionMode.Auto)
}
is LoginResult.AuthCancelled -> { /* user dismissed */ }
is LoginResult.AuthError -> { /* handle the error */ }
}
Requirements
| Requirement | Minimum version |
|---|---|
| Android | API 24 (6.0) |
| Kotlin | 2.3 |
| compileSdk | 36 |
| AGP | 9.2 |