Install the binary dependency
Use android/maven from the delivery package as a local Maven repository, or publish it to your private Maven repository. Google Maven and Maven Central are needed for dependencies. APP SDK 1.0.0 requires minSdk 24, compileSdk 36, Java 17 and core library desugaring.
Add this to your project’s dependency repository configuration, replacing the package path:
repositories {
maven { url = uri('/path/to/package/android/maven') }
google()
mavenCentral()
}
Configure the application module:
android {
compileSdk 36
defaultConfig { minSdk 24 }
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation 'net.oou:infinite-ride-mobile:1.0.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
}
Configure identity and consent
Initialize once on the main thread in Application. The host supplies the icon, consent query, notification text and registered application identifier:
MobileSdk.configure(MobileSdk.Configuration(
consentGranted = { privacyStore.hasConsent() },
notificationIcon = R.drawable.ic_notification,
notificationTitle = "Your App",
notificationText = "Vehicle connection active",
openApplication = openAppPendingIntent,
clientId = registeredClientId,
))
Import net.oou.mobile.MobileSdk. The consent callback must return the current state and remain false before consent. Do not hardcode true. Leave developmentProvisioning at its default false. Provide a notification entry point and valid small icon. Declare permissions, services and system capabilities for the features you enable, following the native sample Manifest.
Activity and device lifecycle
Implement ActivityHost with the current activity and foreground state. Create a single device client with MobileSdk.devices(context, host). Forward onHostResume, onHostPause and onActivityResult; call close() on destruction. Use choosingSystemDevice to distinguish pauses caused by the companion-device chooser from leaving the pairing flow.
Request Bluetooth scan and connect, nearby Wi-Fi, location and applicable notification permissions for the OS version. Explain permission denial or offer a settings entry point; do not loop permission requests. The SDK does not provide the host’s privacy consent screen.
DeviceClient exposes scanDevices, getDiscoveredDevices, pairDevice, submitPin, status queries and vehicle Wi-Fi methods. Follow the public interfaces and native samples for signatures and vehicles and recovery for sequencing.
Install a session and query vehicles
platformSessionJson is the original session from platform login. apiBase is your assigned HTTPS base URL including /api/v1. Call on the main thread:
MobileSdk.setSession(context, platformSessionJson)
val vehicles = MobileSdk.vehicles(context, apiBase, "en")
val operation = vehicles.list(object : ResultCallback {
override fun resolve(value: Any?) {
// Decode the vehicle-list JSON string and update the UI.
}
override fun reject(code: String, message: String?, cause: Throwable?) {
// Handle cancellation, authentication and business errors separately.
}
})
Import net.oou.mobile.ResultCallback. Complete recover before running this query. Call operation.cancel() when leaving the flow, then wait for settlement before starting another operation. Cancellation does not roll back the server. SDK 0.2.1 coalesces same-scope list and recovery requests. Cancellation affects only that caller, leaving other subscribers active. Shared work may continue to completion or timeout to preserve confirmed results.
Navigation, media and logout
Use MobileSdk.Extensions for maps, navigation, media and auxiliary notifications. navigationActive must reflect the actual navigation state so the SDK can prevent vehicle changes during navigation. Features without their required extension remain unavailable.
On logout, cancel cloud operations and call MobileSdk.clearSession(context). Create new cloud clients after login. See commerce, stores and payments for payment integration and recovery.
When consent is withdrawn, immediately stop accepting new work, cancel all held cloud operations and call MobileSdk.clearSession(context) to stop the device session and clear the account. Consume final callbacks without updating the departed screen. Withdrawing consent cannot undo a completed payment.
