【问题标题】:How to support all devices( Both mobile and Tablets) in android?如何在 android 中支持所有设备(手机和平板电脑)?
【发布时间】:2014-03-19 11:43:13
【问题描述】:

我的应用专为所有设备(移动设备和平板电脑)而设计。但 Play 商店发布不支持某些设备。我也包含了我的清单文件。

我做错了什么?

<supports-screens android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:xlargeScreens="true"
                  android:anyDensity="true"
                  android:resizeable="true"
                  android:requiresSmallestWidthDp="240"
                  />
<compatible-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="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="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" />

    <screen android:screenSize="xlarge" android:screenDensity="ldpi" />
    <screen android:screenSize="xlarge" android:screenDensity="mdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="hdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
</compatible-screens>

【问题讨论】:

  • 可能是您支持的最低 SDK。你检查了吗?
  • 同时发布最小和最大支持版本。
  • &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" /&gt; 设置并尝试。
  • 但是有些sdk更高的设备不支持...为什么???

标签: android device


【解决方案1】:

您可以在清单文件中使用以下代码

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

【讨论】:

    【解决方案2】:

    一个错误是你有&lt;compatible-screens&gt;。如果您想支持所有屏幕尺寸和密度,请删除您的 &lt;compatible-screens&gt; 元素。就目前而言,您缺少一些密度。

    另请注意,“所有设备”与您的 &lt;supports-screens&gt; 元素背道而驰,您说一侧的最小尺寸为 240dp。但是,至少根据我上次检查的文档,这并没有用于 Play 商店过滤。

    【讨论】:

      【解决方案3】:

      还要确保如果您使用任何功能(例如电话等),则在 androidmanifest.xml 中配置了 uses-feature 选项

      例如

      <uses-feature android:name="android.hardware.telephony" android:required="false"/>
      

      其中有很多用于蓝牙 wifi 等功能,因此如果任何设备没有这些功能但您仍希望在其上安装应用程序,则需要设置“必需”标志。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-05-10
        • 2017-03-06
        • 2013-02-15
        • 1970-01-01
        • 2012-07-05
        • 1970-01-01
        • 2012-07-06
        • 1970-01-01
        相关资源
        最近更新 更多