Thêm tính năng hỗ trợ cho Android Auto vào ứng dụng đa phương tiện
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Bạn cần thực hiện một vài thay đổi đối với tệp kê khai của ứng dụng để Android Auto có thể khám phá và tương tác với dịch vụ trình duyệt nội dung phương tiện của ứng dụng.
Khai báo dịch vụ hỗ trợ nội dung nghe nhìn cho Android Auto
Sử dụng mục nhập tệp kê khai sau đây để khai báo rằng ứng dụng dành cho điện thoại của bạn hỗ trợ Android Auto:
<application>
...
<meta-data android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc"/>
...
</application>
Mục nhập tệp kê khai này là một tệp XML khai báo những chức năng của ô tô mà ứng dụng hỗ trợ. Để cho biết rằng bạn có một ứng dụng đa phương tiện, hãy thêm tệp XML có tên automotive_app_desc.xml
vào thư mục res/xml/
trong dự án. Tệp này phải bao gồm nội dung sau:
<automotiveApp>
<uses name="media"/>
</automotiveApp>
Báo cáo sự cố về nội dung phương tiện trên Android Auto
Nếu gặp sự cố trong khi phát triển ứng dụng đa phương tiện cho Android Auto, bạn có thể báo cáo bằng Công cụ theo dõi lỗi của Google.
Hãy nhớ điền tất cả thông tin được yêu cầu vào mẫu báo cáo lỗi.
Báo lỗi mới
Trước khi báo lỗi mới, vui lòng kiểm tra xem lỗi đó đã được báo cáo trong danh sách lỗi hay chưa. Bạn có thể đăng ký theo dõi và bình chọn cho các lỗi bằng cách nhấp vào dấu sao cho một lỗi trong công cụ theo dõi. Để biết thêm thông tin, hãy xem bài viết Subscribing to an Issue (Đăng ký theo dõi lỗi).
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-08-21 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-21 UTC."],[],[],null,["# Add support for Android Auto to your media app\n\nYou need to make a few changes to your app's manifest so that Android Auto\ncan discover and interact with your app's media browser service.\n| **Important:** This guide assumes that you have already [built a media browser service](/training/cars/media#implement_browser) and you want to add support for Android Auto to your existing project. If you are new to app development for cars, see the [Android for Cars overview page](/training/cars).\n\nDeclare media support for Android Auto\n--------------------------------------\n\nUse the following manifest entry to declare that your phone app supports\nAndroid Auto: \n\n \u003capplication\u003e\n ...\n \u003cmeta-data android:name=\"com.google.android.gms.car.application\"\n android:resource=\"@xml/automotive_app_desc\"/\u003e\n ...\n \u003c/application\u003e\n\nThis manifest entry refers to an XML file that declares what automotive\ncapabilities your app supports. To indicate that you have a media app, add an\nXML file named `automotive_app_desc.xml` to the `res/xml/` directory in your\nproject. This file should include the following content: \n\n \u003cautomotiveApp\u003e\n \u003cuses name=\"media\"/\u003e\n \u003c/automotiveApp\u003e\n\nReport an Android Auto Media issue\n----------------------------------\n\nIf you run into an issue while developing your media app for Android Auto, you\ncan report it using the\n[Google Issue Tracker](https://issuetracker.google.com/issues?q=status:open%20componentid:192643).\nBe sure to fill out all the requested information in the issue template.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=192643)\n\nBefore filing a new issue, please check whether it is already reported in the issues\nlist. You can subscribe to and vote for issues by clicking the star for an issue in\nthe tracker. For more information, see\n[Subscribing to an Issue](https://developers.google.com/issue-tracker/guides/subscribe#starring_an_issue)."]]