【发布时间】:2011-12-05 20:46:33
【问题描述】:
我想为我的 Google Play 应用程序添加过滤器。
我只想将我的应用程序仅显示给手机设备而不是平板电脑用户。
那么除了<screen-supports>,我还能放什么过滤器呢?
是否有针对手机、平板电脑或平板电脑的特定过滤器?
【问题讨论】:
标签: android filter google-play android-manifest tablet
我想为我的 Google Play 应用程序添加过滤器。
我只想将我的应用程序仅显示给手机设备而不是平板电脑用户。
那么除了<screen-supports>,我还能放什么过滤器呢?
是否有针对手机、平板电脑或平板电脑的特定过滤器?
【问题讨论】:
标签: android filter google-play android-manifest tablet
声明应用仅适用于平板电脑;
<supports-screens android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="true"
android:xlargeScreens="true"
android:requiresSmallestWidthDp="600" />
声明应用仅适用于手机
<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" />
</compatible-screens>
详细信息:http://developer.android.com/guide/practices/screens-distribution.html#FilteringHandsetApps
编辑: 兼容屏幕中没有 xxhdpi 选择器,因此您可以使用; 平板电脑:
<supports-screens android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="true"
android:xlargeScreens="true" />
电话:
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="false"
android:xlargeScreens="false" />
【讨论】:
我遇到了同样的问题,我同意秋刀鱼之前所说的。你肯定需要声明一个 min 和 maxsdk 以及 targetsdk。它应该有助于编织手机。您可以尝试的另一件事是执行使用功能电话 = true。这将编织出更多没有电话功能的平板电脑。
还考虑使用兼容屏幕而不是支持屏幕。支持屏幕是最小过滤器,而兼容屏幕是范围过滤器。这意味着如果您声明supports-screens small false、normal、true、large false、xlarge false,市场仍然会认为应用程序支持large 和xlarge。兼容的屏幕将允许您仅声明您的应用程序可以支持的内容。虽然不是 100% 准确,但它会缩小竞争环境。
另外,您应该查看支持的设备列表,找到规格并手动将它们排除在支持之外。
编辑:您还可以通过生成示例 apk 并将其上传到门户网站来获得一个很好的平板电脑列表。在清单中使用supports-screen small false、normal false、large true 和xlarge true。这将为您提供属于谷歌过滤器的平板电脑设备列表。显然会有奇怪的分辨率平板电脑,但这会为您缩小列表范围。
【讨论】:
请参阅来自Android Developer 站点的“Supporting Multiple Screens”文章,该文章为您提供了有关配置的足够信息。阅读一些示例的“配置示例”。
【讨论】: