blob: c1fac9481ed5ef6328fe2fb757f8d9feed1d8ae1 [file] [log] [blame]
parent.title=The AndroidManifest.xml File
<dl class="xml">
&lt;<a href="#compatible-screens">compatible-screens</a>&gt;
&lt;<a href="#screen">screen</a> android:<a href="#screenSize">screenSize</a>=["small" | "normal" | "large" | "xlarge"]
android:<a href="#screenDensity">screenDensity</a>=["ldpi" | "mdpi" | "hdpi" | "xhdpi"
| "280" | "360" | "420" | "480" | "560" ] /&gt;
<dt>contained in:</dt>
<dd itemprop="description">Specifies each screen configuration with which the application is compatible. Only one instance
of the <code>&lt;compatible-screens&gt;</code> element is allowed in the manifest, but it can
contain multiple <code>&lt;screen&gt;</code> elements. Each <code>&lt;screen&gt;</code> element
specifies a specific screen size-density combination with which the application is compatible.
<p>The Android system <em>does not</em> read the {@code <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
<em>not</em> declared in this element is a screen with which the application is <em>not</em>
compatible. Thus, external services (such as Google Play) should not provide the application to
devices with such screens.</p>
<p class="caution"><strong>Caution:</strong> Normally, <strong>you should not use this manifest
element</strong>. 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 <a href=
"{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a> to
provide scalable support for multiple screens using alternative layouts and bitmaps
for different screen sizes and densities.</p>
<p>If you want to set only a minimum screen <em>size</em> for your your application, then you
should use the <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
<supports-screens>}</a> element. For example, if you want your application to be available
only for <em>large</em> and <em>xlarge</em> screen devices, the <a
<supports-screens>}</a> element allows you to declare that your application does not
support <em>small</em> and <em>normal</em> screen sizes. External services (such as Google
Play) will filter your application accordingly. You can also use the <a
<supports-screens>}</a> element to declare whether the system should resize your
application for different screen sizes.</p>
<p>Also see the <a href="{@docRoot}google/play/filters.html">Filters on Google Play</a>
document for more information about how Google Play filters applications using this and
other manifest elements.</p>
<dt>child elements:</dt>
<dl class="tag-list">
<dt id="screen">{@code <screen>}</dt>
<dd>Specifies a single screen configuration with which the application is compatible.
<p>At least one instance of this element must be placed inside the {@code
<compatible-screens>} element. This element <em>must include both</em> the {@code
android:screenSize} and {@code android:screenDensity} attributes (if you do not declare both
attributes, then the element is ignored).</p>
<p class="caps">attributes:</p>
<dl class="atn-list">
<dt id="screenSize"><code>android:screenSize</code></dt>
<dd><b>Required.</b> Specifies the screen size for this screen configuration.
<p>Accepted values:</p>
<li>{@code small}</li>
<li>{@code normal}</li>
<li>{@code large}</li>
<li>{@code xlarge}</li>
<p>For information about the different screen sizes, see <a
href="{@docRoot}guide/practices/screens_support.html#range">Supporting Multiple Screens</a>.</p>
<dt id="screenDensity"><code>android:screenDensity</code></dt>
<dd><b>Required.</b> Specifies the screen density for this screen configuration.
<p>Accepted values:</p>
<li>{@code "ldpi"} (approximately 120 dpi)</li>
<li>{@code "mdpi"} (approximately 160 dpi)</li>
<li>{@code "hdpi"} (approximately 240 dpi)</li>
<li>{@code "xhdpi"} (approximately 320 dpi)</li>
<li>{@code "280"}</li>
<li>{@code "360"}</li>
<li>{@code "420"}</li>
<li>{@code "480"}</li>
<li>{@code "560"}</li>
<p>For information about the different screen densities, see <a
href="{@docRoot}guide/practices/screens_support.html#range">Supporting Multiple Screens</a>.</p>
<p>If your application is compatible with only small and normal screens, regardless
of screen density, then you must specify twelve different {@code <screen>} elements,
because each screen size has six different density configurations. You must declare each one of
these; any combination of size and density that you do <em>not</em> specify is considered a screen
configuration with which your application is <em>not</em> compatible. Here's what the manifest
entry looks like if your application is compatible with only small and normal screens:</p>
&lt;manifest ... >
&lt;!-- all small size screens -->
&lt;screen android:screenSize="small" android:screenDensity="ldpi" />
&lt;screen android:screenSize="small" android:screenDensity="mdpi" />
&lt;screen android:screenSize="small" android:screenDensity="hdpi" />
&lt;screen android:screenSize="small" android:screenDensity="xhdpi" />
&lt;screen android:screenSize="small" android:screenDensity="xxhdpi" />
&lt;screen android:screenSize="small" android:screenDensity="xxxhdpi" />
&lt;!-- all normal size screens -->
&lt;screen android:screenSize="normal" android:screenDensity="ldpi" />
&lt;screen android:screenSize="normal" android:screenDensity="mdpi" />
&lt;screen android:screenSize="normal" android:screenDensity="hdpi" />
&lt;screen android:screenSize="normal" android:screenDensity="xhdpi" />
&lt;screen android:screenSize="normal" android:screenDensity="xxhdpi" />
&lt;screen android:screenSize="normal" android:screenDensity="xxxhdpi" />
&lt;application ... >
<dt>introduced in:</dt>
<dd>API Level 9</dd>
<dt>see also:</dt>
href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></dd>
<dd><a href="{@docRoot}google/play/filters.html">Filters on Google Play</a></dd>