【问题标题】:What is the right screen size and density configuration of Nexus 6?Nexus 6 的正确屏幕尺寸和密度配置是多少?
【发布时间】:2015-04-02 13:46:12
【问题描述】:

我的应用没有将 Nexus 6 列为 Google Play 管理中心支持的设备。

我阅读了Getting Your Apps Ready for Nexus 6 and Nexus 9 的博客文章,其中说:

Nexus 6 的量化密度为 560 dpi,介于 xxhdpi 和 xxxhdpi 主要密度桶。

有一段正是关于我的问题:

确保您没有被 Google Play 过滤

如果您使用的是 AndroidManifest.xml 文件中的元素,您 应该停止使用它,因为它不可扩展以重新编译和 每次新设备问世时发布您的应用程序。但是,如果您必须 使用它,请确保更新清单以添加配置 这些设备(按屏幕尺寸和密度)。否则你的应用程序可能 从这些设备上的 Google Play 搜索结果中排除。

好吧,我必须使用<compatible-screens>,因为我试图从平板电脑中排除我的应用。

我当前在 Manifest 中的 <compatible-screens> 元素看起来像:

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

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

Nexus 6 的正确配置是什么?

我试过了:

    <screen
        android:screenDensity="560"
        android:screenSize="normal" />
    <screen
        android:screenDensity="480"
        android:screenSize="large" />
    <screen
        android:screenDensity="560"
        android:screenSize="large" />
    <screen
        android:screenDensity="640"
        android:screenSize="large" />

但似乎没有一个可以解决问题。

【问题讨论】:

    标签: android android-manifest google-nexus device-compatibility


    【解决方案1】:

    我询问了 Google Play 支持并得到了帮助我解决问题的答案。

    仍然不能 100% 确定正确的屏幕配置,但似乎

    <screen
        android:screenDensity="560"
        android:screenSize="normal" />
    

    是正确的选择。


    不过,由于我的应用清单中存在冲突,我的应用与 Nexus 6 不兼容。我使用了以下功能要求:

    <uses-feature android:name="android.hardware.LOCATION" />
    <uses-feature android:name="android.hardware.TELEPHONY" />
    <uses-feature android:name="android.hardware.TOUCHSCREEN" />
    <uses-feature android:name="android.hardware.WIFI" />
    <uses-feature android:name="android.hardware.location.GPS" />
    <uses-feature android:name="android.hardware.location.NETWORK" />
    <uses-feature android:name="android.hardware.screen.PORTRAIT" />
    

    但正确的版本是所有小写字母列出的功能:

    <uses-feature android:name="android.hardware.location" />
    <uses-feature android:name="android.hardware.telephony" />
    <uses-feature android:name="android.hardware.touchscreen" />
    <uses-feature android:name="android.hardware.wifi" />
    <uses-feature android:name="android.hardware.location.gps" />
    <uses-feature android:name="android.hardware.location.network" />
    <uses-feature android:name="android.hardware.screen.portrait" />
    

    这有点棘手,因为权限(在&lt;uses-permission&gt;)像

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    

    应以大写字母列出,但特征(&lt;uses-feature&gt;)应小写

    我在任何其他设备上都没有遇到过同样的问题,但如果 Nexus 6 需要这样做,这可能是正确的做法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-17
      • 2023-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多