✨ 2025 Year review

Dynamically change vehicle properties in Android Automotive

This tutorial will cover a specific use case with Android Automotive: how to dynamically change vehicle properties?

Concepts

In Android Automotive, several parameters of the vehicle are abstracted by the Vehicle HAL and handled via Vehicle Properties.

These parameters include the vehicle speed, doors opening, gear selection, fuel level, and many more (see VehiclePropertyIds for a more detailed list).

In a real vehicle, the Vehicle HAL continuously communicates with various vehicle sensors and ECUs to retrieve the value of these parameters and expose them to the Android apps.

In an automotive emulator, the VHAL is not connected to any real hardware. For testing and demonstration purposes, we implemented a way to dynamically inject values for these properties via a gRPC server (running on the device) and a gRPC client (running either on the device or on a host machine).

This allows you to mock the state of the vehicle in a simple way, which can be very useful in the context of automated tests.

Using the gRPC client

For this example, we have implemented a small gRPC client which is able to get and set the values of a subset of vehicle properties. You can try it as follows:

  1. On the device, click on the iconat the bottom navigation area, swipe to the right and start the VehicleDemo application. It displays the current state of some vehicle properties:Genymotion Device Image display showing a Vehicle Demo on Android Automotive
  2. Open a new browser tab with the IP address of your device, and go to the Shell panel:
    Genymotion Decvice Image Shell panel.
  3. Run the following commands:
ShellScript
# Open the fuel door:
./system/vendor/bin/grpc-vhal-aidl-client -s 0.0.0.0:45001 -i 287310600 -v 1
# Connecting to server at 0.0.0.0:45001
# Connected to the server at 0.0.0.0:45001
# Setting the value of 287310600 to 1


# Get whether the fuel door is opened (1) or not (0):
./system/vendor/bin/grpc-vhal-aidl-client -s 0.0.0.0:45001 -i 287310600
# Connecting to server at 0.0.0.0:45001
# Connected to the server at 0.0.0.0:45001
# The value of 287310600 is:
#        VehiclePropValue{timestamp: 288592858284, areaId: 0, prop: 287310600, status: AVAILABLE,
#        value: RawPropValues{int32Values: [1], floatValues: [], int64Values: [], byteValues: [], stringValue: }}

The fuel door now appears in red in the VehicleDemo application:

Genymotion Device Image display showing a Vehicle Demo on Android Automotive, with red fuel door icon.

This small demonstration client only covers a subset of vehicle properties, but the good news is that you can implement your own gRPC client!

Access the gRPC server

The gRPC server running on the device is accessible via TCP requests on <virtual_device_IP_address:45001> (don’t forget to open this port in your AWS EC2 security group). Then you can implement your gRPC client by relying on the AAOS VehicleServer.proto gRPC APIs and the corresponding proto files.

Scroll to Top

Select Product Portal

SaaS Platform

Access to our SaaS solution and use virtual machines in the cloud on any web browsers.

Or

Or

Desktop Platform

Access to manage your Genymotion Desktop licenses, your invoices and account information.

How to get a quote for multiple Business Licenses?

  1. You need a Genymotion Desktop account. If you haven’t one yet, you can create it here.
  2. After creation and activation, or if you already have an account, follow this link.
  3. Add the number of desired licenses to your shopping cart and click “Continue to Billing”
  4. Add a shipping address, or select one if you already created one.
  5.  In the next page, click “Get a quote”:
    Payment details
  6. A quote will be automatically generated in PDF format.

Genymotion Device Image for Cloud providers
- Private Offer -

Genymotion Device On-premise
- Contact Us -

Genymotion SaaS
- Increase Maximum Simultaneous devices -

Genymotion SaaS Enterprise Plan
- Get a Quote -

Genymotion SaaS Premium Plan
- Get a Quote -

Personal Use - Free

Genymotion Desktop for personal use is not suitable for trial or POC: you will not get any assistance and some features will be disabled. If you have already selected “personal use” and wish to get a trial license, please contact our Sales at [email protected].

Technical support is not available with Genymotion Desktop free edition for personal use. For more details, please refer to Genymotion conditions of use (Personal Use).

The following features are not available in personal use mode:

Follow these steps to get Genymotion Desktop and activate personal use mode:

  1. Go to the Download page and get the latest version for your system.
  2. Follow the instructions from Genymotion Desktop quickstart guide to install Genymotion Desktop.
  3. Launch Genymotion and click CREATE to create an account. You should receive an activation email within an hour. If not, make sure to check your spam.
  4. After activating your account, return to Genymotion and log in with your credentials.
  5. Select personal use when prompted.
  6. Read Genymotion Desktop quickstart guide carefully to setup Genymotion for your needs.

Indie Plan Application Form

This plan is strictly reserved to individual workers (freelancers, self-employed).

Contact Sales
- Premium Plan -

Educational Plan Application Form

The Educational plan is restricted to:

  • schools, teachers or students who wish to use Genymotion Desktop for tuition
  • students who wish to use Genymotion Desktop for a school project

It is subject to valid proof (student card, teacher card, etc.)

Select a Cloud provider Marketplace