将Android应用程序限制为Android TV

时间:2014-08-06 04:03:32

标签: android google-tv android-tv

我正在实施一项仅适用于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商店搜索时,我看不到我的应用程序 我怎么能像Youtube一样用于电视应用?它仅适用于Android TV(Google TV,Toshiba,Android Box) 提前谢谢。

5 个答案:

答案 0 :(得分:3)

对于像Nexus Player这样的Android电视,您的清单中建议使用以下内容。它还可以帮助您将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" />

答案 1 :(得分:1)

您可以限制Google Play Developer Console中的设备。另请查看FAQ of Google

  

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

答案 2 :(得分:0)

如果您将leanback'要求'设置为true要求'(即,该应用仅适用于Leanback / Android TV设备),可能会falseandroid:name="android.software.leanback" android:required="false"

{{1}}

并在此之后加载它。

答案 3 :(得分:0)

如果您希望仅将其限制在电视设备上。这里列出了每台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

NVIDA Shield:https://developer.nvidia.com/android-tv-deployment-checklist

答案 4 :(得分:0)

我们只需要提供用户功能:根据需要精简即可,仅将商店中的AndroidTV限制为

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