compatible-screens-element.jd revision 1b6dd05927bf381f8a912447dfb79f49b60b9d03
1page.title=<compatible-screens>
2@jd:body
3
4<dl class="xml">
5<dt>syntax:</dt>
6<dd>
7<pre>
8&lt;<a href="#compatible-screens">compatible-screens</a>&gt;
9    &lt;<a href="#screen">screen</a> android:<a href="#screenSize">screenSize</a>=["small" | "normal" | "large" | "xlarge"]
10            android:<a href="#screenDensity">screenDensity</a>=["ldpi" | "mdpi" | "hdpi" | "xhdpi"] /&gt;
11    ...
12&lt;/compatible-screens&gt;
13</pre>
14</dd>
15
16<dt>contained in:</dt>
17<dd><code><a
18href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
19
20<dt>description:</dt>
21<dd>Specifies each screen configuration with which the application is compatible. Only one instance
22of the {@code &lt;compatible-screens&gt;} element is allowed in the manifest, but it can
23contain multiple <code>&lt;screen&gt;</code> elements. Each <code>&lt;screen&gt;</code> element
24specifies a specific screen size-density combination with which the application is compatible.
25
26  <p>The Android system <em>does not</em> read the {@code &lt;compatible-screens&gt;} manifest
27element (neither at install-time nor at runtime). This element is informational only and may be used
28by external services (such as Android Market) to better understand the application's compatibility
29with specific screen configurations and enable filtering for users. Any screen configuration that is
30<em>not</em> declared in this element is a screen with which the application is <em>not</em>
31compatible. Thus, external services (such as Android Market) should not provide the application to
32devices with such screens.</p>
33
34  <p class="caution"><strong>Caution:</strong> Normally, <strong>you should not use this manifest
35element</strong>. Using this element can dramatically reduce the potential user base for your
36application, by not allowing users to install your application if they have a device with a screen
37configuration that you have not listed. You should use it only as a last resort, when the
38application absolutely does not work with all screen configurations. Instead of using this element,
39you should follow the guide to <a href="{@docRoot}guide/practices/screens_support.html">Supporting
40Multiple Screens</a>, in order to provide complete support for multiple screens, by adding
41alternative resources for different screen sizes and densities.</p>
42
43  <p>If you want to set only a minimum screen <em>size</em> for your your application, then you
44should use the <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
45&lt;supports-screens&gt;}</a> element. For example, if you want your application to be available
46only for <em>large</em> and <em>xlarge</em> screen devices, the <a
47href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
48&lt;supports-screens&gt;}</a> element allows you to declare that your application does not
49support <em>small</em> and <em>normal</em> screen sizes. External services (such as Android
50Market) will filter your application accordingly. You can also use the <a
51href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
52&lt;supports-screens&gt;}</a> element to declare whether the system should resize your
53application for different screen sizes.</p>
54
55  <p>Also see the <a href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a>
56document for more information about how Android Market filters applications using this and
57other manifest elements.</p>
58
59</dd>
60
61<dt>child elements:</dt>
62<dd>
63  <dl class="tag-list">
64
65    <dt id="screen">{@code &lt;screen&gt;}</dt>
66    <dd>Specifies a single screen configuration with which the application is compatible.
67      <p>At least one instance of this element must be placed inside the {@code
68&lt;compatible-screens&gt;} element. This element <em>must include both</em> the {@code
69android:screenSize} and {@code android:screenDensity} attributes (if you do not declare both
70attributes, then the element is ignored).</p>
71
72      <p class="caps">attributes:</p>
73      <dl class="atn-list">
74        <dt id="screenSize"><code>android:screenSize</code></dt>
75        <dd><b>Required.</b> Specifies the screen size for this screen configuration.
76          <p>Accepted values:</p>
77          <ul>
78            <li>{@code small}</li>
79            <li>{@code normal}</li>
80            <li>{@code large}</li>
81            <li>{@code xlarge}</li>
82          </ul>
83          <p>For information about the different screen sizes, see <a
84href="{@docRoot}guide/practices/screens_support.html#range">Supporting Multiple Screens</a>.</p>
85        </dd>
86        <dt id="screenDensity"><code>android:screenDensity</code></dt>
87        <dd><b>Required.</b> Specifies the screen density for this screen configuration.
88          <p>Accepted values:</p>
89          <ul>
90            <li>{@code ldpi}</li>
91            <li>{@code mdpi}</li>
92            <li>{@code hdpi}</li>
93            <li>{@code xhdpi}</li>
94          </ul>
95          <p>For information about the different screen densities, see <a
96href="{@docRoot}guide/practices/screens_support.html#range">Supporting Multiple Screens</a>.</p>
97        </dd>
98      </dl>
99    </dd>
100  </dl>
101</dd>
102<dt>introduced in:</dt>
103<dd>API Level 9</dd>
104<dt>see also:</dt>
105<dd><a
106href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></dd>
107<dd><a href="{@docRoot}guide/appendix/market-filters.html">Market Filters</a></dd>
108</dl>
109