This is an Android SDK for the KUKSA Vehicle Abstraction Layer.
Important
AI Usage Notice
This repository partially contains AI-generated code using GitHub Copilot Business. This notice must remain attached to any reproduction of this repository.
The KUKSA Android SDK allows you to interact with VSS data from the KUKSA Databroker within an Android App. The main functionality consists of fetching, updating and subscribing to VSS data.
Important
The kuksa-android-sdk is a thin wrapper around the kuksa-java-sdk (version 0.4.1).
It delegates all core functionality to the Java SDK and primarily provides Android-specific test infrastructure, examples, and integration tests and test apps.
app/build.gradle.kts
implementation("org.eclipse.kuksa:kuksa-android-sdk:<VERSION>")
The latest release version can be seen here.
Snapshot builds are also available (but of course less stable): Package view
See the quickstart guide for additional integration options.
The KUKSA SDK is currently uploaded to Maven Central.
Note
The following snippet expects an unsecure setup of the Databroker. See the quickstart guide for instructions on how to establish a secure connection to the Databroker.
private var dataBrokerConnection: DataBrokerConnection? = null
fun connectInsecure(host: String, port: Int) {
lifecycleScope.launch {
val managedChannel = ManagedChannelBuilder.forAddress(host, port)
.usePlaintext()
.build()
val connector = DataBrokerConnector(managedChannel)
dataBrokerConnection = connector.connect()
// Connection to the Databroker successfully established
} catch (e: DataBrokerException) {
// Connection to the Databroker failed
}
}fun fetch() {
lifecycleScope.launch {
val request = FetchRequest("Vehicle.Speed", listOf(Field.FIELD_VALUE))
val response = dataBrokerConnection?.fetch(request) ?: return@launch
val entry = entriesList.first() // Don't forget to handle empty responses
val value = entry.value
val speed = value.float
}
}Refer to the quickstart guide or class diagrams for further insight into the KUKSA SDK API. You can also checkout the sample implementation.
- A working setup requires at least a running KUKSA Databroker
- Optional: The KUKSA Databroker CLI can be used to manually feed data and test your app. See this chapter on how to read and write data via the CLI.
- Optional: The Mock Service can be used to simulate a "real" environment.
If you are running the Databroker locally on your PC and cannot reach it from your Android device or emulator, see the Troubleshooting Guide for step-by-step instructions on setting up port forwarding using adb reverse or configuring the emulator alias.
Please feel free to create GitHub issues and contribute.
The KUKSA Android SDK is provided under the terms of the Apache Software License 2.0.