BGeo SDK
BGeo is a background-geolocation SDK for native Android. It keeps tracking across app backgrounding, process death, and reboot, uploads locations from native code (no Kotlin of yours in the hot path), and adapts GPS use to motion to save battery.
- Kotlin-first —
suspendfunctions andFlows, not callbacks. Every method mirrors the name it has in BGeo’s React Native and Flutter SDKs, so moving between them is a matter of syntax rather than concepts. - Native offline upload — a durable SQLite queue drains to your server with batching, backoff, and optional JWT refresh; it survives process death.
- Motion-based tracking — Kalman smoothing, activity recognition, a stationary geofence wake, and an elastic distance filter.
- No headless layer to write. React Native and Flutter both need one,
because the JS context and the Dart isolate die while the service keeps
running. A native app does not: Android restarts your process and calls
Application.onCreatefor every boot, geofence and service event, which is whereattach()goes. - Closed engine, open facade — the engine ships as a prebuilt
dev.bgeo:bgeo-androidAAR behind a Kotlin facade you can read end to end on GitHub. Requires a license key in release builds.
Install
dependencies { implementation("dev.bgeo:background-geolocation:0.1.0")}Both artifacts are on Maven Central; the engine comes in transitively. See
Installation for the three
things Gradle cannot do for you — attach(), the background-location
permission, and the license key.
Track in ten lines
BackgroundGeolocation.attach(this) // Application.onCreate, once per process
lifecycleScope.launch { BackgroundGeolocation.ready(Config(distanceFilter = 10.0, stopTimeout = 5)) BackgroundGeolocation.requestPermission(permissionRequester) BackgroundGeolocation.start()}
lifecycleScope.launch { BackgroundGeolocation.locations.collect { location -> Log.d("BGeo", "${location.coords.latitude}, ${location.coords.longitude}") }}Quickstart walks through the same flow with the parts that matter explained.
Where to go next
- Installation — Gradle, manifest,
attach() - Permissions — the staged escalation Android forces on you
- Quickstart — first fix on screen
- License keys — what release builds need