tracelet_android 0.10.0
tracelet_android: ^0.10.0 copied to clipboard
Android implementation of the Tracelet background geolocation plugin.
tracelet_android #
Android implementation of the Tracelet background geolocation plugin.
This package uses Kotlin and native Android APIs (FusedLocationProvider, Room, WorkManager, Geofencing API) to provide production-grade background location tracking.
Native Features #
- Kalman Filter GPS Smoothing — Extended Kalman Filter implementation (
KalmanLocationFilter.kt) smooths raw GPS coordinates using device-reported accuracy as measurement noise. Produces cleaner tracks and eliminates jitter. Learn more → - Trip Detection —
TripManager.kttracks motion state transitions to detect trip start/stop. Each trip includes distance, duration, waypoints, and start/stop locations. Learn more → - Polygon Geofences — Ray-casting point-in-polygon algorithm in
GeofenceManager.ktfor arbitrary polygon containment checks alongside circular geofences. Learn more → - Mock Location Detection — Multi-layered spoof detection using
Location.isMock()(API 31+) /isFromMockProvider()(API 18+), satellite count analysis, andSystemClock.elapsedRealtimeNanosdrift detection. Configurable viaMockDetectionLevel. Learn more → - Unlimited Geofences — Proximity-based auto-load/unload in
GeofenceManager.kt. Only the closest geofences withingeofenceProximityRadiusare registered with the OS (up to 100), enabling monitoring of thousands of geofences. Geofences are dynamically swapped on each location update withgeofencesChangeevents. - OEM Compatibility — Automatic mitigations for aggressive OEM power management: Huawei PowerGenie wakelock tag hack, Xiaomi autostart detection, Samsung/OnePlus/Oppo/Vivo settings deep-links, boot receiver wakelock, and ProGuard consumer rules. Settings Health API exposes device health for user-facing onboarding. Learn more →
- HTTP Sync Retry Engine — Configurable retry with exponential backoff in
HttpSyncManager.ktfor transient 5xx, 429, and timeout failures. RespectsRetry-Afterheaders and defers sync on connectivity loss. Learn more → - Configurable Motion Sensitivity —
MotionDetector.ktreadsshakeThreshold,stillThreshold, andstillSampleCountfrom config at runtime, allowing per-app tuning of accelerometer sensitivity without code changes.
Usage #
You should not depend on this package directly. Instead, depend on tracelet which automatically includes this package on Android builds.
dependencies:
tracelet: ^0.5.0
For Android-specific setup (permissions, Gradle configuration), see the Android Setup Guide.
Related Packages #
| Package | Description |
|---|---|
tracelet |
App-facing Dart API — the only package you depend on |
tracelet_platform_interface |
Abstract platform interface |
tracelet_ios |
iOS implementation |
tracelet_web |
Web implementation |