我第一次在我的一个应用上开发一个 Android Auto 功能。
在我的清单中,我有:
<service
android:name="ro.test.auto.AutoService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
<action android:name="android.media.browse.MediaBrowserServiceCompat" />
</intent-filter>
</service>
<uses-feature
android:name="android.hardware.type.automotive"
android:required="true" />
<meta-data
android:name="com.android.automotive"
android:resource="@xml/automotive_app_desc" />
在我的汽车应用程序描述中:
<?xml version="1.0" encoding="utf-8"?>
<automotiveApp>
<uses name="media" />
</automotiveApp>
我的服务扩展:
public class AutoService extends MediaBrowserServiceCompat
为了测试我的用户 Polestar 模拟器,应用程序按预期工作; 问题是当我把手机放到车上时,我的应用程序没有出现在屏幕上
我试试:
在我的汽车安卓自动屏幕上显示我的应用程序有延迟或其他方法吗?
谢谢,
L.E: 使用来自:https://developer.android.com/training/cars/testing#install-dhu-1.1 的信息 我在 dhu 上测试过。首先没有工作。但我想我必须更换
android:name="com.android.automotive"
与
android:name="com.google.android.gms.car.application"
我的应用开始在 DHU 上运行
但是:它仍然没有出现在我的汽车 android auto 中;使用调试和发布apk
有什么想法吗?
答案 0 :(得分:0)
也许,您的应用无法在实车上运行,因为它不是从 Play 商店下载的。 PTAL 汽车应用质量 Android documentation。
从文档中复制:
<块引用>重要提示:应用必须符合此页面中列出的条件才能获得资格 作为 Google Play 上的 Android Auto 或 Android Automotive OS 应用程序。应用 除非从 Play 安装,否则不能使用 Android Auto 存储。
答案 1 :(得分:0)
有3个平台
您为 #2 开发的应用是一款手机应用,其中 #3 是一个独立的原生 AAOS 应用,查看您的代码示例,您可能会混合使用这两种应用(#2 和 #3)。