<compatible-screens> <screen android:screenSize=["small" | "normal" | "large" | "xlarge"] android:screenDensity=["ldpi" | "mdpi" | "hdpi" | "xhdpi" | "280" | "360" | "420" | "480" | "560" ] /> ... </compatible-screens>
<manifest>
<compatible-screens>
element is allowed in the manifest, but it can contain multiple
<screen>
elements. Each
<screen>
element specifies a specific screen size-density combination with which the application is compatible.
The Android system does not read the <compatible-screens>
manifest element (neither at install-time nor at runtime). This element is informational only and may be used by external services (such as Google Play) to better understand the application's compatibility with specific screen configurations and enable filtering for users. Any screen configuration that is not declared in this element is a screen with which the application is not compatible. Thus, external services (such as Google Play) should not provide the application to devices with such screens.
Caution: 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.
If you want to set only a minimum screen size for your your application, then you should use the<supports-screens>
element. For example, if you want your application to be available only for large andxlarge screen devices, the <supports-screens>
element allows you to declare that your application does not support small and normal screen sizes. External services (such as Google Play) will filter your application accordingly. You can also use the <supports-screens>
element to declare whether the system should resize your application for different screen sizes.
Also see the Filters on Google Play document for more information about how Google Play filters applications using this and other manifest elements.
If your application is compatible with only small and normal screens, regardless of screen density, then you must specify eight different <screen>
elements, because each screen size has four different density configurations. You must declare each one of these; any combination of size and density that you do notspecify is considered a screen configuration with which your application is not compatible. Here's what the manifest entry looks like if your application is compatible with only small and normal screens:
<manifest ... > ... <compatible-screens> <!-- all small size 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" /> <!-- all normal size screens --> <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" /> </compatible-screens> <application ... > ... <application> </manifest>
< compatible-screens > < screen android: screenSize = ["small" | "normal" | "large" | "xlarge" ] android: screenDensity = ["ldpi" | "mdpi" | "hdpi" | "xhdpi" | "280" | "360" | "420" | "480" | "560" ] /> ... </compatible-screens>
<清单>
<兼容的屏幕>
元素被允许在清单中,但它可以包含多个
<屏幕>
元素。每个
<屏幕>
元素指定特定的屏幕尺寸密度组合与该应用程序是兼容的。
Android系统不会读取<兼容的屏幕>
清单元素(既不在安装时也没有在运行时)。此元素仅供参考,可以由外部服务中使用(如谷歌播放),以更好地了解应用程序的特定屏幕配置的兼容性,使过滤用户。即任何屏幕配置 并不在此元素声明的是与该应用程序是一个屏幕不 兼容。因此,外部服务(如谷歌播放)不应该提供应用程序能与这样屏幕的设备。
注意:通常情况下,你不应该使用这个清单元素。使用该元素可以通过不允许用户,如果他们有,你有没有列出的屏幕配置的设备安装应用程序极大地降低了潜在用户群为您的应用程序。你应该使用它只能作为最后的手段,当应用程序绝对不会与具体的屏幕配置工作。而不是使用这个元素,应该遵循的指导支持多种屏幕提供使用替代布局和位图不同的屏幕大小和密度的多个屏幕可扩展的支持。
如果你只想设置一个最小的屏幕尺寸为您的应用程序,那么你应该使用<支持的屏幕>
元素。例如,如果你希望你的应用程序只为提供大和XLARGE屏幕设备中,<支持的屏幕>
元素允许你声明你的应用程序不支持小型和正常的屏幕尺寸。外部服务(如谷歌播放)将相应地过滤你的应用程序。您也可以使用<支持的屏幕>
元素申报制度是否应调整您针对不同屏幕尺寸的应用。
也看到了在谷歌的过滤器播放 的文件有关谷歌Play如何使用此过滤器的应用程序和其他清单元素的更多信息。
如果应用程序是只小,正常的屏幕兼容,无论屏幕密度,那么你必须指定八个不同的<屏幕>
元素,因为每个屏幕尺寸有四个不同的密度配置。您必须声明,这些每一个; 大小和你的密度的任意组合没有指定被认为是屏幕配置与您的应用程序不兼容。这里的清单条目的样子,如果你的应用程序只小,标准屏幕兼容:
<清单... > ... <兼容的屏幕> <! -所有的小尺寸屏幕 一切正常尺寸屏幕