11b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainpage.title=<compatible-screens>
22a1b706ec11e53689a2f86cc8e558e74591b462aScott Mainparent.title=The AndroidManifest.xml File
32a1b706ec11e53689a2f86cc8e558e74591b462aScott Mainparent.link=manifest-intro.html
41b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main@jd:body
51b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
61b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dl class="xml">
71b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dt>syntax:</dt>
81b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dd>
91b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<pre>
101b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main&lt;<a href="#compatible-screens">compatible-screens</a>&gt;
111b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main    &lt;<a href="#screen">screen</a> android:<a href="#screenSize">screenSize</a>=["small" | "normal" | "large" | "xlarge"]
121b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main            android:<a href="#screenDensity">screenDensity</a>=["ldpi" | "mdpi" | "hdpi" | "xhdpi"] /&gt;
131b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main    ...
141b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main&lt;/compatible-screens&gt;
151b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main</pre>
161b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main</dd>
171b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
181b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dt>contained in:</dt>
191b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dd><code><a
201b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainhref="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
211b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
221b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dt>description:</dt>
233155825c256b150cfa635ad27ac7a2bab76371b0Dirk Dougherty<dd itemprop="description">Specifies each screen configuration with which the application is compatible. Only one instance
241b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainof the {@code &lt;compatible-screens&gt;} element is allowed in the manifest, but it can
251b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Maincontain multiple <code>&lt;screen&gt;</code> elements. Each <code>&lt;screen&gt;</code> element
261b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainspecifies a specific screen size-density combination with which the application is compatible.
271b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
281b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main  <p>The Android system <em>does not</em> read the {@code &lt;compatible-screens&gt;} manifest
291b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainelement (neither at install-time nor at runtime). This element is informational only and may be used
304d7bc65538c7cd9fbb1fbbcf22d1da47fcee1219Dirk Doughertyby external services (such as Google Play) to better understand the application's compatibility
311b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainwith specific screen configurations and enable filtering for users. Any screen configuration that is
321b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<em>not</em> declared in this element is a screen with which the application is <em>not</em>
334d7bc65538c7cd9fbb1fbbcf22d1da47fcee1219Dirk Doughertycompatible. Thus, external services (such as Google Play) should not provide the application to
341b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Maindevices with such screens.</p>
351b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
36d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Main<p class="caution"><strong>Caution:</strong> Normally, <strong>you should not use this manifest
371b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainelement</strong>. Using this element can dramatically reduce the potential user base for your
381b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainapplication, by not allowing users to install your application if they have a device with a screen
391b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainconfiguration that you have not listed. You should use it only as a last resort, when the
40d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Mainapplication absolutely does not work with specific screen configurations. Instead of using this
41d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Mainelement, you should follow the guide to <a href=
42d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Main"{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a> to
43d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Mainprovide scalable support for multiple screens using alternative layouts and bitmaps
44d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Mainfor different screen sizes and densities.</p>
451b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
461b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main  <p>If you want to set only a minimum screen <em>size</em> for your your application, then you
471b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainshould use the <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
481b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main&lt;supports-screens&gt;}</a> element. For example, if you want your application to be available
491b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainonly for <em>large</em> and <em>xlarge</em> screen devices, the <a
501b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainhref="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
511b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main&lt;supports-screens&gt;}</a> element allows you to declare that your application does not
524d7bc65538c7cd9fbb1fbbcf22d1da47fcee1219Dirk Doughertysupport <em>small</em> and <em>normal</em> screen sizes. External services (such as Google
534d7bc65538c7cd9fbb1fbbcf22d1da47fcee1219Dirk DoughertyPlay) will filter your application accordingly. You can also use the <a
541b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainhref="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
551b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main&lt;supports-screens&gt;}</a> element to declare whether the system should resize your
561b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainapplication for different screen sizes.</p>
571b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
582b286bb26b95ac9d4eb35679239ea12d4f63b50bDirk Dougherty  <p>Also see the <a href="{@docRoot}google/play/filters.html">Filters on Google Play</a>
594d7bc65538c7cd9fbb1fbbcf22d1da47fcee1219Dirk Doughertydocument for more information about how Google Play filters applications using this and
601b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainother manifest elements.</p>
611b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
621b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main</dd>
631b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
641b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dt>child elements:</dt>
651b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dd>
661b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main  <dl class="tag-list">
671b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
681b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main    <dt id="screen">{@code &lt;screen&gt;}</dt>
691b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main    <dd>Specifies a single screen configuration with which the application is compatible.
701b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main      <p>At least one instance of this element must be placed inside the {@code
711b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main&lt;compatible-screens&gt;} element. This element <em>must include both</em> the {@code
721b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainandroid:screenSize} and {@code android:screenDensity} attributes (if you do not declare both
731b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainattributes, then the element is ignored).</p>
741b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main
751b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main      <p class="caps">attributes:</p>
761b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main      <dl class="atn-list">
771b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main        <dt id="screenSize"><code>android:screenSize</code></dt>
781b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main        <dd><b>Required.</b> Specifies the screen size for this screen configuration.
791b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main          <p>Accepted values:</p>
801b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main          <ul>
811b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main            <li>{@code small}</li>
821b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main            <li>{@code normal}</li>
831b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main            <li>{@code large}</li>
841b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main            <li>{@code xlarge}</li>
851b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main          </ul>
861b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main          <p>For information about the different screen sizes, see <a
871b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainhref="{@docRoot}guide/practices/screens_support.html#range">Supporting Multiple Screens</a>.</p>
881b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main        </dd>
891b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main        <dt id="screenDensity"><code>android:screenDensity</code></dt>
901b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main        <dd><b>Required.</b> Specifies the screen density for this screen configuration.
911b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main          <p>Accepted values:</p>
921b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main          <ul>
931b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main            <li>{@code ldpi}</li>
941b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main            <li>{@code mdpi}</li>
951b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main            <li>{@code hdpi}</li>
961b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main            <li>{@code xhdpi}</li>
971b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main          </ul>
98d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Main          <p class="note"><strong>Note:</strong> This attribute currently does not accept
99d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Main          {@code xxhdpi} as a valid value, but you can instead specify {@code 480}
100d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Main          as the value, which is the approximate threshold for xhdpi screens.</p>
101d53f8abcf5a3227efb9996886900ae53bf386cd9Scott Main
1021b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main          <p>For information about the different screen densities, see <a
1031b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainhref="{@docRoot}guide/practices/screens_support.html#range">Supporting Multiple Screens</a>.</p>
1041b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main        </dd>
1051b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main      </dl>
1061b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main    </dd>
1071b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main  </dl>
1081b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main</dd>
109ae7067f58dcd1325c520d15d08a383187476da26Scott Main
110ae7067f58dcd1325c520d15d08a383187476da26Scott Main<dt>example</dt>
111ae7067f58dcd1325c520d15d08a383187476da26Scott Main<dd>
112ae7067f58dcd1325c520d15d08a383187476da26Scott Main<p>If your application is compatible with only small and normal screens, regardless
113ae7067f58dcd1325c520d15d08a383187476da26Scott Mainof screen density, then you must specify eight different {@code &lt;screen&gt;} elements,
114ae7067f58dcd1325c520d15d08a383187476da26Scott Mainbecause each screen size has four different density configurations. You must declare each one of
115ae7067f58dcd1325c520d15d08a383187476da26Scott Mainthese; any combination of size and density that you do <em>not</em> specify is considered a screen
116ae7067f58dcd1325c520d15d08a383187476da26Scott Mainconfiguration with which your application is <em>not</em> compatible. Here's what the manifest
117ae7067f58dcd1325c520d15d08a383187476da26Scott Mainentry looks like if your application is compatible with only small and normal screens:</p>
118ae7067f58dcd1325c520d15d08a383187476da26Scott Main
119ae7067f58dcd1325c520d15d08a383187476da26Scott Main<pre>
120ae7067f58dcd1325c520d15d08a383187476da26Scott Main&lt;manifest ... >
121ae7067f58dcd1325c520d15d08a383187476da26Scott Main    ...
122ae7067f58dcd1325c520d15d08a383187476da26Scott Main    &lt;compatible-screens>
123ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;!-- all small size screens -->
124ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;screen android:screenSize="small" android:screenDensity="ldpi" />
125ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;screen android:screenSize="small" android:screenDensity="mdpi" />
126ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;screen android:screenSize="small" android:screenDensity="hdpi" />
127ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;screen android:screenSize="small" android:screenDensity="xhdpi" />
128ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;!-- all normal size screens -->
129ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;screen android:screenSize="normal" android:screenDensity="ldpi" />
130ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;screen android:screenSize="normal" android:screenDensity="mdpi" />
131ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;screen android:screenSize="normal" android:screenDensity="hdpi" />
132ae7067f58dcd1325c520d15d08a383187476da26Scott Main        &lt;screen android:screenSize="normal" android:screenDensity="xhdpi" />
133ae7067f58dcd1325c520d15d08a383187476da26Scott Main    &lt;/compatible-screens>
134ae7067f58dcd1325c520d15d08a383187476da26Scott Main    &lt;application ... >
135ae7067f58dcd1325c520d15d08a383187476da26Scott Main        ...
136ae7067f58dcd1325c520d15d08a383187476da26Scott Main    &lt;application>
137ae7067f58dcd1325c520d15d08a383187476da26Scott Main&lt;/manifest>
138ae7067f58dcd1325c520d15d08a383187476da26Scott Main</pre>
139ae7067f58dcd1325c520d15d08a383187476da26Scott Main</dd>
140ae7067f58dcd1325c520d15d08a383187476da26Scott Main
1411b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dt>introduced in:</dt>
1421b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dd>API Level 9</dd>
1431b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dt>see also:</dt>
1441b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main<dd><a
1451b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Mainhref="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></dd>
1462b286bb26b95ac9d4eb35679239ea12d4f63b50bDirk Dougherty<dd><a href="{@docRoot}google/play/filters.html">Filters on Google Play</a></dd>
1471b6dd05927bf381f8a912447dfb79f49b60b9d03Scott Main</dl>
148