[null,null,["上次更新時間:2025-08-22 (世界標準時間)。"],[],[],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)"]]