Colota - Android GPS Location tracker
fix: respect Wi-Fi only setting on config-change flush and document anchor points
Max Dietrichc97756158037
diff --git a/apps/docs/docs/api-reference.md b/apps/docs/docs/api-reference.mdindex d9ded166..c9e4be4a 100644--- a/apps/docs/docs/api-reference.md+++ b/apps/docs/docs/api-reference.md@@ -67,6 +67,15 @@ All field names are [customizable](/docs/configuration/field-mapping).**Important:** `alt`, `vel`, and `bear` are conditionally included. Your server should not reject payloads missing these fields.+### Anchor Points++When entering or exiting a [pause zone](/docs/guides/geofencing#anchor-points), Colota sends a synthetic location at the geofence center. These payloads look like regular locations but have specific characteristics:++- `lat`/`lon` are the geofence center coordinates (not the actual GPS position)+- `acc` is set to the geofence radius in meters+- `alt`, `vel`, and `bear` are not included+- `batt` and `bs` reflect the current battery state+### Custom FieldsCustom static fields (configured in API Settings) are added to the payload first, then location fields are added. If a custom field has the same name as a location field, the location field overwrites it.diff --git a/apps/docs/docs/development/architecture.md b/apps/docs/docs/development/architecture.mdindex 3c36a2a4..b2254f7a 100644--- a/apps/docs/docs/development/architecture.md+++ b/apps/docs/docs/development/architecture.md@@ -86,6 +86,7 @@ An Android foreground service that runs continuously for GPS tracking. Manages:- GPS location capture via the `LocationProvider` abstraction- Pause zone detection (geofencing)+- Anchor points - synthetic locations at geofence centers on zone enter/exit for clean track endpoints- Battery critical shutdown (below 5% while discharging)- Location accuracy filtering- Queuing data for server syncdiff --git a/apps/docs/docs/guides/geofencing.md b/apps/docs/docs/guides/geofencing.mdindex 52bdb077..2aa60c6e 100644--- a/apps/docs/docs/guides/geofencing.md+++ b/apps/docs/docs/guides/geofencing.md@@ -31,3 +31,12 @@ import ScreenshotGallery from '@site/src/components/ScreenshotGallery'- When exiting the zone, tracking automatically resumes- Zone checks happen every location update with minimal overhead- You can create unlimited geofence zones++## Anchor Points++When you enter or exit a pause zone, Colota saves a synthetic location at the geofence center. This gives your tracks clean start and end points instead of starting or ending mid-road.++- **On enter:** An anchor point is logged at the zone center, then recording pauses+- **On exit:** Recording resumes and an anchor point is logged at the zone center++Anchor points use the geofence center coordinates (not your actual GPS position) and set accuracy to the zone radius. They are saved to the database and synced to your server like regular locations.diff --git a/apps/mobile/android/app/src/main/java/com/colota/service/LocationForegroundService.kt b/apps/mobile/android/app/src/main/java/com/colota/service/LocationForegroundService.ktindex eb262c54..cca48384 100644--- a/apps/mobile/android/app/src/main/java/com/colota/service/LocationForegroundService.kt+++ b/apps/mobile/android/app/src/main/java/com/colota/service/LocationForegroundService.kt@@ -195,7 +195,8 @@ class LocationForegroundService : Service() {conditionMonitor.start()}- if (config.syncIntervalSeconds == 0 && config.endpoint.isNotBlank()) {+ if (config.syncIntervalSeconds == 0 && config.endpoint.isNotBlank() &&+ !(config.isWifiOnlySync && !networkManager.isUnmeteredConnection())) {syncManager.manualFlush()}}