supports-screens-element.jd revision 2a1b706ec11e53689a2f86cc8e558e74591b462a
1page.title=<supports-screens> 2parent.title=The AndroidManifest.xml File 3parent.link=manifest-intro.html 4@jd:body 5 6<dl class="xml"> 7 8<dt>syntax:</dt> 9<dd> 10<pre class="stx"> 11<supports-screens android:<a href="#resizeable">resizeable</a>=["true" | "false"] 12 android:<a href="#small">smallScreens</a>=["true" | "false"] 13 android:<a href="#normal">normalScreens</a>=["true" | "false"] 14 android:<a href="#large">largeScreens</a>=["true" | "false"] 15 android:<a href="#xlarge">xlargeScreens</a>=["true" | "false"] 16 android:<a href="#any">anyDensity</a>=["true" | "false"] /> 17</pre> 18</dd> 19 20<dt>contained in:</dt> 21<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code></dd> 22 23<dt>description:</dt> 24<dd>Lets you specify the screen dimensions the 25application supports. By default, a modern application (using API Level 4 or higher) supports all 26screen sizes; older applications are assumed to support only the "normal" screen size. Screen 27size is determined as the available pixels to an application after density scaling has been 28applied. (Note that screen size is a separate axis from screen density.) 29 30<p>An application "supports" a given screen size if it fills the entire screen and works as 31expected. By default, the system will resize your application to fill the screen, if you have set 32either <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code 33minSdkVersion}</a> or <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code 34targetSdkVersion}</a> to {@code "4"} or higher. Resizing works well for most applications and 35you don't have to do any extra work to make your application work on larger screens.</p> 36 37<p>In addition to allowing the system to resize your application, you can add additional support 38for different screen sizes by providing <a 39href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">alternative 40layout resources</a> for different sizes. For instance, you might want to modify the layout 41of an activity when it is on a tablet or similar device that has an <em>xlarge</em> screen.</p> 42 43<p>If your application does not support <em>large</em> or <em>xlarge</em> screens, then you should 44declare that it is not resizeable by setting <a href="#resizeable">{@code android:resizeable}</a> to 45{@code "false"}, so that the system will not resize your application on larger screens.</p> 46 47<p>If your application does not support <em>small</em> screens, then 48there isn't much the system can do to make the application work well on a smaller screen, so 49external services (such as Android Market) should not allow users to install the application on such 50screens.</p> 51 52 53<p>For more information, see 54<a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p> 55 56 57<dt>attributes:</dt> 58 59<dd> 60<dl class="attr"> 61 62 <dt><a name="resizeable"></a>{@code android:resizeable}</dt> 63 <dd>Indicates whether the application is resizeable for different screen sizes. This attribute is 64true, by default, if you have set either <a 65href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a 66href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to 67{@code "4"} or higher. Otherwise, it is false by default. If set false, the system will not resize 68your application when run on <em>large</em> or <em>xlarge</em> screens. Instead, the 69application appears in a "postage stamp" that equals the <em>normal</em> screen size that your 70application does support. This is less than an ideal experience for users, because the 71application appears smaller than the available screen, but it might help your application run 72normally if it were designed only for the <em>normal</em> screen size and some behaviors do not work 73when resized.</p> 74 <p>To provide the best experience on all screen sizes, you should allow resizing and, if your 75application does not work well on larger screens, follow the guide to <a 76href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a> to enable 77additional screen support.</p> 78 </dd> 79 80 81 <dt><a name="small"></a>{@code android:smallScreens}</dt> 82 <dd>Indicates whether the application supports smaller screen form-factors. 83 A small screen is defined as one with a smaller aspect ratio than 84 the "normal" (traditional HVGA) screen. An application that does 85 not support small screens <em>will not be available</em> for 86 small screen devices from external services (such as Android Market), because there is little 87the platform can do 88 to make such an application work on a smaller screen. If the application has set either <a 89href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a 90href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to 91{@code "4"} or higher, 92the default value for this is {@code "true"}, any value less than {@code "4"} results in this set to 93{@code "false"}. 94 </dd> 95 96 <dt><a name="normal"></a>{@code android:normalScreens}</dt> 97 <dd>Indicates whether an application supports the "normal" screen 98 form-factors. Traditionally this is an HVGA medium density 99 screen, but WQVGA low density and WVGA high density are also 100 considered to be normal. This attribute is "true" by default, 101 and applications currently should leave it that way. 102 </dd> 103 104 <dt><a name="large"></a>{@code android:largeScreens}</dt> 105 <dd>Indicates whether the application supports larger screen form-factors. 106 A large screen is defined as a screen that is significantly larger 107 than a "normal" phone screen, and thus might require some special care 108 on the application's part to make good use of it, though it may rely on resizing by the 109system to fill the screen. If the application has set either <a 110href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a 111href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to 112{@code "4"} or higher, 113the default value for this is {@code "true"}, any value less than {@code "4"} results in this set to 114{@code "false"}. 115 </dd> 116 117 <dt><a name="xlarge"></a>{@code android:xlargeScreens}</dt> 118 <dd>Indicates whether the application supports extra large screen form-factors. 119 An xlarge screen is defined as a screen that is significantly larger 120 than a "large" screen, such as a tablet (or something larger) and may require special care 121 on the application's part to make good use of it, though it may rely on resizing by the 122system to fill the screen. If the application has set either <a 123href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a 124href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to 125{@code "4"} or higher, 126the default value for this is {@code "true"}, any value less than {@code "4"} results in this set to 127{@code "false"}. 128 <p>This attribute was introduced in API Level 9.</p> 129 </dd> 130 131 <dt><a name="any"></a>{@code android:anyDensity}</dt> 132 <dd>Indicates whether the application includes resources to accommodate any screen 133 density. Older applications (before API Level 4) are assumed unable to 134 accomodate all densities and this is {@code "false"} by default. If the application has set 135either <a 136href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a 137href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to 138{@code "4"} or higher, 139the default value for this is {@code "true"}. Otherwise, it is {@code "false"}. 140 You can explicitly supply your abilities here. 141 <p>Based on the "standard" device screen density (medium dpi), the Android framework will scale 142down application assets by a factor of 0.75 (low dpi screens) or scale them up by a factor of 1.5 143(high dpi screens), when you don't provide alternative resources for a specifc screen density. The 144screen density is expressed as dots-per-inch (dpi).</p> 145 </dd> 146 147 148</dl></dd> 149 150<!-- ##api level indication## --> 151<dt>introduced in:</dt> 152<dd>API Level 4</dd> 153 154<dt>see also:</dt> 155<dd> 156 <ul> 157 <li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple 158Screens</a></li> 159 <li>{@link android.util.DisplayMetrics}</li> 160 </ul> 161</dd> 162 163</dl> 164