Stay organized with collections
Save and categorize content based on your preferences.
This guide assumes you have a media app that plays audio on a phone and that
your media app conforms to Android media app architecture. You also learn what
your app needs from MediaBrowserService and MediaSession to run on Android
Auto or AAOS. When you complete the core media infrastructure, you can add
support for Android Auto and AAOS to your media app.
Contents
These pages detail how to work with the media apps:
If your app focuses on playing audio media, use the tools described here. You
can create media apps for cars in one of two ways:
Use MediaBrowserService and a MediaSession to create an app that Android
Auto and AAOS can connect to. This allows the infotainment screen interface
to render media browsing and playback user interfaces optimized for in-car
use.
or
Use the Cars App Library templates to build apps with a customized
media browsing and playback experience, including custom actions. To learn
more, see Build a templated media app.
This guide assumes you have a media app that plays audio on a phone and that
your media app conforms to Android media app architecture. This guide
describes the required components of a MediaBrowserService and MediaSession
needed by your app to be compatible with Android Auto or AAOS. After you
complete the core media infrastructure, you can
add support for Android Auto and add support for AAOS to your media
app.
Create video media apps
If the primary content provided by your app is video, see:
These terms are used in relation to building media apps for cars:
Media browser
An API used by media apps to discover media browser services and to display
their content. Android Auto and AAOS use a media browser to
find your app's media browser service.
Media browser service
An Android service implemented by your media app that complies with the
MediaBrowserServiceCompat API. Your app uses this service to expose
content. We also support `MediaLibrarySerice'.
Media item
The media browser organizes content in a tree of MediaItem objects. A
media item can have either or both of these flags. A media item that can
be browsed for and played operates like a playlist. You can select the item
to play all of its descendants, or you can browse its descendants.
FLAG_PLAYABLE indicates that the item is a leaf on the content tree.
The item represents a single sound stream, such as a song on an album,
a chapter in an audio book, or an episode of a podcast.
FLAG_BROWSABLE indicates that the item is a node on the content tree
and has descendants. For example, the item represents an album, and its
descendants are the songs on the album.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-13 UTC.
[null,null,["Last updated 2025-08-13 UTC."],[],[],null,["# Media apps for cars overview\n\nThis guide assumes you have a media app that plays audio on a phone and that\nyour media app conforms to Android media app architecture. You also learn what\nyour app needs from `MediaBrowserService` and `MediaSession` to run on Android\nAuto or AAOS. When you complete the core media infrastructure, you can add\nsupport for Android Auto and AAOS to your media app.\n| **Caution:** Google takes driver distraction seriously. Your app must meet specific design requirements before it can be listed on Google Play for Android Auto or AAOS. By adhering to these requirements, you can make it more straightforward to build and test your app. To learn more, see [Android app quality for cars](/docs/quality-guidelines/car-app-quality?category=media).\n\nContents\n--------\n\nThese pages detail how to work with the media apps:\n\n- [Configure the manifest file](/training/cars/media/configure-manifest)\n- [Enable playback controls](/training/cars/media/enable-playback)\n- [Support voice actions](/training/cars/media/voice-actions)\n- [Implement distraction safeguards](/training/cars/media/distraction-safeguards)\n- [Handle errors](/training/cars/media/errors)\n\nCreate audio media apps\n-----------------------\n\nIf your app focuses on playing audio media, use the tools described here. You\ncan create media apps for cars in one of two ways:\n\n1. Use `MediaBrowserService` and a `MediaSession` to create an app that Android\n Auto and AAOS can connect to. This allows the infotainment screen interface\n to render media browsing and playback user interfaces optimized for in-car\n use.\n\n *or*\n2. Use the [Cars App Library](/training/cars/apps) templates to build apps with a customized\n media browsing and playback experience, including custom actions. To learn\n more, see [Build a templated media app](/training/cars/apps/media).\n\n | **Note:** Templated media apps are supported only on Android Auto.\n\n| **Caution:** Aside from [voice guidance audio for navigation apps](/training/cars/apps/navigation#voice-guidance) and the media apps described here, in-app media playback while driving is **not** permitted.\n\nThis guide assumes you have a media app that plays audio on a phone and that\nyour media app conforms to Android [media app architecture](/guide/topics/media-apps/media-apps-overview). This guide\ndescribes the required components of a `MediaBrowserService` and `MediaSession`\nneeded by your app to be compatible with Android Auto or AAOS. After you\ncomplete the core media infrastructure, you can\n[add support for Android Auto](/training/cars/media/auto) and [add support for AAOS](/training/cars/media/automotive-os) to your media\napp.\n\nCreate video media apps\n-----------------------\n\nIf the primary content provided by your app is video, see:\n\n- [Build video apps for Android Automotive OS](/training/cars/parked/video)\n- [Build parked apps for cars](/training/cars/parked)\n\nBefore you start\n----------------\n\nBe sure to consult:\n\n- [Android media API documentation](/guide/topics/media-apps/media-apps-overview)\n- Design guidance: [Create media apps](https://developers.google.com/cars/design/create-apps/app-types/media)\n- Terminology: [Key terms and concepts](#terms-concepts)\n\nLearn key terms and concepts\n----------------------------\n\nThese terms are used in relation to building media apps for cars:\n\nMedia browser\n: An API used by media apps to discover media browser services and to display\n their content. Android Auto and AAOS use a media browser to\n find your app's media browser service.\n\nMedia browser service\n: An Android service implemented by your media app that complies with the\n [`MediaBrowserServiceCompat`](/reference/androidx/media/MediaBrowserServiceCompat) API. Your app uses this service to expose\n content. We also support [\\`MediaLibrarySerice'](/training/cars/media/configure-manifest).\n\nMedia item\n\n: The media browser organizes content in a tree of [`MediaItem`](/training/cars/parked/video) objects. A\n media item can have either or both of these flags. A media item that can\n be browsed for **and** played operates like a playlist. You can select the item\n to play all of its descendants, or you can browse its descendants.\n\n- `FLAG_PLAYABLE` indicates that the item is a leaf on the content tree.\n The item represents a single sound stream, such as a song on an album,\n a chapter in an audio book, or an episode of a podcast.\n\n- `FLAG_BROWSABLE` indicates that the item is a node on the content tree\n and has descendants. For example, the item represents an album, and its\n descendants are the songs on the album.\n\nSee additional resources\n------------------------\n\nFor additional information, see:\n\n- [Universal Media Player sample](//github.com/googlesamples/android-UniversalMusicPlayer)\n- [Audio app overview](/training/managing-audio)\n- [ExoPlayer overview](/guide/topics/media/exoplayer)"]]