android - Play 商店的应用程序屏幕密度支持

标签 android xml google-play android-manifest screen-density

我想在 Play 商店中为所有密度的小型和普通手机部署我的应用程序。 android:screenDensity <screen> 的属性元素没有 xxhdpixxxhdpi密度作为预定义值。 我应该使用这些值 480560对于相应的缺失密度?

或者我可以用这个吗?

<supports-screens android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="false"
                  android:xlargeScreens="false"/>

这是否涵盖了所选屏幕尺寸的所有密度?

最佳答案

<supports-screens>标签,设置 android:largeScreens 的值和 android:xlargeScreens设置为 false 不会使您的应用程序无法用于这些屏幕尺寸。它只会为您的应用在这些屏幕尺寸上启用屏幕兼容模式。

来自 Android 开发者 doc :

android:largeScreens

Indicates whether the application supports larger screen form-factors. A large screen is defined as a screen that is significantly larger than a "normal" handset screen, and thus might require some special care on the application's part to make good use of it, though it may rely on resizing by the system to fill the screen. The default value for this actually varies between some versions, so it's better if you explicitly declare this attribute at all times. Beware that setting it "false" will generally enable screen compatibility mode.

android:xlargeScreens

Indicates whether the application supports extra large screen form-factors. An xlarge screen is defined as a screen that is significantly larger than a "large" screen, such as a tablet (or something larger) and may require special care on the application's part to make good use of it, though it may rely on resizing by the system to fill the screen. The default value for this actually varies between some versions, so it's better if you explicitly declare this attribute at all times. Beware that setting it "false" will generally enable screen compatibility mode.

如果您想让您的应用仅适用于手机,请将以下内容添加到您的 list 中:

<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" />
    <screen android:screenSize="small" android:screenDensity="480" />
    <!-- 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" />
    <screen android:screenSize="small" android:screenDensity="480" />
</compatible-screens>

带有 android:screenDensity="480" 的条目是为了支持 xxhdpi 桶。

看看this article Android 开发者文档,其中解释了如何让您的应用仅供手机使用。

关于android - Play 商店的应用程序屏幕密度支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35793753/

相关文章:

java - 在 Eclipse 中管理应用程序的 Lite 和 Pro 版本

android - 有没有办法设置允许一组用户下载我的 android 应用程序的最高版本?

android - 当我在 android 中更改 Activity 时,进度条消失

Android 支持子模块目录中的 V4 断开链接

java - "layout"与 Android Studio 中的 "layout resource"相同吗?如何以编程方式创建 XML 布局资源?

android - 更改安卓 :minSdk in already published App in Google Play Store

java - 设置项目单击监听器事件没有受到影响吗?

android - 用项目填充操作栏 SHerlock

xml - <xs :all> 下的元素重复

android - 设置appcompat工具栏菜单字体样式加粗