[英]Android Auto app doesn't show up on physical device
目前正在測試 Android Auto,我們現在正在物理設備(在汽車中)上進行測試。 到目前為止,我已經設法將工作 Android 自動支持添加到我們正在繪制一些基本模板的應用程序中。 這適用於模擬的 DHU 和應用程序顯示並且可以使用。 問題是當我們在物理設備上進行測試時,它並沒有出現。 我的應用程序當前顯示在模擬的 DHU 中。 所有必要的開發人員設置都已打開,因此這應該不是問題。
作為控制測試,我通過 Android Studio 使用 > Automotive > Media Service 創建了一個新項目,只是為了確保它實際上可以在物理設備上進行測試。 無需修改並在設備上進行全新安裝,汽車即可識別該應用程序,並且該應用程序可通過電纜連接(物理設備)在汽車中使用。
我懷疑我在不同的清單中忽略了一些東西。
這是項目應用程序的共享清單:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.itf_aa.shared">
<application>
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc" />
<meta-data android:name="androidx.car.app.minCarApiLevel"
android:value="1" />
<service
android:name="com.example.itf_aa.shared.MainGridService"
android:exported="true">
<intent-filter>
<action android:name="androidx.car.app.CarAppService" />
</intent-filter>
</service>
</application>
</manifest>
同時這是控制應用程序的共享清單:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapplication.shared">
<application android:appCategory="audio">
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc" />
<!-- Main music service, provides media browsing and media playback services to
consumers through MediaBrowserService and MediaSession. Consumers connect to it through
MediaBrowser (for browsing) and MediaController (for playback control) -->
<service
android:name="com.example.myapplication.shared.MyMusicService"
android:exported="true">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>
</application>
我懷疑問題出在意圖過濾器中,似乎是差異制造者。 有誰知道我是否可以在意圖過濾器中使用其他任何東西,或者我的清單可能是錯誤的? 這是我唯一懷疑是差異制造者的事情,因為我看不出應用程序類別如何使它與眾不同。 為什么應用在使用“android.media.browse.MediaBrowserService”時會顯示物理設備,而在使用“androidx.car.app.CarAppService”時不會顯示?
我很感激我在這方面可能得到的任何幫助,所以提前感謝您的時間和幫助。 如果我遺漏了某些內容或您需要更多詳細信息,請告訴我。 ❤️
原來答案可以在這里找到。
答:為了在物理設備上進行測試,您需要啟動內部測試軌道並接受 Android 自動附錄。 然后通過開發者控制台部署測試。
為了讓您的應用在真正的主機(不是我們提供的桌面主機)上運行,您的應用必須通過 Google Play 商店分發。 這可確保您的應用程序已經過測試和審查,是否符合我們的指南。 這些指南確保您的應用程序與汽車環境相關,並通過我們的駕駛員分心測試。
它與清單無關。 仍然不確定為什么示例項目會繞過這一點,但肯定是 Google 應用程序的某種白名單。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.