应用在某些设备上不可见 [英] App not visible on certain devices

查看:90
本文介绍了应用在某些设备上不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Google Play商店中发布了一个应用,但许多设备不支持该应用,例如Sony Xperia Z2,OnePlus2等.我的应用的清单文件为:

I've published an app on Google Play Store but it is unsupported for a number of devices such Sony Xperia Z2, OnePlus2 etc. The manifest file for my app is:

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

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

    <!-- Only hdpi and xhdpi for 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" />

    <!-- all large size screens -->
    <screen
        android:screenDensity="ldpi"
        android:screenSize="large" />
    <screen
        android:screenDensity="mdpi"
        android:screenSize="large" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="large" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="large" />

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

    <!-- Special case for Nexus 7 -->
    <screen
        android:screenDensity="213"
        android:screenSize="large" />

    <!-- Special case for Samsung S6, One Plus Two, Note 5 -->
    <screen
        android:screenDensity="560"
        android:screenSize="small" />
    <screen
        android:screenDensity="640"
        android:screenSize="small" />
    <screen
        android:screenDensity="560"
        android:screenSize="normal" />
    <screen
        android:screenDensity="640"
        android:screenSize="normal" />
    <screen
        android:screenDensity="560"
        android:screenSize="large" />
    <screen
        android:screenDensity="640"
        android:screenSize="large" />

</compatible-screens>

我认为问题出在约400 dpi的设备上.如何使这些设备可支持我的应用?

I think the issue is for ~400 dpi devices. How can I make these devices supportable for my app?

推荐答案

来自Android开发者文档

兼容的屏幕:

From the Android Developer docs

compatible screens:

通常,您不应使用此清单元素.如果用户使用的设备具有未列出的屏幕配置,则不允许用户安装您的应用程序,因此使用此元素可以极大地减少应用程序的潜在用户群.当应用程序绝对不适用于特定的屏幕配置时,应仅将其用作最后的选择.代替使用此元素,您应该遵循支持多屏幕"指南,为不同的屏幕尺寸和密度使用备用布局和位图为多屏幕提供可扩展的支持.

Normally, you should not use this manifest element. Using this element can dramatically reduce the potential user base for your application, by not allowing users to install your application if they have a device with a screen configuration that you have not listed. You should use it only as a last resort, when the application absolutely does not work with specific screen configurations. Instead of using this element, you should follow the guide to Supporting Multiple Screens to provide scalable support for multiple screens using alternative layouts and bitmaps for different screen sizes and densities.

如果您希望将您的应用分发到任何类型的设备,无论屏幕大小和密度如何,都应从清单文件中删除<compatible-screens>标记.

If you want your app to be distributed to any type of device, irrespective of the screen size and density, you should remove the <compatible-screens> tag from your manifest file.

根据我对清单文件的了解,您希望支持所有设备.如果是这种情况,请继续从清单中完全删除<compatible-screens>标记.

From what I understand from your manifest file, you want to support all the devices. If that's the case, go ahead and remove the <compatible-screens> tag completely from your manifest.

但是,如果必须使用<compatible-screens>标签将应用的可用性限制为某些屏幕类型,则应为所有屏幕尺寸添加<screen>项和android:screenDensity="480"项,以支持具有xxhdpi屏幕的设备密度.您提到的Xperia Z2和One Plus 2设备属于xxhdpi存储桶,添加上述条目将使您的应用程序可用于这些设备.

However, if you have to use the <compatible-screens> tag to restrict the availability of your app to certain screen types, you should add <screen> entries with android:screenDensity="480" for all the screen sizes, to support devices with xxhdpi screen density. The devices Xperia Z2 and One Plus 2 you've mentioned fall in the xxhdpi bucket, and adding the above mentioned entries will make your app available for these devices.

这篇关于应用在某些设备上不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆