Skip to content

Conversation

@pissten
Copy link

@pissten pissten commented Apr 29, 2025

✨ What this PR does
Adds support for automatic app configuration via scanning a QR code containing a traccar://config?... URL scheme

Allows setting:

Device ID

Server URL

Tracking interval, distance, angle

Automatic service start

Start/stop time scheduling via AlarmManager

Introduces a new broadcast receiver: TrackingSchedulerReceiver

Ensures full backward compatibility for users who configure the app manually

🧩 Changes
AndroidManifest.xml: Added intent-filter to capture traccar://config?... links.

MainActivity.kt: Handles deep links, updates shared preferences, schedules alarms.

TrackingSchedulerReceiver.kt: New receiver to start/stop tracking service at scheduled times.

(No breaking changes to existing preferences or flow.)

🎯 Motivation
Many users configure Traccar Client manually, which can be tedious especially in large deployments (e.g., regattas, fleet tracking).
This PR allows zero-touch configuration by scanning a QR code or clicking a link, improving usability for non-technical users.

📱 QR-code examples
A QR code can encode a full app setup like:

bash
Copy
Edit
traccar://config?deviceId=12345&serverUrl=https://yourserver.com/traccar&accuracy=high&interval=10&distance=5&angle=15&startTime=09:00&stopTime=17:00&service=true
Or users can open the link directly from an email or webpage.

✅ Testing
Manual testing on Android 12 and Android 14.

Verifying proper parsing of parameters.

Successful auto-start and auto-stop of tracking service.

Backward compatibility confirmed: app behaves exactly as before if QR or link is not used.

📚 Additional notes
No changes required to preferences.xml.

No additional dependencies introduced.

The feature is optional and does not impact existing users unless they choose to use QR-based config.

@pissten
Copy link
Author

pissten commented May 28, 2025

Is this something that would be considered merging in the near future?
I have compiled my own custom apk, so I'm covered for android client side.
But I would truly appreciate a iOS client version as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant