Mobile app
Automatic enrollment, permissions, starting and stopping collection, and the controls available on the Tracking screen.
The mobile app brings its controls together on the Geotrack screen. Both the development build and the standalone APK for Android testing use the Geotrack display name. Geo Tracking - Specs is the name of this documentation. The current interface does not require users to enter a server, identifier, or token. All app interface text, permission explanations, notifications, and application error messages are in English.
First launch and automatic enrollment
When an installation that has not yet been configured opens, the app tries to enroll the phone with the laboratory's HTTPS Worker. The flow generates a random 32-byte key, saves that identity through expo-secure-store before using the network, and submits enrollment to POST /api/enroll. Saving first allows a retry after a lost response without creating another identity.
The server returns an identifier and a device credential. The app validates the response format and passes those values to the native module. The phone never needs the administrative token. The label uses the manufacturer and model when available; the dashboard catalog helps identify the device afterward.
Concurrent calls share the same enrollment operation. The attempt has a 20-second timeout. Network failure, enrollment limits, and invalid responses appear as errors, with a Try connecting again option. An existing installation's configuration is preserved, including when the app opens offline. Updating the APK without uninstalling preserves the identity and queue.
Successful enrollment does not start tracking. The next step requires an explicit local action. See authentication for credential storage and scope.
Starting with the required permissions
The Start tracking button appears at the top, alongside a notice that location will be sent to the laboratory, including in the background. Tapping it starts this sequence:
- Check existing permission and request location access while using the app when necessary.
- Request background access if it has not already been granted.
- Request notification authorization as applicable to the platform.
- Start the session in the native module only if background location access has been granted.
Denying location access keeps collection stopped. The interface directs the user to try again or open settings to choose Allow all the time on Android or Always on iOS. Denying notifications does not invalidate location permission that has already been granted; the app shows that condition in the details.
Starting can be canceled: tapping Stop tracking while a dialog or preparation is in progress invalidates that attempt. A late dialog response must not start collection after it has been stopped.
States and local stopping
| Visible state | Meaning |
|---|---|
| Loading | The app is reading native state. |
| Preparing collection | The start flow is checking or requesting permissions. |
| Collection active | The session is authorized and native collection is enabled. |
| Collection paused | The local session remains authorized, but collection is not active. This may be a remote pause or a native restriction; check errors and permissions. |
| Collection stopped | There is no locally authorized session for new captures. |
The main control remains visible while scrolling. Stop tracking revokes local authorization, requests a native stop, and interrupts an ongoing simulation. This action takes priority even while synchronization or a permission request is in progress.
Stopping does not clear the queue. Previously captured points may still reach the server; compare capture times to distinguish a delayed delivery from a new capture. After a local stop, publishing an enabled remote configuration does not replace a new start by the user. See remote configuration for this distinction.
Additional controls
Simulate route and Technical details start collapsed. The first section provides outbound, return, and cancellation controls for simulated navigation. The second shows:
| Information or action | Purpose |
|---|---|
| Device and permission | Check identity and the level of location access. |
| Queued and acknowledged | Monitor local persistence and transport acknowledgments. |
| Configuration | View the version, distance filter, and interval applied on the device. |
| Last synchronization | Check the latest recorded synchronization time. |
| Sync now | Request pending uploads and a configuration update. |
| Open permission settings | Access system settings. |
| Latest sample | Inspect coordinates, accuracy, time, and native or synthetic origin. |
| Send synthetic sample | Save a provider:test sample to the native queue to exercise transport. |
A synthetic sample does not demonstrate GPS capture. It can be sent with a configured connection without starting a real capture session. During a simulated route, conflicting actions are blocked; synchronization and stopping remain available.
What continues outside the screen
The interface checks state every two seconds while active and also receives module events. React timers serve the display: collection, SQLite, and HTTP transport are native. Going to Home is not equivalent to tapping Stop; the limits depend on Android and iOS.
Expo Go and browsers do not run this native module. The web version is for inspecting the interface, with collection startup unavailable. See installation to build an app that includes the module.
Repository sources
geo-demo/src/app/tracking.tsxandgeo-demo/src/app/index.tsx.geo-demo/src/features/tracking/use-tracking.tsandstart-tracking.ts.geo-demo/src/features/tracking/device-enrollment.tsandenrollment.ts.geo-demo/src/features/tracking/native-tracking.tsandtracking-validation.ts.