Media Apps with Car App Library

Media app developers can use the Car App Library (CAL) to build their app's user interface. This library offers an alternative to the conventional method of providing data through MediaBrowserService for the CarMediaApp to render.

CAL-based templated media apps let developers customize the user interface to match their brand identity. Unlike CAL-based apps, conventional media apps using MediaBrowserService and CarMediaApp don't allow developers to customize UI styling; this styling is controlled by the OEM.

Developers can build a templated media app that supports Android Auto and Android Automotive OS (AAOS).

Integrate

Support for CAL-based templated media apps requires platform integration.

Prerequisites

Alternative App Controls enables apps to play background audio while providing distraction-optimized controls to control that audio.

  • Alternative App Controls is available in Car-apps-release-14 and higher.
  • The platform must declare support for com.android.car.background_audio_while_driving.

CarMediaApp changes

The platform's CarMediaApp must:

  • Have permission to enable a media app's CAL activity. See code example.
  • Display only one app icon in the Car Launcher after the CarMediaApp enables a media app's CAL activity.
  • Launch the CAL activity instead of Media Center on devices supporting the android.software.car.templates_host.media feature.
  • Show playing audio in the media card.

Build configuration

The platform must declare support for android.software.car.templates_host.media:

<permissions>
    <!-- Declare support for templated applications. -->
    <feature name="android.software.car.templates_host" />

    <!-- This feature indicates that the system supports apps that use the
    Car App Library Media category -->
    <feature name="android.software.car.templates_host.media"/>
</permissions>

Test

Test platform support for CAL-based media apps using TestMediaCalApp. TestMediaCalApp is a media app built with Car App Library that the Templates Host renders on the platform.