1

Android Auto 媒体应用程序在连接到手机时如何显示。

我实现了 Android 自动媒体应用,在 xml 中添加,

当我将手机连接到汽车时,我只看到 google play 音乐应用程序,而不是我的自定义应用程序。MediaBrowserService 是否也实现了?

清单文件:`

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <meta-data android:name="com.google.android.gms.car.application"
        android:resource="@xml/automotive_app_desc"/>

    <activity
        android:name=".Tunes"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar"
        android:screenOrientation="landscape">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

`

4

1 回答 1

2

为了让您的应用程序出现在真实汽车中,您的应用程序必须从 Google Play 商店安装。这意味着您必须将其提交给 Google 以供他们审核。然后他们签署 apk 并通过商店提供。它还必须通过某些 Android Auto 要求才能放置在 Production 商店中。您可以通过 Alpha 通道提交应用程序,如果它不完全符合所有标准,他们可能会临时批准您继续。这是它出现在实际汽车中的唯一方式。他们的要求在这里:https ://developer.android.com/distribute/essentials/quality/auto.html

此外,一旦您的应用程序提交到商店,通常需要几个小时才能获得审核和批准。这使得快速测试/修复周期很难做到。

您还可以下载桌面主机 (DHU) 并在此模拟器中测试您的 Android Auto 应用程序,然后再将其提交到商店。更多信息在这里:https ://developer.android.com/training/auto/testing/index.html 。此模拟器不需要先对 apk 进行签名,因此您可以在将应用提交给 Google 之前快速测试/修复。

于 2016-06-10T15:04:20.843 回答