使用 MediaBrowserService 构建媒体应用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如需创建品牌推广和自定义功能受限的媒体应用,请使用 MediaBrowserService (MBS)。这种体验的费用较低,可让用户浏览内容和播放媒体。
由于媒体界面的大多数方面都由汽车制造商和 Google 控制(请参阅媒体的合作伙伴角色),因此应用开发者与设计相关的任务相对简单。
以下是应用开发者需要完成的基本任务:
- 规划导航标签页:最多选择 4 个内容顶级视图,并确定导航标签页的图标或标签。
- 规划浏览视图:规划内容的顶级视图和下级视图的组织方式和格式(网格还是列表?)。
- 自定义播放控件:决定是否要提供自定义操作和图标,以及是否要实现队列。
- 规划语音操作:确定您希望用户能够通过语音指令执行哪些操作
- 提供品牌元素:提供应用图标和强调色以代表您的品牌。
仅适用于 AAOS 的可选额外步骤:
- 创建登录流程:使用可用的模板创建登录流程,以便用户在车载显示屏上登录您的应用(如果您的应用需要登录)。
- 创建设置:为您的应用创建车载设置屏幕(如果需要设置)。
仅限 Android Auto 的额外可选步骤:
- 提供推荐内容:指定 10 项要作为推荐内容展示的媒体内容
请使用上述链接,获取有关每项任务的更详细指南。如需查看您需要提供的设计元素的摘要,请参阅核对清单。
媒体合作伙伴角色
对于在基于 AAOS 的车辆上运行的应用,汽车制造商可以自定义界面,以反映其品牌和车辆样式。对于在 Android Auto 中运行的应用,Google 会为其在各种兼容车辆中打造一致的外观和风格。下表总结了应用开发者和汽车制造商(在 AAOS 中)在确保统一媒体应用体验方面的设计角色。
媒体体验的方面 |
汽车制造商的设计角色(对于 Android Auto,则为 Google 的设计角色) |
应用开发者的设计角色 |
浏览媒体应用 |
确定应用栏的位置,并支持可显示在应用栏中的应用导航和控件 |
确定要在应用栏的标签页中显示哪些顶级内容视图,并根据需要提供图标和标签(请参阅规划导航标签页) |
浏览内容详情 |
确定网格或列表项的大小和内容,并在更低级别的内容中实现应用标题 |
确定各级可浏览媒体内容的格式(网格或列表)和组织方式(请参阅规划浏览视图) |
播放媒体内容 |
使用适当的媒体元数据和播放控件(包括应用中任何自定义操作的控件)实现播放视图和最小化控制栏。在播放视图中提供队列功能,并为队列设置样式。 |
决定是否在控制栏中实现自定义操作,并为其提供图标。此外,还要决定是否实现队列,以及是否为当前播放的曲目提供指示器(请参阅自定义播放控件) |
语音操作 |
提供 Google 助理界面,并控制用户在特定汽车中调用 Google 助理的方式 |
指定要针对哪些语音请求支持哪些媒体类别,以及要针对通用请求提供哪些内容(规划语音操作) |
品牌归因 |
在所有内容屏幕上显示应用图标,并选择将第三方应用颜色用作强调色的应用场景 |
提供应用图标并指定强调色(请参阅提供品牌元素) |
登录和设置 |
在应用栏上提供用于搜索和设置的设置功能,并根据需要将用户连接到登录屏幕 |
使用模板创建登录流程和设置屏幕。如有需要,请参阅调整登录流程和设计设置 |
建议 |
提供用于显示内容推荐的界面 |
提供适当内容推荐的来源 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eMedia app developers focus on planning navigation, browsing views, playback controls, voice actions, and branding elements within a pre-defined UI framework.\u003c/p\u003e\n"],["\u003cp\u003eCar makers or Google manage the overall media UI structure and styling, ensuring brand consistency and vehicle integration.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize playback controls, implement voice commands, and provide branding assets for their apps.\u003c/p\u003e\n"],["\u003cp\u003eAAOS allows for optional app sign-in and settings customization, while Android Auto offers an optional recommendation feature.\u003c/p\u003e\n"],["\u003cp\u003eDetailed design guidance and a checklist are available to aid developers in creating a seamless media app experience.\u003c/p\u003e\n"]]],[],null,["# Build media apps with MediaBrowserService\n\n\u003cbr /\u003e\n\nTo create a media app with limited branding and customization, use the\nMediaBrowserService (MBS). This is a lower-cost experience to let users browse\ncontent and play media.\n\nBecause most aspects of the media UI are controlled by car makers and Google\n(see [Partner roles for media](#roles)), the design-related tasks for app\ndevelopers are relatively simple.\n\nHere are the basic tasks for app developers:\n\n1. [Plan navigation tabs](/cars/design/create-apps/media-apps/navigation-tabs): Choose up to 4 top-level views of content and decide on icons or labels for navigation tabs.\n2. [Plan browsing views](/cars/design/create-apps/media-apps/browsing-views): Plan how top-level and lower-level views of content will be organized and formatted (grid or list?).\n3. [Customize playback\n controls](/cars/design/create-apps/media-apps/customize-playback-controls): Decide whether you want to provide custom actions and icons and whether to implement a queue.\n4. [Plan voice actions](/cars/design/create-apps/media-apps/voice-actions): Determine which commands you would like users to be able to request by voice\n5. [Provide branding\n elements](/cars/design/create-apps/media-apps/branding-elements): Provide your app icon and accent color to represent your brand.\n\n**Optional extra steps for AAOS only**:\n\n1. [Create a sign-in flow](/cars/design/create-apps/media-apps/signin-flow): Use the available templates to create a sign-in flow for users to sign in to your app on the car screen (if your app requires sign-in).\n2. [Create settings](/cars/design/create-apps/media-apps/design-settings): Create in-vehicle settings screens for your app, if settings are needed.\n\n**Optional extra step for Android Auto only**:\n\n1. [Provide\n recommendations](/cars/design/create-apps/media-apps/recommendations): Identify 10 items of media content to be showcased as recommended\n\nUse the aforementioned links to access more detailed guidance about each task.\nFor a summary of the design elements you'll need to provide, consult the\nchecklist.\n\nPartner roles for media\n-----------------------\n\nFor apps running on AAOS-based\nvehicles, car makers can customize the UI to reflect their brand and vehicle\nstyling. For apps running in Android Auto, Google creates a consistent look and\nfeel for the app across the range of compatible vehicles.\nThe following table\nsummarizes the design roles of app developers and car makers (in\nAAOS) in ensuring a unified media app experience.\n\n| Aspect of the media experience | Car maker's design role (or Google's, for Android Auto) | App developer's design role |\n|--------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Navigating media apps** | Decide where the app bar goes and support app navigation and controls that can appear in the app bar | Decide which top-level content views to represent in the app bar's tabs and provide icons and labeling as needed (see [Plan navigation tabs](/cars/design/create-apps/media-apps/navigation-tabs)) |\n| **Browsing content details** | Determine size and content of grid or list items and implement app header at lower levels of content | Determine format (grid or list) and organization for browsable media content at each level (see [Plan browsing views](/cars/design/create-apps/media-apps/browsing-views)) |\n| **Playing media** | Implement playback view and minimized control bar with appropriate media metadata and playback controls, including controls for any custom actions in the app. Provide a queue affordance in playback view and styling for the queue. | Decide whether to implement custom actions on the control bar, and provide icons for them. Also decide whether to implement a queue and whether to provide an indicator for the currently playing track (see [Customize playback controls](/cars/design/create-apps/media-apps/customize-playback-controls)) |\n| **Voice actions** | Provide Google Assistant UI and control how users invoke Assistant in specific cars | Specify which media categories to support for voice requests and what content to supply for generic requests ([Plan voice actions](/cars/design/create-apps/media-apps/voice-actions)) |\n| **Brand attribution** | Display the app icon on all content screens and choose where to apply the third-party app color as an accent | Provide app icon and specify accent color (See [Provide branding elements](/cars/design/create-apps/media-apps/branding-elements)) |\n| **Sign-in and settings** | Provide a settings affordance for search and settings on the app bar bar and connect users to sign-in screens as needed | Use templates to create a sign-in flow and settings screens. If needed, see [Adapt sign-in flow](/cars/design/create-apps/media-apps/signin-flow) and [Design settings](/cars/design/create-apps/media-apps/design-settings) |\n| **Recommendations** | Provide UI for content recommendations to appear | Provide a source for appropriate content recommendations |"]]