이 가이드에서는 휴대전화에서 오디오를 재생하는 미디어 앱이 있고 미디어 앱이 Android 미디어 앱 아키텍처를 준수한다고 가정합니다. 또한 Android Auto 또는 AAOS에서 실행하기 위해 앱에 필요한 MediaBrowserService 및 MediaSession도 알아봅니다. 핵심 미디어 인프라를 완료하면 미디어 앱에 Android Auto 및 AAOS 지원을 추가할 수 있습니다.
앱이 오디오 미디어 재생에 중점을 두는 경우 여기에 설명된 도구를 사용하세요. 다음 두 가지 방법 중 하나로 자동차용 미디어 앱을 만들 수 있습니다.
MediaBrowserService 및 MediaSession를 사용하여 Android Auto 및 AAOS에 연결할 수 있는 앱을 만듭니다. 이를 통해 인포테인먼트 화면 인터페이스는 자동차 내 사용에 최적화된 미디어 탐색 및 재생 사용자 인터페이스를 렌더링할 수 있습니다.
또는
자동차 앱 라이브러리 템플릿을 사용하여 맞춤 작업 등 맞춤설정된 미디어 탐색 및 재생 환경이 있는 앱을 빌드합니다. 자세한 내용은 템플릿 미디어 앱 빌드를 참고하세요.
이 가이드에서는 휴대전화에서 오디오를 재생하는 미디어 앱이 있고 미디어 앱이 Android 미디어 앱 아키텍처를 준수한다고 가정합니다. 이 가이드에서는 앱이 Android Auto 또는 AAOS와 호환되는 데 필요한 MediaBrowserService 및 MediaSession의 필수 구성요소를 설명합니다. 핵심 미디어 인프라를 완료하면 Android Auto 지원과 AAOS 지원을 미디어 앱에 추가할 수 있습니다.
미디어 브라우저는 MediaItem 객체 트리에 콘텐츠를 구성합니다. 미디어 항목에는 이러한 플래그 중 하나 또는 둘 다가 있을 수 있습니다. 탐색하고 재생할 수 있는 미디어 항목은 재생목록처럼 작동합니다. 항목을 선택하여 모든 하위 요소를 재생하거나 하위 요소를 탐색할 수 있습니다.
FLAG_PLAYABLE는 항목이 콘텐츠 트리의 리프임을 나타냅니다.
항목은 앨범의 노래, 오디오북의 챕터 또는 팟캐스트의 에피소드와 같은 단일 사운드 스트림을 나타냅니다.
FLAG_BROWSABLE는 항목이 콘텐츠 트리의 노드이고 하위 요소가 있음을 나타냅니다. 예를 들어 항목은 앨범을 나타내고 하위 요소는 앨범의 노래입니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-22(UTC)
[null,null,["최종 업데이트: 2025-08-22(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)"]]