TV 应用开发入门
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Android 提供了针对在大屏幕设备(例如高清电视)上运行的应用进行优化的丰富用户体验。TV 应用带来了新的体验,让用户可以舒服地躺在沙发上愉悦地享受。
TV 应用使用的结构与手机和平板电脑应用相同,这意味着您可以根据自己已经了解的 Android 应用构建知识来创建新的 TV 应用。或者,您可以扩展现有应用,使其也能在 TV 设备上运行。不过,电视的用户互动模式与手机和平板电脑设备截然不同。为了让您的应用在 TV 平台上大获成功,您需要设计新的布局,让观看者在距离电视 10 英尺远的地方也能享受到舒适的浏览体验,只需使用方向键和选择按钮就能轻松进行导航。
注意:TV 应用在 TV 设备上本地运行。如需详细了解如何将视频和音频从 Android 应用流式传输到 TV 设备,请参阅 Google Cast 开发者文档。
主题
- 创建并运行 TV 应用
- 为 TV 应用创建一个新的 Android Studio 项目,或者修改现有的应用项目以便在 TV 设备上运行。
- 处理 TV 硬件
- 检查您的应用是否在 TV 硬件上运行,处理不支持的硬件功能,并管理控制器设备。
- 管理 TV 控制器
- 通过管理 TV 控制器来处理用户输入。
- 构建 TV 界面
- 使用 Compose for TV 为 TV 应用构建现代的声明式界面。
- 创建 TV 导航
- 了解对 TV 导航的要求以及如何实现与 TV 兼容的导航。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Get started with TV apps\n\nAndroid offers a rich user experience that's optimized for apps running on large screen devices,\nsuch as high-definition televisions. Apps on TV offer new opportunities to delight your users\nfrom the comfort of their couch.\n\n\nTV apps use the same structure as those for phones and tablets, which means you can\ncreate new TV apps based on what you already know about building apps for Android. Or you can extend your\nexisting apps to also run on TV devices. However, the user interaction model for TV is\nsubstantially different from phone and tablet devices. To make your app successful on TVs,\ndesign new layouts that viewers can enjoy from 10 feet away and comfortably navigate\nwith just a directional pad and a select button.\n\n\n**Note:** TV apps run locally on TV devices. To learn more about streaming video and\naudio from an Android app to a TV device, refer to the\n[developer documentation for Google Cast](https://developers.google.com/cast/).\n\nTopics\n------\n\n[Create and run a TV app](/training/tv/get-started/create)\n: Create a new Android Studio project for TV apps or modify your existing app project to run on\n TV devices.\n\n[Handle TV hardware](/training/tv/get-started/hardware)\n: Check if your app is running on TV hardware, handle unsupported hardware features, and manage\n controller devices.\n\n[Manage TV controllers](/training/tv/get-started/controllers)\n: Handle user input by managing TV controllers.\n\n[Build TV UIs](/training/tv/playback/compose)\n: Use Compose for TV to build modern, declarative UIs for TV apps.\n\n[Create TV navigation](/training/tv/get-started/navigation)\n: Understand the requirements for TV navigation and how to implement TV-compatible\n navigation."]]