【问题标题】:Restrict Android application to Android TV将 Android 应用程序限制为 Android TV
【发布时间】:2014-09-28 21:30:53
【问题描述】:

我正在实现一个专门针对 Android TV 的应用程序。
我在 AndoridManifiest.xml 中使用了 2 个功能

<uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false" />
<uses-feature
        android:name="com.google.android.tv"
        android:required="true" />

它已发布到 Play 商店。但是,通过运行 Android 操作系统的东芝电视、Android Box 中的 Play Store 搜索我的应用程序时,我看不到我的应用程序。
我怎样才能喜欢 Youtube for TV 应用程序?它仅适用于 Android TV(Google TV、东芝、Android Box)。
提前致谢。

【问题讨论】:

  • 你的应用名称是什么?

标签: android google-tv android-tv


【解决方案1】:

对于像 Nexus Player 这样的 Android TV,建议在清单中使用以下内容。这将有助于将您在 Play 商店中的应用仅过滤到 Android TV 设备。

<application
    ...
    <activity
        android:name=".Mainctivity"
        android:icon="@drawable/app_icon_your_company"
        android:label="@string/app_name"
        android:logo="@drawable/app_icon_your_company"
        android:screenOrientation="landscape" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

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

【讨论】:

  • 这仅适用于运行 Android 5.0 的 Android TV 等设备。其他设备(TCL、东芝、Android Box...)运行以前的 Android 版本怎么样。
【解决方案2】:

您可以限制Google Play Developer Console 中的设备。还要检查FAQ of Google

“设备可用性”对话框是一个强大的工具,可供所有 Android 开发人员使用。可以从Google Play Developer Console 中访问它。设备可用性根据您的清单设置提供兼容设备的动态列表。例如,如果您的 APK 清单文件指定了大屏幕尺寸,则控制台将反映可在 Google Play 中找到您的应用的受支持设备。您还可以使用动态搜索功能来查看您的应用程序不可用的设备。您可以按制造商、设计名称(即 Passion)或实际的公共设备名称(即 Nexus One)进行搜索,以查看您的清单设置是否过滤了设备。

【讨论】:

  • 运行Android OS的智能电视、机顶盒等设备很多。我无法一一检查支持的设备。 :(
【解决方案3】:

如果您希望它仅限于电视设备。每个 Android TV 或类似设备都需要实现的功能列表。不幸的是,并非所有这些都清楚地记录在 Google 网站上,而是在他们的一些代码示例中找到。这些也应该有助于限制 Amazon Fire TV 设备上的项目。

<feature name="android.hardware.location" />
<feature name="android.hardware.location.network" />
<feature name="android.hardware.screen.landscape" />
<feature name="android.hardware.type.television" />
<feature name="android.software.app_widgets" />
<feature name="android.software.backup" />
<feature name="android.software.leanback" />
<feature name="android.software.leanback_only" />
<feature name="android.software.live_tv" />
<feature name="android.software.print" />
<feature name="android.software.voice_recognizers" />

这里重要的之一是 android.hardware.type.television。如果您想限制某些内容,请确保对您的应用所需的内容设置限制。

<uses-feature android:name="android.hardware.type.television"
   android:required="true" />

如果您的应用要求系统具备所有 Android Leanback 功能,那么您需要启用对 Leanback 的支持。

  <uses-feature android:name="android.software.leanback"
   android:required="false" />
  <uses-feature android:name="android.software.leanback_only"
   android:required="false" />

如果您只支持 Android TV 设备,您可能希望将这些设置为 true,但如果您的目标是 Amazon FireTV 设备,则将它们保留为可选。

Amazon FireTV 支持的过滤器:https://developer.amazon.com/docs/app-submission/supported-filters-on-the-amazon-appstore.html

Google Android TV Core TV 硬件配置文件:https://android.googlesource.com/device/google/atv/+/578751f94fdc584be22d7b1ea3112723a861b3af/tv_core_hardware.xml

英伟达盾:https://developer.nvidia.com/android-tv-deployment-checklist

【讨论】:

    【解决方案4】:

    也许如果您将leanback“要求”(也就是说,该应用程序仅适用于 Leanback/Android TV 设备)从 true 设置为 false

    android:name="android.software.leanback"
    android:required="false"
    

    然后侧载它。

    【讨论】:

      【解决方案5】:

      我们只需要制作用户功能:leanback as required true 以限制仅适用于商店中的 AndroidTV:

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

      【讨论】:

        猜你喜欢
        • 2016-06-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-10-06
        • 1970-01-01
        • 2017-07-09
        • 1970-01-01
        相关资源
        最近更新 更多