1 of 14

Android Automotive

Android Automotive is a variation of Google's Android operating system, tailored for its use in vehicle dashboards

Mayokun Yusuf 19-09-2024

2 of 14

Android Automotive OS

Android Automotive OS (AAOS) is a full-fledged operating system by Google, designed to run directly on the vehicle's in-vehicle infotainment system (IVI).

​

It is a customized version of Android tailored for vehicles, allowing apps to run natively on the car's hardware without the need for a smartphone.

​

Android Automotive offers openness, customization, and scale to automotive infotainment systems and head units. Openness enables new efficiencies by providing basic automotive infotainment features in a free and open source codebase. Customization enables implementers to differentiate the product as they see fit. Scale is achieved through Android’s common framework, language, and APIs, all of which enables reuse of development expertise and completed software from hundreds of thousands of Android developers worldwide.

​

3 of 14

Difference Between Android Automotive OS and Android Auto

Android Auto: An app that runs on your smartphone and projects a simplified interface onto the car's infotainment system. It requires a compatible phone and car.

​

Android Automotive OS: An operating system installed directly in the car, independent of a smartphone. Apps are installed directly onto the car's system via the Google Play Store.

​

Google Automotive Services (GAS)

Google Automotive Services (GAS) is a collection of applications and services that automotive OEMs can choose to license and integrate into their in-vehicle infotainment (IVI) systems.

​

Google Play Store: Allows users to download and install automotive-compatible apps directly in the car.

Google Maps: Provides built-in, real-time navigation optimized for the car with traffic updates and location searches.

Google Assistant: Enables hands-free voice control for media, navigation, and messaging through voice commands.

Google Play Services: Offers core system APIs like location, authentication, and app updates for seamless app functionality.

Google Maps Navigation SDK: Allows developers to integrate turn-by-turn navigation and map features directly into their apps.

Media and Messaging Integration: Seamlessly integrates media apps (e.g., Spotify) and messaging apps for in-car use through Android Automotive's system interface.

​

​

​

​

​

4 of 14

Why Develop for Android Automotive OS?

Growing Market: More car manufacturers are adopting Android Automotive OS

​

Native Integration: Apps can integrate more deeply with vehicle features.

​

Unique User Experience: Provides an opportunity to create apps specifically designed for the in-car environment.

5 of 14

Supported App Categories

As of now, Android Automotive OS supports the following app categories:

  1. Media Apps: Music, podcasts, audiobooks. Built using: MediaBrowserService and MediaSession. On Android Automotive OS, you can also build sign-in and settings screens (for use while parked) using Views or Compose. Build Media Apps for Cars.
  2. Navigation Apps: GPS navigation, mapping services. Built using; The Android for Cars App Library. See Build a navigation app for additional information specific to navigation apps.
  3. Point of Interest (POI) Apps: Apps that help users find places like restaurants, gas stations, etc. Built using: The Android for Cars App Library. See a point of interest app for additional information specific to POI apps.
  4. Messaging Apps: Communication apps with voice support. Messaging apps let users receive incoming notifications, read messages aloud using text-to-speech, and send replies using voice input in the car. See Build messaging apps for Android Auto 
  5. Browsers: Browser apps let users access web pages while the car is parked. Built using: Views and/or Compose. See Build browsers for Android Automotive OS

6 of 14

Use the Android for Cars App Library

  • The Android for Cars App Library lets you bring your navigation, point of interest (POI), and internet of things (IOT) apps to the car. It does so by providing a set of templates designed to meet driver distraction standards and taking care of details like the variety of car screen factors and input modalities.
    • Key terms and concepts
      • Models and Templates
      • The user interface is represented by a graph of model objects that can be arranged together in different ways, as allowed by the template they belong to. Templates are a subset of the models that can act as a root in those graphs. Models include the information to be displayed to the user in the form of text and images as well as attributes to configure aspects of the visual appearance of such information—for example, text colors or image sizes. The host converts the models to views that are designed to meet driver distraction standards and takes care of details like the variety of car screen factors and input modalities.
      • Host
      • The host is the backend component that implements the functionality offered by the library's APIs so your app can run in the car. The responsibilities of the host range from discovering your app and managing its lifecycle to converting your models into views and notifying your app of user interactions. On mobile devices, this host is implemented by Android Auto. On Android Automotive OS, this host is installed as a system app.
      • Template restrictions
      • Different templates enforce restrictions in the content of their models. For example, list templates have limits on the number of items that can be presented to the user. Templates also have restrictions in the way they can be connected to form the flow of a task. For example, the app can only push up to five templates to the screen stack. See Template restrictions for more details.
      • Screen
      • Screen is a class provided by the library that apps implement to manage the user interface presented to the user. A Screen has a lifecycle and provides the mechanism for the app to send the template to display when the screen is visible. Screen instances can also be pushed and popped to and from a Screen stack, which ensures they adhere to the template flow restrictions.
      • CarAppService
      • CarAppService is an abstract Service class that your app must implement and export to be discovered and managed by the host. Your app's CarAppService is responsible for validating that a host connection can be trusted using createHostValidator and subsequently providing Session instances for each connection using onCreateSession.
      • Session
      • Session is an abstract class that your app must implement and return using CarAppService.onCreateSession. It serves as the entry point to display information on the car screen. It has a lifecycle that informs the current state of your app on the car screen, such as when your app is visible or hidden.
      • When a Session is started, such as when the app is first launched, the host requests for the initial Screen to display using the onCreateScreen method.

7 of 14

Android Automotive Architecture

1. Application Framework Layer:

This layer is where your applications run, whether they are AOSP (Android Open Source Project) Apps, OEM (Original Equipment Manufacturer) Apps, or 3rd Party Apps (like the media app you are developing).

  • AOSP Apps: Standard Android applications provided by Google, like Google Maps or Google Assistant.
  • OEM Apps: Applications developed by the car manufacturers (OEMs) for specific car models and hardware.
  • 3rd Party Apps: External apps like Spotify, YouTube Music, and other media apps built by developers like you. Your app resides here.

​

2. Service Layer:

The Service Layer manages communication between the application framework and lower-level system services. It is composed of:

  • Android Managers: These are system managers like AudioManager, ConnectivityManager, and LocationManager, responsible for handling common Android services like media playback, internet connectivity, etc.
  • Android System Services: These provide core system functionalities, such as network management, storage access, and UI rendering.
  • Car Managers and Car Services: These are automotive-specific services that handle vehicle-specific information like fuel levels, engine diagnostics, or climate control.
    • Car Managers interact with Car Services to handle vehicle-specific data like speed, parking sensors, temperature control, and more.

​

8 of 14

Android Automotive Architecture

  • 3. Hardware Abstraction Layer (HAL):
  • The HAL (Hardware Abstraction Layer) bridges the gap between the hardware and software. This is where traditional Android interacts with vehicle hardware components through Vehicle HAL.
  • Traditional Android: This provides the standard Android capabilities for interaction with media, connectivity, and other services.
  • Vehicle: This represents the actual hardware and sensors within the car (e.g., engine, wheels, media system, GPS). This is how the system accesses the car's hardware (like speakers, sensors, infotainment system).
  • The HAL abstracts vehicle-specific components, making it easier for developers to interact with them without needing to know the low-level hardware details.

​

4. Board Support Package (BSP):

At the lowest level, we have the BSP (Board Support Package), which includes the Linux Kernel.

The kernel provides core system services like device drivers, file system management, and resource allocation.

The Linux Kernel interacts with the vehicle hardware through a Hardware Interface Definition Language (HIDL) interface, allowing Android to communicate directly with the car's systems.

​

9 of 14

Android Automotive Architecture

How It All Comes Together:

Your Media App (3rd Party App) sits in the Application Framework Layer, where it communicates with the Android System Services and Car Managers to control media playback or interact with the car's audio system.

The Android Managers and Car Managers in the Service Layer handle communication between your app and the vehicle's hardware.

The HAL ensures that all system-level commands (like playing media, controlling volume, etc.) are properly translated into hardware-specific actions.

The Linux Kernel handles the low-level operation of hardware resources, ensuring that the vehicle's systems (e.g., speakers, microphone) are functioning properly.

​

​

10 of 14

Creating Your First Android Automotive App

​

  • Launch Android Studio
  • Ensure you have the latest Android SDK installed, check Android 11.0 (R) or later. Android Automotive OS is based on Android 9.0 (Pie) and above.
  • Install Android Automotive System Image,
    • Select the SDK Platforms tab.
    • Click on Show Package Details at the bottom right corner.
    • Scroll to Android API Level 30 or higher.
    • Under the selected API level, look for Android Automotive OS system images:
      • Check Android Automotive Intel x86 Atom System Image or Google APIs Intel x86 Atom System Image with an Automotive label.
    • If not already installed, check the box next to the system image and click Apply to download and install it.

Note: If you don't see an Automotive system image, you may need to install it via the SDK Update Sites tab:

    • Go to the SDK Update Sites tab.
    • Ensure that Android Repository and Google APIs are enabled.
    • Click Apply and check again in the SDK Platforms tab.

11 of 14

Creating Your First Android Automotive App

​

  • Set Up the Android Automotive OS Emulator
    • Open AVD Manager and create a new virtual device.
    • Select Hardware Profile and choose the Automotive category.
    • Select Automotive (1024 x 768) or any available automotive device profile.
    • Select System Image, in the System Image screen, choose the Automotive tab then select the system image you installed earlier.
    • To simulate hardware inputs like rotary controllers or touchpads, you may need to enable additional emulator controls.

Enable Extended Controls

        • With the emulator running, click on the ... (More) button on the emulator toolbar.

Use Virtual Sensors and Controls

        • Navigate through the Extended Controls menu to simulate various inputs, such as:
          • Rotation: Adjust the device orientation.
          • GPS: Set mock locations.
          • Additional Sensors: Simulate other hardware features.

12 of 14

Creating Your First Android Automotive App

​

13 of 14

Creating Your First Android Automotive App

​

  • Create mediaService and add to manifest file
  • Automotive App Descriptor (XML): The meta-data tag references an XML file that you need to create in your res/xml/ directory. This file configures your app as an automotive media app.
  • Add Metadata for Android Automotive: In Android Automotive apps, specifically media apps, you need to add certain meta-data tags in the AndroidManifest.xml file to ensure your app behaves correctly and is recognized by the system as a media app for Android Automotive OS.
        • <meta-data> inside <service>:
        • android.media.browse.CONTENT_STYLE_PLAYABLE_HINT: Defines the content style for items that are playable (e.g., songs).
        • android.media.browse.CONTENT_STYLE_BROWSABLE_HINT: Defines the content style for items that are browsable (e.g., albums, playlists).
        • com.google.android.gms.car.application: Specifies that this is a media app for Automotive OS. The value here points to an XML file (explained below) that further configures your app.

14 of 14

Thank You.

​