supports-screens-element.jd revision cbbdefcb71143c3134c7eea454a22ed7aa193e92
1page.title=<supports-screens> 2@jd:body 3 4<dl class="xml"> 5 6<dt>syntax:</dt> 7<dd> 8<pre class="stx"> 9<supports-screens android:<a href="#small">smallScreens</a>=["true" | "false"] 10 android:<a href="#normal">normalScreens</a>=["true" | "false"] 11 android:<a href="#large">largeScreens</a>=["true" | "false"] 12 android:<a href="#xlarge">xlargeScreens</a>=["true" | "false"] 13 android:<a href="#any">anyDensity</a>=["true" | "false"] /> 14</pre> 15</dd> 16 17<dt>contained in:</dt> 18<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code></dd> 19 20<dt>description:</dt> 21<dd>Lets you specify the screen dimensions the 22application supports. By default a modern application (using API Level 4 or higher) supports all 23screen sizes and must explicitly disable certain screen sizes here; 24older applications are assumed to support only the "normal" 25screen size. Note that screen size is a separate axis from 26density. Screen size is determined as the available pixels to an application 27after density scaling has been applied. 28 29<p>Based on the target device screen density, the Android 30framework will scale down assets by a factor of 0.75 (low dpi screens) 31or scale them up by a factor of 1.5 (high dpi screens). 32The screen density is expressed as dots-per-inch (dpi).</p> 33 34<p>For more information, see 35<a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p> 36 37 38<dt>attributes:</dt> 39 40<dd> 41<dl class="attr"><dt><a name="small"></a>{@code android:smallScreens}</dt> 42 <dd>Indicates whether the application supports smaller screen form-factors. 43 A small screen is defined as one with a smaller aspect ratio than 44 the "normal" (traditional HVGA) screen. An application that does 45 not support small screens <em>will not be available</em> for 46 small screen devices, because there is little the platform can do 47 to make such an application work on a smaller screen. If the application has set the <a 48href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element's 49{@code android:minSdkVersion} or {@code android:targetSdkVersion} attribute to "4" or higher, 50the default value for this is "true", any value less than "4" results in this set to "false". 51 </dd> 52 53 <dt><a name="normal"></a>{@code android:normalScreens}</dt> 54 <dd>Indicates whether an application supports the "normal" screen 55 form-factors. Traditionally this is an HVGA medium density 56 screen, but WQVGA low density and WVGA high density are also 57 considered to be normal. This attribute is "true" by default, 58 and applications currently should leave it that way. 59 </dd> 60 61 <dt><a name="large"></a>{@code android:largeScreens}</dt> 62 <dd>Indicates whether the application supports larger screen form-factors. 63 A large screen is defined as a screen that is significantly larger 64 than a "normal" phone screen, and thus may require some special care 65 on the application's part to make good use of it. An application that 66 does not support large screens (declares this "false")—but does support "normal" or 67"small" screens—will be placed as a "postage stamp" on 68 a large screen, so that it retains the dimensions it was originally 69 designed for. If the application has set the <a 70href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element's 71{@code android:minSdkVersion} or {@code android:targetSdkVersion} attribute to "4" or higher, 72the default value for this is "true", any value less than "4" results in this set to "false". 73 </dd> 74 75 <dt><a name="xlarge"></a>{@code android:xlargeScreens}</dt> 76 <dd>Indicates whether the application supports extra large screen form-factors. 77 An xlarge screen is defined as a screen that is significantly larger 78 than a "large" screen, such as a tablet (or something larger) and may require special care 79 on the application's part to make good use of it. An application that 80 does not support xlarge screens (declares this "false")—but does support "large", 81"normal", or "small" screens—will be placed as a "postage stamp" on 82 an xlarge screen, so that it retains the dimensions it was originally 83 designed for. If the application has set the <a 84href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element's 85{@code android:minSdkVersion} or {@code android:targetSdkVersion} attribute to "4" or higher, 86the default value for this is "true", any value less than "4" results in this set to "false". 87 <p>This attribute was introduced in API Level 9.</p> 88 </dd> 89 90 <dt><a name="any"></a>{@code android:anyDensity}</dt> 91 <dd>Indicates whether the application includes resources to accommodate any screen 92 density. Older applications (before API Level 4) are assumed unable to 93 accomodate all densities and this is "false" by default. Applications using 94 API Level 4 or higher are assumed able to and this is "true" by default. 95 You can explicitly supply your abilities here. 96 </dd> 97 98 99</dl></dd> 100 101<!-- ##api level indication## --> 102<dt>introduced in:</dt> 103<dd>API Level 4</dd> 104 105<dt>see also:</dt> 106<dd> 107 <ul> 108 <li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple 109Screens</a></li> 110 <li>{@link android.util.DisplayMetrics}</li> 111 </ul> 112</dd> 113 114</dl> 115