geohawk 0.1.5
geohawk: ^0.1.5 copied to clipboard
Resilient Android background location tracking — foreground service, watchdog/boot restart, offline cache, and OEM auto-start helpers.
0.1.0 #
- Initial public release.
- Android-only: foreground-service-based background location tracking.
Geohawk.start(...)launches aFOREGROUND_SERVICE_TYPE_LOCATIONservice with a configurable interval, max-interval, distance filter, optional HTTPS upload endpoint, and notification title/text/icon.Geohawk.stop()tears down the service, watchdog alarm, and wake lock.Geohawk.updateNotification({title, text, icon})updates the foreground notification in place without restarting tracking.Geohawk.onLocationUpdateexposes a broadcast stream ofLocationFixes.Geohawk.pendingCacheCount()returns the number of unsent fixes currently cached on disk (when the upload endpoint is offline).Geohawk.requestBatteryOptimizationExemption()andGeohawk.openAutoStartSettings()deep-link to the relevant OEM screens.- Runtime location permission is requested automatically from the bound
Activity before the foreground service is started, avoiding the Android 14+
SecurityExceptiononstartForegroundwith typelocation. - Watchdog alarm and boot/restart receivers keep the service alive across
task removal and reboots. Uses
setAndAllowWhileIdle(inexact) so noSCHEDULE_EXACT_ALARM/USE_EXACT_ALARMpermission is required and Google Play "Exact alarm" policy doesn't apply.