← Back to home

Android Automotive OS · Custom HMI engineering

Android Automotive HMI engineering, down to the Vehicle HAL.

Native cockpit software with Kotlin and Jetpack Compose for Android Automotive OS. Our reference project Lumen is an original EV cockpit that reads vehicle data through CarPropertyManager and the Vehicle HAL, on AAOS 15.

  • AAOS 15
  • Vehicle HAL
  • CarPropertyManager
  • Jetpack Compose
  • Coroutines · StateFlow
  • CarUxRestrictions

Playing the video loads the YouTube player (Google Ireland Limited) in privacy-enhanced mode. Data such as your IP address is sent to Google. Privacy policy · Watch on YouTube

Video demo

Lumen in 38 seconds

Recorded on Android Automotive OS 15. Every readout comes live from the Vehicle HAL, fed by physics-based driving scenarios.

  1. 01Wake-up on ignition
  2. 02Climate and seat heating
  3. 03Traction and energy flow
  4. 04Tyre-pressure advisory
  5. 05Regenerative braking
  6. 06DC charging

AAOS 15 · Vehicle HAL · 1080p · 0:38

VHAL properties
30
JVM tests
39
recompositions in 5 s
0–5
Gradle modules
4

Lumen · Case Study

What the demo shows

Every readout follows a vehicle signal. Nothing is a timeline without data behind it.

  • Live VHAL integration

    30 vehicle properties through CarPropertyManager, with permission and support detection per property.

  • Driving and regeneration

    Speed and power animated as springs, regenerative braking down to −150 kW, stop lamps driven by deceleration.

  • Energy flow and battery

    The flow follows the sign and size of battery power. Battery X-ray view, usable energy, range.

  • DC charging

    Charge port, cable, charge rate, state of charge and time to limit, live from the VHAL.

  • Climate and seat heating

    Temperature, fan and seat heating write to the VHAL. The UI shows the value read back.

  • Tyre pressure

    Advisory at 80 % of placard or below, critical at the VHAL threshold. Short and non-modal.

  • Vehicle status and UX restrictions

    Doors, charge port, gear. Vehicle settings lock while driving (CarUxRestrictions).

  • Modular architecture

    Four Gradle modules, one VehicleDataSource contract, Coroutines and StateFlow. Simulator and VHAL are interchangeable.

From the live VHAL

Screen captures from the AAOS 15 emulator, not mock-ups.

Lumen cockpit in drive mode: 112 km/h, +68 kW, tyre pressure, doors and charge port
Drive mode: speed, power, tyre pressure, doors and charge port from the VHAL
Lumen cockpit in the traction scene: 63 km/h, +177 kW
Traction: battery power drives the meter and the energy flow to both motors

Architecture

Four views of the same codebase, from modules to pixels. Each diagram shows Lumen as implemented and names the files behind it.

01 / 04 · Modules

Modules and wiring

  • Four Gradle modules. :feature:dashboard depends on :core:vehicle and :core:designsystem; the design system knows nothing about vehicle data.
  • No DI library: LumenApplication holds exactly one VehicleDataSource. VehicleSourceProvider in the car or sim source set picks the implementation.
  • Three build variants. Privileged car permissions appear only in the carPlatformDebug manifest.

Backed by

  • app/build.gradle.kts
  • feature/dashboard/build.gradle.kts
  • app/src/main/…/LumenApplication.kt
  • app/src/{car,sim}/…/VehicleSourceProvider.kt
  • app/src/main/…/MainActivity.kt
  • app/src/platformDebug/AndroidManifest.xml

02 / 04 · Data sources

Live VHAL and simulation

  • Live: CarPropertyVehicleSource connects through Car.createCar, checks permission and config per property, reads the first value and subscribes through CarPropertyManager.
  • Each event goes into a raw store; VhalMapper builds a new VehicleSnapshot from it. The mapper is a pure, JVM-tested function.
  • Simulation: the same interface, fed by physics in 20 ms steps and published at 20 Hz. The build flavor picks exactly one source.

Backed by

  • core/vehicle/…/car/CarPropertyVehicleSource.kt
  • core/vehicle/…/car/SubscriptionPolicy.kt
  • core/vehicle/…/car/VhalSpecs.kt
  • core/vehicle/…/car/VhalMapper.kt
  • core/vehicle/…/model/Signal.kt
  • core/vehicle/…/sim/SimulatedVehicleSource.kt
  • core/vehicle/…/sim/VehicleSimulator.kt

03 / 04 · Commands & read-back

Commands, read-back and state

  • The UI only calls the ViewModel. It reads the current value from the snapshot and calls VehicleControls; door locking is refused while UX restrictions are active.
  • CarPropertyVehicleSource checks availability, picks the area by seat bit, clamps to the config's min/max and writes with setProperty. Failures come back as a Result.
  • The UI shows the value only once it comes back from the VHAL through the subscription. There is no optimistic update.

Backed by

  • feature/dashboard/…/DashboardScreen.kt
  • feature/dashboard/…/DashboardViewModel.kt
  • core/vehicle/…/VehicleDataSource.kt
  • core/vehicle/…/car/CarPropertyVehicleSource.kt
  • core/vehicle/…/sim/SimulatedVehicleSource.kt

04 / 04 · UI & animation

Reactive UI and animation pipeline

  • The ViewModel derives two StateFlows from one snapshot: quantised UI state for composition and telemetry for animation.
  • Telemetry is never collected. A withFrameNanos loop reads it once per frame and drives VehicleMotion.
  • Animated values are read only in draw lambdas and graphicsLayer. Measured: 0 to 5 root recompositions in 5 seconds during a simulated drive, none when idle.

Backed by

  • feature/dashboard/…/DashboardViewModel.kt
  • feature/dashboard/…/DashboardFormatter.kt
  • feature/dashboard/…/motion/Telemetry.kt
  • feature/dashboard/…/motion/VehicleMotion.kt
  • feature/dashboard/…/DashboardScreen.kt
  • core/designsystem/…/PowerGauge.kt
  • core/designsystem/…/vehicle/VehicleCanvas.kt
  • core/designsystem/…/LumenBackdrop.kt

Decisions

  1. 01

    Signals carry their availability

    Every value is Value, Pending or Unavailable (not supported or no permission). The UI never shows a made-up zero.

  2. 02

    Two data paths

    Quantised UI state drives composition, high-rate telemetry is read only in the draw phase. During a simulated drive the root recomposes 0 to 5 times in 5 seconds, and not at all when idle.

  3. 03

    Motion from physics

    Springs for speed and power, energy flow from battery power, stop lamps from deceleration, a wake sweep on ignition.

  4. 04

    Drawn, not a 3D engine

    An original 2.5D vehicle in Compose Canvas behind a perspective matrix, with addressable parts. No asset licensing, no GL risk on the emulator.

The hardest problem

A power gauge that stopped updating

1 · Symptom
After parking, the power readout stayed on “−2 kW regen”.
2 · Cause
Two changes within one 100 ms sample interval left the subscriber on the intermediate value. Variable Update Rate then filtered out the identical values that followed.
3 · Fix
Gauge signals subscribe with VUR disabled and receive a steady sample; slow signals keep VUR. The rule lives in a pure SubscriptionPolicy.
4 · Proof
An on-device regression replays the pattern: the old build fails, the new one passes.

Technology: Kotlin 2.3 · Jetpack Compose · Coroutines and StateFlow · AGSL · android.car (CarPropertyManager, CarUxRestrictionsManager) · Android Automotive OS 15

Mohammad MirzakhaniDehkordi, founder of KorrektCode

The engineer behind it

Mohammad MirzakhaniDehkordi

Founder of KorrektCode · Engineering Manager and Solution Architect

Mohammad has built software for more than 15 years, over eight of them in leadership roles. His roots are in Android: Android developer at Digikala, Lead Mobile Developer at RightTel, Engineering Manager Android at Snapp!, most recently responsible for more than 100 engineers across cross-functional teams. After that, Solution Architect and Technical Project Manager at Capgemini Engineering in Germany. Lumen is his own automotive project, from architecture to the last pixel.

The roles listed describe the founder's personal career, not KorrektCode projects.

Source code

The repository is private for now. I am happy to walk engineering teams through the code in a session.

An Android Automotive project or role?

Custom HMI, VHAL integration, Compose performance or a second look at your AAOS architecture. For vehicle manufacturers, suppliers, engineering service providers and teams looking for reinforcement.

contact@korrektcode.de