@@ -15,8 +15,8 @@ screen configuration</li>
1515
1616 <h2>In this document</h2>
1717 <ol>
18- <li><a href="#FilteringHansetApps">Filtering a Handset Application from Tablets </a></li>
19- <li><a href="#FilteringTabletApps">Filtering a Tablet Application from Handsets </a></li>
18+ <li><a href="#FilteringHansetApps">Declaring an App is Only for Handsets </a></li>
19+ <li><a href="#FilteringTabletApps">Declaring an App is Only for Tablets </a></li>
2020 <li><a href="#MultiApks">Publishing Multiple APKs for Different Screens</a></li>
2121 </ol>
2222
@@ -48,7 +48,7 @@ available to the greatest number of users with different devices, using a single
4848
4949
5050
51- <h2 id="FilteringHandsetApps">Filtering a Handset Application from Tablets </h2>
51+ <h2 id="FilteringHandsetApps">Declaring an App is Only for Handsets </h2>
5252
5353<p>Because the system generally scales applications to fit larger screens well, you shouldn't
5454need to filter your application from larger screens. As long as you follow the <a
@@ -79,7 +79,6 @@ entry looks like if your application is compatible with only small and normal sc
7979
8080<pre>
8181<manifest ... >
82- ...
8382 <compatible-screens>
8483 <!-- all small size screens -->
8584 <screen android:screenSize="small" android:screenDensity="ldpi" />
@@ -92,6 +91,7 @@ entry looks like if your application is compatible with only small and normal sc
9291 <screen android:screenSize="normal" android:screenDensity="hdpi" />
9392 <screen android:screenSize="normal" android:screenDensity="xhdpi" />
9493 </compatible-screens>
94+ ...
9595 <application ... >
9696 ...
9797 <application>
@@ -108,36 +108,66 @@ to specify each screen density your application supports.</p>
108108
109109
110110
111- <h2 id="FilteringTabletApps">Filtering a Tablet Application from Handsets</h2>
112111
113- <p>If your application's UI is adversely affected when the system scales your application down to
114- smaller screens, you should add <a
115- href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">alternative
116- layouts</a> for smaller screens to adjust the layout for those screens. However, sometimes your
117- layout still might not fit a smaller screen or you've explicitly designed your application only for
118- tablets and other large devices. In this case, you can manage the availability of your application
119- to smaller screens by using the <a
112+ <h2 id="FilteringTabletApps">Declaring an App is Only for Tablets</h2>
113+
114+ <p>If you don't want your app to be used on handsets (perhaps your app truly makes sense only on a
115+ large screen) or you need time to optimize it for smaller screens, you can prevent small-screen
116+ devices from downloading your app by using the <a
120117href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
121118<supports-screens>}</a> manifest element.</p>
122119
123- <p>For example, if you want your application to be available only to large and extra large
124- screens, you can declare the element in your manifest like this:</p>
120+ <p>For example, if you want your application to be available only to tablet devices, you can declare
121+ the element in your manifest like this:</p>
125122
126123<pre>
127124<manifest ... >
128- ...
129125 <supports-screens android:smallScreens="false"
130126 android:normalScreens="false"
131127 android:largeScreens="true"
132- android:xlargeScreens="true" />
128+ android:xlargeScreens="true"
129+ android:requiresSmallestWidthDp="600" />
130+ ...
133131 <application ... >
134132 ...
135- <application>
133+ </ application>
136134</manifest>
137135</pre>
138136
139- <p>External services such as Android Market read this manifest element and use it to ensure that
140- your application is available only to devices with either a large or an extra large screen.</p>
137+ <p>This describes your app's screen-size support in two different ways:</p>
138+
139+ <ul>
140+ <li>It declares that the app does <em>not</em> support the screen sizes "small" and
141+ "normal", which are traditionally not tablets.</li>
142+ <li>It declares that the app requires a screen size with a minimum usable area that is at least
143+ 600dp wide.</li>
144+ </ul>
145+
146+ <p>The first technique is for devices that are running Android 3.1 or older, because those devices
147+ declare their size based on generalized screen sizes. The <a
148+ href="{@docRoot}guide/topics/manifest/supports-screens-element.html#requiresSmallest">{@code
149+ requiresSmallestWidthDp}</a> attribute is for devices running Android 3.2 and newer, which includes
150+ the capability for apps to specify size requirements based on a minimum number of
151+ density-independent pixels available. In this example, the app declares a minimum width requirement
152+ of 600dp, which generally implies a 7"-or-greater screen. </p>
153+
154+ <p>Your size choice might be different, of course, based on how well your design works on different
155+ screen sizes; for example, if your design works well only on screens that are 9" or larger, you
156+ might require a minimum width of 720dp.</p>
157+
158+ <p>The catch is that you must compile your application against Android 3.2 or higher in order to use
159+ the <code>requiresSmallestWidthDp</code> attribute. Older versions don't understand this attribute
160+ and will raise a compile-time error. The safest thing to do is develop your app against the platform
161+ that matches the API level you've set for <a
162+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">minSdkVersion</a
163+ >. When you're making final preparations to build your release candidate, change the build target to
164+ Android 3.2 and add the <code>requiresSmallestWidthDp</code> attribute. Android versions older than
165+ 3.2 simply ignore that XML attribute, so there's no risk of a runtime failure.</p>
166+
167+ <p>For more information about why the "smallest width" screen size is
168+ important for supporting different screen sizes, read <a
169+ href="http://android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html">New
170+ Tools for Managing Screen Sizes</a>.</p>
141171
142172<p class="caution"><strong>Caution:</strong> If you use the <a
143173href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
@@ -151,7 +181,7 @@ information). If you want
151181to prevent your application from being downloaded on larger screens, use <a
152182href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
153183<compatible-screens>}</a>, as discussed in the previous section about <a
154- href="#FilteringHandsetApps">Filtering a Handset Application from Tablets </a>.</p>
184+ href="#FilteringHandsetApps">Declaring an App is Only for Handsets </a>.</p>
155185
156186<p>Remember, you should strive to make your application available to as many devices as possible by
157187applying all necessary techniques for <a
0 commit comments