What happens when the app goes to background?
The SDK automatically continues tracking when the app is minimized or the screen turns off. When you callstartSession(), the SDK starts a foreground service that:
- Keeps collecting location and sensor data
- Shows a notification (required by Android)
- Prevents Android from killing the app
stopSession(), the service stops and the notification disappears.
This means drivers can put their phone in their pocket during a delivery and tracking continues uninterrupted.
Why do I see a notification when recording?
Android requires apps to show a notification when running in the background. This is a platform rule, not a Desmo requirement. The notification tells users “this app is doing something” and lets them stop it if needed. By default, it shows a generic icon with “Recording Active” text. You can customize it with your branding usingDesmo.configureForegroundService(). See the quickstart guide for details.
Do I need notification permission?
On Android 13+, yes. You needPOST_NOTIFICATIONS permission to show the background tracking notification.
Use the SDK helpers to check and request this:
If notification permission is denied on Android 13+, sessions will still work in the foreground but won’t continue in the background.
What is SessionType and when do I use each?
Every session requires aSessionType that tells Desmo what the driver is doing:
| SessionType | When to use |
|---|---|
SessionType.PICKUP | Driver is collecting a package from a merchant or warehouse |
SessionType.DROP | Driver is delivering a package to a customer |
SessionType.TRANSIT | Driver is traveling between stops (no specific address) |
PICKUP and DROP sessions, you should always provide an address. For TRANSIT sessions, the address is optional.
Is the SDK safe to run in production?
Yes. The SDK is designed to run continuously during delivery sessions:- It batches telemetry to reduce network overhead.
- It uses efficient system APIs for motion/location and networking.
- You control which environment it talks to (
SANDBOXvsLIVE).
Will the SDK crash my app?
No. The SDK uses a crash-safeDesmoResult pattern. All public API methods return DesmoResult.Success or DesmoResult.Failure instead of throwing exceptions.
This means:
- SDK errors will never cause an uncaught exception in your app.
- Your delivery flow always continues, even if the SDK encounters an error.
- You handle errors explicitly via
.onSuccessand.onFailurecallbacks.
What happens if the device is offline?
If the device is temporarily offline:startSessionandstopSessionwill returnDesmoResult.Failureif the backend cannot be reached.- Telemetry is saved locally to a SQLite database on the device and uploaded automatically when connectivity returns.
- Handle
DesmoResult.Failuregracefully - don’t block the driver’s delivery flow. - Consider allowing drivers to retry
stopSessionif the first attempt fails. - Telemetry data is never lost - the SDK persists and retries automatically.
What happens to telemetry if upload fails?
The SDK includes a persistent offline queue:- Telemetry batches are saved to local SQLite storage before upload.
- If upload fails (network error, timeout, etc.), the data stays in the queue.
- The SDK automatically retries failed uploads when connectivity returns.
- Data is only deleted from the queue after successful upload.
Can I disable or remove the SDK?
Yes. You can:- Stop calling
Desmo.setupand any session APIs. - Remove the
desmo-android-sdkdependency from your Gradle configuration.
How do I test without affecting production data?
Use:- A sandbox publishable key (
pk_sandbox_...). DesmoEnvironment.SANDBOXwhen callingDesmo.setup.
How do I see what the SDK is doing?
- Enable logging during development (it’s disabled by default for production safety).
- Watch Logcat with tag filter
DesmoSDKfor:- Session start/stop events.
- HTTP requests and responses.
- Any warnings or errors emitted by the SDK.
- Use the Android Logging, Debugging & Troubleshooting guide for a detailed checklist.
How do I upgrade the SDK?
When a new version is released:- Update the version in your Gradle dependency:
- Sync Gradle and rebuild your app.
- Re-run your tests and core delivery flows.
Desmo.setup, startSession, and stopSession, most changes are backwards compatible as long as you stay within the same major version.
Who do I contact for support?
For API keys, backend configuration, or integration questions:- Reach out to your Desmo contact.
- Or use the support channel linked from the Desmo dashboard.