What you’ll build
In this quickstart you will:- Install the Desmo Android SDK via JitPack.
- Initialize the SDK with your publishable key.
- Start and stop a delivery session from your Android app.
pk_....If you don’t have a key yet, contact your Desmo representative to have one issued for your project.
Requirements
- Android 7.0 (API 24) or later
- Android Gradle Plugin compatible with Kotlin 1.9+
- Your app is written in Kotlin (the SDK is a Kotlin library)
App permissions
To let Desmo record sessions correctly, your app should request location permissions so sessions can be tied to where the delivery happened. Add these to yourAndroidManifest.xml:
1. Install the SDK (JitPack)
The Android SDK is distributed via JitPack from the GitHub repokubocreate/desmo-android-sdk.
1.1 Add the JitPack repository
In your app project (not the SDK repo), open the rootsettings.gradle.kts and make sure the dependencyResolutionManagement block includes JitPack:
settings.gradle:
build.gradle with an allprojects { repositories { ... } } block instead of dependencyResolutionManagement, add the jitpack.io maven entry there:
1.2 Add the dependency
In your app modulebuild.gradle (usually app/build.gradle):
-
Remove any old module dependency, for example:
-
Add the JitPack dependency:
v0.1.2 is the Git tag for the SDK release on GitHub. When a new version is tagged, update this value to match.
If you previously copied any Desmo code directly into your project, or used old Maven Central coordinates or local module references, remove those and keep only the JitPack dependency to avoid duplicate classes.
2. Initialize the SDK
CallDesmo.setup once at app startup, usually in your custom Application class.
Application class in AndroidManifest.xml:
apiKey: your publishable Desmo API key (starts withpk_).environment:DesmoEnvironment.SANDBOX– Desmo sandbox environment.DesmoEnvironment.LIVE– Desmo production environment.
Desmo.setup fails (for example, if the key does not start with pk_), the SDK will log an error and Desmo.client will remain null.
Without a Context (no telemetry)
There is also a setup(apiKey, environment) overload that does not take a Context. This is useful in non-Android environments, but it disables on-device telemetry. For typical courier apps you should prefer the setup(context, apiKey, environment) version so telemetry is enabled.
3. Request permissions at runtime
The SDK exposes helpers so you know which permissions are required and whether they are granted:Desmo.getRequiredPermissions() : Array<String>Desmo.hasRequiredPermissions(context) : BooleanDesmo.getMissingPermissions(context) : List<String>
Activity:
ensureDesmoPermissions() before you start a session so location is available.
4. Start a delivery session
Call this when you begin recording a delivery (for example, when the driver starts a drop-off). Because the Android SDK uses Kotlin coroutines, these calls aresuspend functions. You should call them from a coroutine scope (e.g. lifecycleScope).
- Calls Desmo’s backend to create a session.
- Starts collecting telemetry on-device (when initialized with a
Context). - Begins batching telemetry to Desmo while the session is recording.
5. Stop a delivery session
Call this when the delivery is complete:- Flushes any remaining telemetry.
- Notifies the backend that the session is complete.
- Lets Desmo’s workers start processing PoD intelligence for that session.
Next steps
From here:- Configure keys and environments in Android Auth & Environments.
- Enable logging and troubleshoot in Android Logging, Debugging & Troubleshooting.
- Revisit the Desmo Integration Overview at Integrating Desmo to see how the Android and iOS SDKs fit with your backend APIs and dashboard.