简体   繁体   English

如何在Android中支持所有设备(移动设备和平板电脑)?

[英]How to support all devices( Both mobile and Tablets) in android?

My app is designed for all devices (both mobile and tablet). 我的应用程序适用于所有设备(移动设备和平板电脑)。 But Some devices are not supported in play store publish. 但是Play商店发布不支持某些设备。 I have included my manifest file also. 我也包括清单文件。

What I have did mistake ? 我做错了什么?

<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>

You can use the below code in manifest file 您可以在清单文件中使用以下代码

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

One mistake is that you have <compatible-screens> . 一个错误是您拥有<compatible-screens> If you want to support all screen sizes and densities, delete your <compatible-screens> element. 如果要支持所有屏幕尺寸和密度,请删除<compatible-screens>元素。 As it stands, you are missing some densities. 就目前而言,您缺少一些密度。

Also note that "all devices" runs counter to your <supports-screens> element, where you say that there is a minimum size of 240dp along one side. 另请注意,“所有设备”与您的<supports-screens>元素背道而驰,您说的是,一侧的最小尺寸为240dp。 This, however, is not being used for Play Store filtering, at least according to the documentation, last I checked. 但是,至少在我上次检查时,至少根据文档,它并未用于Play商店过滤。

Also make sure if you use any features such as telephony etc that the uses-feature option is configured in the androidmanifest.xml 还请确保是否使用了诸如电话等功能,并且在androidmanifest.xml中配置了uses-feature选项。

eg 例如

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

There's quite a few of these for things like bluetooth wifi etc so if any devices don't have these features but you still want the app to install on them then that "required" flag will need to be set. 其中有很多用于蓝牙wifi等功能,因此,如果任何设备不具备这些功能,但是您仍然希望在其上安装应用程序,则需要设置“ required”标志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何设计应用程序以支持Android中的多屏设备和平板电脑 - How to design application to support multi-screen devices and tablets in Android Android,如何支持平板电脑? - Android, How to support tablets? 移动重定向包含Android设备,但不包括平板电脑? - Mobile redirect to include Android devices, but not tablets? 如何为所有Android设备和平板电脑设置单一布局? - How to set single layout for all Android devices and tablets? 如何在平板电脑和手机的android设备上获得正确的方向更改窗口宽度 - How to get the correct window width on orientation change for android devices both tablets and phone 如何为平板电脑和手机的Android设备在方向变化时获得正确的窗口宽度 - How to get the correct window width on orientation change for android devices both tablets and mobiles 如何在除平板电脑以外的所有设备上实现此布局 - How to achieve this layout on all devices excluding tablets Android如何定位元素以支持所有设备 - android how to position elements to support in all devices 如何查找仅移动设备和平板电脑支持的javascript属性? - How to find javascript properties which are only supported by mobile devices and tablets? 如何使页面跳转在移动设备和平板电脑上起作用? - How to make page jump work on mobile devices and tablets?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM