应用不适用于平板电脑

时间:2013-01-22 13:38:45

标签: android

  

可能重复:
  prevent tablet downloads of app

如果我希望我的应用仅在智能手机上运行,​​而不在平板电脑上运行,那么清单上的这些内容是否足够?

<compatible-screens>
    <!-- all small size screens -->
    <screen android:screenSize="small" android:screenDensity="ldpi" />
    <screen android:screenSize="small" android:screenDensity="mdpi" />
    <screen android:screenSize="small" android:screenDensity="hdpi" />
    <screen android:screenSize="small" android:screenDensity="xhdpi" />
    <!-- all normal size screens -->
    <screen android:screenSize="normal" android:screenDensity="ldpi" />
    <screen android:screenSize="normal" android:screenDensity="mdpi" />
    <screen android:screenSize="normal" android:screenDensity="hdpi" />
    <screen android:screenSize="normal" android:screenDensity="xhdpi" />
    <!-- all large size screens -->
    <screen android:screenSize="large" android:screenDensity="ldpi" />
    <screen android:screenSize="large" android:screenDensity="mdpi" />
    <screen android:screenSize="large" android:screenDensity="hdpi" />
    <screen android:screenSize="large" android:screenDensity="xhdpi" />
</compatible-screens>

3 个答案:

答案 0 :(得分:1)

那么,这取决于你对“平板电脑”的看法。

您的<compatible-screens>元素会阻止Play商店将您的应用分发到-xlarge设备(10英寸和更大的对角线屏幕尺寸)。它不会阻止Play商店将您的应用分发到{{ 1}}设备(5“到10”),其中包括许多营销人员称之为“平板电脑”的设备。

答案 1 :(得分:1)

不,这还不够,因为有大屏幕的平板电脑(例如你的应用程序仍可用于7英寸平板电脑)。你不能阻止有人下载你的应用程序只是定义它是否是平板电脑,因为它是非常抽象的。 Galaxy Note是平板电脑还是手机?你想让你的应用程序运行吗?如您所见,您可以在清单中使用此属性,但无法很好地控制设备类型。

我的建议是以编程方式定义屏幕大小,并通知用户该应用与此设备不兼容。检查屏幕类型是否满足您的条件 - 如果是 - 运行应用程序,如果没有 - 显示一个活动,不幸的是屏幕不受支持。或者调整您的应用以支持多种屏幕尺寸。

使用此属性非常discouraged,除非您有充分理由这样做:

  

警告:通常,您不应使用此清单元素。运用   这个元素可以大大减少你的潜在用户群   应用程序,不允许用户安装您的应用程序   有一个没有列出的屏幕配置的设备。   在申请时,您应该仅将其用作最后的手段   绝对不适用于所有屏幕配置。代替   使用此元素,您应该遵循支持多个指南   屏幕,以便为多个屏幕提供完整的支持   为不同的屏幕尺寸和密度添加替代资源。

答案 2 :(得分:1)

如果您使用Play商店,则可以选择在发布时使用自己的系统在哪里下载应用程序的设备。

以下是您需要的相关信息:https://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1286017&ctx=go

相关问题