Background location tracker for Traccar servers with offline buffering and configurable intervals
- Update Android package namespace and applicationId to dev.fiatcode.tracpulse - Update AndroidManifest.xml package and app label to TracPulse - Move all Kotlin source files to dev/fiatcode/tracpulse/ package - Update pubspec.yaml name to tracpulse - Update all Dart imports from package:traccar_client to relative - Rename TraccarClientApp class to TracPulseApp - Update user-facing strings in permission_screen to TracPulse - Update notification channel label and wakeLock tag to TracPulse |
||
|---|---|---|
| android | ||
| docs | ||
| lib | ||
| test | ||
| .gitignore | ||
| .metadata | ||
| AGENTS.md | ||
| analysis_options.yaml | ||
| pubspec.lock | ||
| pubspec.yaml | ||
| README.md | ||
Traccar Client
Flutter Android app for background GPS location tracking, sending data to a Traccar server.
Build
flutter build apk --debug
The APK is output to build/app/outputs/flutter-apk/app-debug.apk.
Project Structure
lib/
main.dart # App entry, dark theme, routing
main_screen.dart # Tracking toggle + live coordinates
permission_screen.dart # Pre-flight permission setup
settings_screen.dart # Server URL, device ID, accuracy config
status_screen.dart # Event log (LOCATION, SYNC, ERROR, etc.)
preferences.dart # SharedPreferences wrapper
bridge/
location_bridge.dart # Dart↔Native MethodChannel (com.traccar.client/tracking)
android/app/src/main/kotlin/com/traccar/traccar_client/
BridgeModule.kt # Method channel handler
service/LocationTrackingService.kt
location/HeartbeatScheduler.kt # AlarmManager heartbeat
network/TraccarHttpClient.kt # POST to server
network/ConnectivityReceiver.kt
Configuration
On first launch, PermissionScreen guides through:
- Location —
locationWhenInUsethenlocationAlways(background) - Notification — required for tracking alerts
- Battery — disable Doze optimization so tracking works reliably
Then set server URL and device ID in Settings before starting tracking.
Server Request Format
POST to https://yourserver/?id=DEVICE_ID&lat=...&lon=...×tamp=...&is_moving=0
is_moving=speed > 1.0 m/s(3.6 km/h threshold)- Server URL and device ID come from
Preferences(configured in Settings screen)