android - Android 设备上的屏幕兼容性

标签 android android-manifest

我希望只为智能手机而非平板电脑下载我的应用程序。

为了屏幕兼容性,我在 list 中放了这行

<compatible-screens>
    <!-- all small size screens -->
    <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="mdpi" />
    <screen android:screenSize="normal" android:screenDensity="hdpi" />
    <screen android:screenSize="normal" android:screenDensity="xhdpi" />
    <screen android:screenSize="normal" android:screenDensity="480" />
    <!-- all large size screens -->
    <screen android:screenSize="large" android:screenDensity="mdpi" />
    <screen android:screenSize="large" android:screenDensity="hdpi" />
    <screen android:screenSize="large" android:screenDensity="xhdpi" />
    <!-- all large size screens --> 
    <screen android:screenSize="xlarge" android:screenDensity="mdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="hdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
</compatible-screens>

在正常尺寸的屏幕中,我添加了一行屏幕密度 = 480。这应该让三星 s5 等设备能够下载该应用程序。

在网上冲浪时,我发现为了避免从平板电脑上下载该应用程序,我应该删除专用于超大屏幕的部分。 但如果我这样做,我担心三星 s4 和三星 s5 等设备将无法下载我的应用程序。

这是真的吗?

最佳答案

好吧,让我们看看。 你可以引用这个链接:

http://developer.android.com/guide/practices/screens_support.html

要了解“screenSize”或 screenDensity 的大小,更具体地说,就是这张图片。

enter image description here

例如,三星 S5 有一个 5.1 英寸的显示屏,从图中可以看出它很大;和 432 ppi 的密度,这意味着 xhdpi(嗯,它被认为类似于 xxhdpi,不是吗?)。 你为什么把它添加到正常?大小应该很大(除非硬件向操作系统提供错误读数,这并非闻所未闻,但三星设备不太可能)。

无论哪种方式,删除他们所说的内容

    <compatible-screens>
<!-- all small size screens -->
<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="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
<screen android:screenSize="normal" android:screenDensity="480" />
<!-- all large size screens -->
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />

不影响 s8。

考虑到有多少设备遵循奇怪的规则运行 android(早期版本的 android 甚至不遵循这些确切的规则)来阻止平板电脑,这绝非易事,也不太可能。是的,我们都希望他们想出一个简单的平板电脑标签。

留大意味着一些平板电脑将能够安装您的应用程序(有 7 英寸平板电脑)。大幅削减意味着大多数平板手机甚至旗舰手机都会被削减。

最后,您应该关注的是,不是根据设备定义来阻止,而是根据您的应用在该尺寸下的外观。希望这会有所帮助。

编辑:这个 wiki 链接也很有用 wiki

关于android - Android 设备上的屏幕兼容性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23522742/

相关文章:

android - 在 Android Studio 中导入 Urban Airship 会出现编译问题?

javascript - HttpRequestHandler : Sending a pdf file in response

android - 下方带有水平进度条的工具栏

Android Studio 没有注意到我更改了 AndroidManifest

android - 针对特定包的自定义 Intent

android:exported 需要为 <activity> 显式指定

android - 如何使用新的 xml 属性并与旧的 Android 版本兼容?

android - 从 Android Studio 中的 apk 中排除模块

android - 在 ExpandableListView 的 Default GroupIndicator 上添加 onClickListener

android - 如何以编程方式禁用android上的状态栏/通知栏?