为手机和电视发布具有不同过滤器的多个 apk

Publishing multiple apks with different filters for mobile and tv

我想发布多个 apk:一个用于手机,另一个用于同一应用程序中的 androidtv。根据 Publishing Multiple APKs with Different Filters,同一应用程序中只有四个不同的过滤器:

Currently, Google Play allows you to publish multiple APKs for the same application only when each APK provides different filters based on the following configurations:

All other filters still work the same as usual, but these four are the only filters that can distinguish one APK from another within the same application listing on Google Play. For example, you cannot publish multiple APKs for the same application if the APKs differ only based on whether the device has a camera.

我想通过 API 级别和屏幕大小来区分,但似乎有重叠:

  1. API androidtv 应用程序的级别 (MinSDK) 保持在 21,移动应用程序保持在 16。因此 API 级别有重叠(21 岁及以上)。

  2. android 电视的屏幕尺寸可能与平板电脑的屏幕尺寸重叠: 例如。 common high-definition TV display resolutions 是 720p、1080i 和 1080p。 另外 Samsung nexus 分辨率为 720x1280。

我担心如果我发布更高版本的 androidtv apk,它可能会取代 API 级别 >= 21 和屏幕尺寸 720x1280 的平板电脑上的移动应用程序,这也符合电视应用程序的条件布局大小。

那么如何在应用清单中使用不同的过滤器清楚地区分这两个 apk?

更新

我已经在 androidtv 应用的清单中添加了 Leanback 功能

<manifest>
    <uses-feature android:name="android.software.leanback"
        android:required="true" />
    ...
</manifest>

我看到 androidtv apk 支持 42 台设备(看不到哪些设备),移动 apk 设备支持 10791 台设备,整个应用程序总共支持 10832 台设备。

10791 + 42 = 10833

因此仍有可能存在 1 (10833 - 10832 = 1) 个重叠设备,因此显示警告。

重叠警告

android电视 apk

手机apk

设备总数

我不认为重叠消息是因为 androidtv apk 是移动 apk 的超集,正如在查看 androidtv 支持的设备数量的评论之一中提到的那样少得多。

由于只有一个可能重叠的设备,我将发布它,但我希望我知道哪些设备重叠以接收两个 apk。

实际上有一个 "feature" 用于专门针对 Android 电视。您可以在 docs 中查看说明。但基本上你只需指定它使用 leanback 功能,如下所示。

<manifest>
    <uses-feature android:name="android.software.leanback"
        android:required="true" />
    ...
</manifest>

这将确保任何电视设备 运行 leanback 都能获取您的 APK(如果您使用的是一个 APK,则可以设置 required=false)。我相信所有官方 Android 电视都在使用此功能。 leanback 可能会在非电视设备上运行,但在这种情况下,他们的所有应用程序都将显示为电视应用程序。

还有其他几个功能可以disable/enable定位 Android 电视,您可以查看 release checklist for more info (specifically this section)。

需要注意的一件事是,您的移动 APK 和电视 APK 可能都满足一些重叠的设备。在与 Play 管理中心团队的代表交谈后,他们推荐了解决该问题的方法:

Regarding the multi-apk scenario where you have overlapping devices - yes, your Android TV APK would always need to have a higher version code. There are a few options to help resolve this:

  1. You can manually blacklist the 2 overlapping devices. This would immediately resolve the issue with overlapping APKs, however if new devices are released in the future that are eligible for both APKs you would face this issue again.

  2. Use a version code scheme for your Android TV APK that is significantly higher than your mobile device APK. For example, your TV APK can be existing version code + 100000, or 100808, while your mobile device APK remains at 838. In this scenario, you could publish mobile device APKs up to version code 100808 without having to update your Android TV APK with every push. This would also resolve any issues with Alpha/Beta testing Android TV APKs.

他的回复也包含在 this doc 的 "Assigning version codes" 部分。