summaryrefslogtreecommitdiffstats
path: root/docs/html/guide/topics
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html/guide/topics')
-rw-r--r--docs/html/guide/topics/graphics/animation.jd108
-rw-r--r--docs/html/guide/topics/manifest/activity-element.jd53
-rw-r--r--docs/html/guide/topics/manifest/supports-screens-element.jd286
-rw-r--r--docs/html/guide/topics/resources/animation-resource.jd4
-rw-r--r--docs/html/guide/topics/resources/drawable-resource.jd6
-rw-r--r--docs/html/guide/topics/resources/providing-resources.jd137
-rw-r--r--docs/html/guide/topics/resources/string-resource.jd17
-rw-r--r--docs/html/guide/topics/usb/adk.jd57
-rw-r--r--docs/html/guide/topics/usb/host.jd6
9 files changed, 391 insertions, 283 deletions
diff --git a/docs/html/guide/topics/graphics/animation.jd b/docs/html/guide/topics/graphics/animation.jd
index 31e7c4b..e7a07e0 100644
--- a/docs/html/guide/topics/graphics/animation.jd
+++ b/docs/html/guide/topics/graphics/animation.jd
@@ -12,28 +12,33 @@ parent.link=index.html
<ol>
<li><a href="#how">How property animation works</a></li>
</ol>
- </li>
+ </li>
+
+ <li><a href="#value-animator">Animating with ValueAnimator</a></li>
- <li><a href="#value-animator">Animating with ValueAnimator</a></li>
+ <li><a href="#object-animator">Animating with ObjectAnimator</a></li>
- <li><a href="#object-animator">Animating with ObjectAnimator</a></li>
+ <li><a href="#choreography">Choreographing Multiple Animations with
+ AnimatorSet</a></li>
- <li><a href="#choreography">Choreographing Multiple Animations with
- AnimatorSet</a></li>
-
- <li><a href="#listeners">Animation Listeners</a></li>
+ <li><a href="#listeners">Animation Listeners</a></li>
- <li><a href="#type-evaluator">Using a TypeEvaluator</a></li>
+ <li><a href="#type-evaluator">Using a TypeEvaluator</a></li>
- <li><a href="#interpolators">Using Interpolators</a></li>
+ <li><a href="#interpolators">Using Interpolators</a></li>
- <li><a href="#keyframes">Specifying Keyframes</a></li>
- <li><a href="#layout">Animating Layout Changes to ViewGroups</a></li>
+ <li><a href="#keyframes">Specifying Keyframes</a></li>
- <li><a href="#views">Animating Views</a></li>
+ <li><a href="#layout">Animating Layout Changes to ViewGroups</a></li>
- <li><a href="#declaring-xml">Declaring Animations in XML</a></li>
- </ol>
+ <li><a href="#views">Animating Views</a>
+ <ol>
+ <li><a href="#view-prop-animator">ViewPropertyAnimator</a></li>
+ </ol>
+ </li>
+
+ <li><a href="#declaring-xml">Declaring Animations in XML</a></li>
+ </ol>
<h2>Key classes</h2>
@@ -63,13 +68,13 @@ parent.link=index.html
You can define an animation to change any object property over time, regardless of whether it
draws to the screen or not.The property animation system also has a few advantages over the view
animation system, which makes it more flexible to use.</p>
-
+
<p>The view animation system provides the capability to only animate View objects, so if
you wanted to animate non-View objects, you had to implement your own code to do so. The view
animation system also was constrained in the fact that it only exposed a few aspects of a View
object to animate, such as the scaling and rotation of a View but not the background color for
instance.</p>
-
+
<p>Another disadvantage of the view animation system is that it only modified where the
View was drawn, and not the actual View itself. For instance, if you animated a button to move
across the screen, the button draws correctly, but the actual location where you can click the
@@ -80,7 +85,7 @@ parent.link=index.html
<p>The view animation system, however, takes less time to setup and requires less code to write.
If view animation accomplishes everything that you need to do, or if your existing code already
works the way you want, there is no need to use the property animation system.</p>
-
+
<p class="note"><strong>Tip:</strong> To see how the ADT layout editor allows you to develop and
preview animations in your layout, watch the <a
href="http://www.youtube.com/watch?v=Oq05KqjXTvs&feature=player_detailpage#t=1709s">Android
@@ -114,7 +119,7 @@ Developer Tools session</a> from Google I/O '11</p>
default is set to refresh every 10 ms, but the speed in which your application can refresh frames is
ultimately dependent on how busy the system is overall and how fast the system can service the underlying timer.</li>
</ul>
-
+
<h3 id="how">How the property animation system works</h3>
@@ -254,7 +259,7 @@ Developer Tools session</a> from Google I/O '11</p>
</tr>
</table>
-
+
<p>Evaluators tell the property animation system how to calculate values for a given
property. They take the timing data that is provided by an {@link android.animation.Animator}
class, the animation's start and end value, and calculate the animated values of the property
@@ -299,9 +304,9 @@ Developer Tools session</a> from Google I/O '11</p>
information on how to write a custom evaluator.</td>
</tr>
</table>
-
-
-
+
+
+
<p>A time interpolator defines how specific values in an animation are calculated as a
function of time. For example, you can specify animations to happen linearly across the whole
@@ -397,7 +402,7 @@ Developer Tools session</a> from Google I/O '11</p>
<pre>
ValueAnimator animation = ValueAnimator.ofFloat(0f, 1f);
animation.setDuration(1000);
-animation.start();
+animation.start();
</pre>
<p>In this code, the {@link android.animation.ValueAnimator} starts calculating the values of the
@@ -408,7 +413,7 @@ animation.start();
<pre>
ValueAnimator animation = ValueAnimator.ofObject(new MyTypeEvaluator(), startPropertyValue, endPropertyValue);
animation.setDuration(1000);
-animation.start();
+animation.start();
</pre>
<p>In this code, the {@link android.animation.ValueAnimator} starts calculating the values of the
@@ -483,7 +488,7 @@ ObjectAnimator.ofFloat(targetObject, "propName", 1f)
<li>Depending on what property or object you are animating, you might need to call the {@link
android.view.View#invalidate invalidate()} method on a View force the screen to redraw itself with the
- updated animated values. You do this in the
+ updated animated values. You do this in the
{@link android.animation.ValueAnimator.AnimatorUpdateListener#onAnimationUpdate onAnimationUpdate()}
callback. For example, animating the color property of a Drawable object only cause updates to the
screen when that object redraws itself. All of the property setters on View, such as
@@ -492,7 +497,7 @@ ObjectAnimator.ofFloat(targetObject, "propName", 1f)
methods with new values. For more information on listeners, see the section about <a href="#listeners">Animation Listeners</a>.
</li>
</ul>
-
+
<h2 id="choreography">Choreographing Multiple Animations with AnimatorSet</h2>
<p>In many cases, you want to play an animation that depends on when another animation starts or
@@ -576,12 +581,12 @@ You can listen for important events during an animation's duration with the list
{@link android.view.View#invalidate invalidate()} on a View to force that area of the
screen to redraw itself with the new animated values. For example, animating the
color property of a Drawable object only cause updates to the screen when that object
- redraws itself. All of the property setters on View,
+ redraws itself. All of the property setters on View,
such as {@link android.view.View#setAlpha setAlpha()} and
{@link android.view.View#setTranslationX setTranslationX()} invalidate the View
properly, so you do not need to invalidate the View when calling these methods with new values.
</p>
-
+
</li>
</ul>
</li>
@@ -658,7 +663,7 @@ public void onAnimationEnd(Animator animation) {
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/verticalContainer"
- android:animateLayoutChanges="true" /&gt;
+ android:animateLayoutChanges="true" /&gt;
</pre>
<p>Setting this attribute to true automatically animates Views that are added or removed from the
@@ -872,16 +877,55 @@ rotationAnim.setDuration(5000ms);
ObjectAnimator.ofFloat(myView, "rotation", 0f, 360f);
</pre>
-For more information on creating animators, see the sections on animating with
-<a href="#value-animator">ValueAnimator</a> and <a href="#object-animator">ObjectAnimator</a>
+<p>For more information on creating animators, see the sections on animating with
+<a href="#value-animator">ValueAnimator</a> and <a href="#object-animator">ObjectAnimator</a>.
+</p>
+<h3 id="view-prop-animator">Animating with ViewPropertyAnimator</h3>
+<p>The {@link android.view.ViewPropertyAnimator} provides a simple way to animate several
+properties of a {@link android.view.View} in parallel, using a single underlying {@link
+android.animation.Animator}
+object. It behaves much like an {@link android.animation.ObjectAnimator}, because it modifies the
+actual values of the view's properties, but is more efficient when animating many properties at
+once. In addition, the code for using the {@link android.view.ViewPropertyAnimator} is much
+more concise and easier to read. The following code snippets show the differences in using multiple
+{@link android.animation.ObjectAnimator} objects, a single
+{@link android.animation.ObjectAnimator}, and the {@link android.view.ViewPropertyAnimator} when
+simultaneously animating the <code>x</code> and <code>y</code> property of a view.</p>
+
+<p><strong>Multiple ObjectAnimator objects</strong></p>
+<pre>
+ObjectAnimator animX = ObjectAnimator.ofFloat(myView, "x", 50f);
+ObjectAnimator animY = ObjectAnimator.ofFloat(myView, "y", 100f);
+AnimatorSet animSetXY = new AnimatorSet();
+animSetXY.playTogether(animX, animY);
+animSetXY.start();
+</pre>
+
+<p><strong>One ObjectAnimator</strong></p>
+<pre>
+PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("x", 50f);
+PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("y", 100f);
+ObjectAnimator.ofPropertyValuesHolder(myView, pvhX, pvyY).start();
+</pre>
+
+<p><strong>ViewPropertyAnimator</strong></p>
+<pre>
+myView.animate().x(50f).y(100f);
+</pre>
+
+<p>
+For more detailed information about {@link
+android.view.ViewPropertyAnimator}, see the corresponding Android Developers
+<a href="http://android-developers.blogspot.com/2011/05/introducing-viewpropertyanimator.html">blog
+post</a>.</p>
<h2 id="declaring-xml">Declaring Animations in XML</h2>
<p>The property animation system lets you declare property animations with XML instead of doing
it programmatically. By defining your animations in XML, you can easily reuse your animations
in multiple activities and more easily edit the animation sequence.</p>
-
+
<p>To distinguish animation files that use the new property animation APIs from those that use the
legacy <a href="{@docRoot}guide/topics/graphics/view-animation.html">view animation</a> framework,
starting with Android 3.1, you should save the XML files for property animations in the {@code
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index 743832c..b2a78fe 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -28,7 +28,9 @@ parent.link=manifest-intro.html
android:<a href="#proc">process</a>="<i>string</i>"
android:<a href="#screen">screenOrientation</a>=["unspecified" | "user" | "behind" |
"landscape" | "portrait" |
- "sensor" | "nosensor"]
+ "reverseLandscape" | "reversePortrait" |
+ "sensorLandscape" | "sensorPortrait" |
+ "sensor" | "fullSensor" | "nosensor"]
android:<a href="#state">stateNotNeeded</a>=["true" | "false"]
android:<a href="#aff">taskAffinity</a>="<i>string</i>"
android:<a href="#theme">theme</a>="<i>resource or theme</i>"
@@ -589,29 +591,54 @@ The value can be any one of the following strings:
uses, and therefore the choices made in specific contexts, may differ
from device to device.</td>
</tr><tr>
+ <td>"{@code user}"</td>
+ <td>The user's current preferred orientation.</td>
+</tr><tr>
+ <td>"{@code behind}"</td>
+ <td>The same orientation as the activity that's immediately beneath it in
+ the activity stack.</td>
+</tr><tr>
<td>"{@code landscape}"</td>
<td>Landscape orientation (the display is wider than it is tall).</td>
</tr><tr>
<td>"{@code portrait}"</td>
<td>Portrait orientation (the display is taller than it is wide).</td>
</tr><tr>
- <td>"{@code user}"</td>
- <td>The user's current preferred orientation.</td>
+ <td>"{@code reverseLandscape}"</td>
+ <td>Landscape orientation in the opposite direction from normal landscape.
+<em>Added in API level 9.</em></td>
</tr><tr>
- <td>"{@code behind}"</td>
- <td>The same orientation as the activity that's immediately beneath it in
- the activity stack.</td>
+ <td>"{@code reversePortrait}"</td>
+ <td>Portrait orientation in the opposite direction from normal portrait.
+<em>Added in API level 9.</em></td>
+</tr><tr>
+ <td>"{@code sensorLandscape}"</td>
+ <td>Landscape orientation, but can be either normal or reverse landscape based on the device
+sensor.
+<em>Added in API level 9.</em></td>
+</tr><tr>
+ <td>"{@code sensorPortrait}"</td>
+ <td>Portrait orientation, but can be either normal or reverse portrait based on the device
+sensor.
+<em>Added in API level 9.</em></td>
</tr><tr>
<td>"{@code sensor}"</td>
- <td>The orientation determined by a physical orientation sensor. The
- orientation of the display depends on how the user is holding the device;
- it changes when the user rotates the device.</td>
+ <td>The orientation is determined by the device orientation sensor. The orientation of the
+display depends on how the user is holding the device; it changes when the user rotates the
+device. Some devices, though, will not rotate to all four possible orientations, by default. To
+allow all four orientations, use {@code "fullSensor"}.</td>
+</tr><tr>
+ <td>"{@code fullSensor}"</td>
+ <td>The orientation is determined by the device orientation sensor for any of the 4 orientations.
+This is similar to {@code "sensor"} except this allows any of the 4 possible screen orientations,
+regardless of what the device will normally do (for example, some devices won't normally use reverse
+portrait or reverse landscape, but this enables those). <em>Added in API level 9.</em></td>
</tr><tr>
<td>"{@code nosensor}"</td>
- <td>An orientation determined without reference to a physical orientation sensor.
- The sensor is ignored, so the display will not rotate based on how the user
- moves the device. Except for this distinction, the system chooses the
- orientation using the same policy as for the "{@code unspecified}" setting.</td>
+ <td>The orientation is determined without reference to a physical orientation sensor. The sensor
+is ignored, so the display will not rotate based on how the user moves the device. Except for this
+distinction, the system chooses the orientation using the same policy as for the "{@code
+unspecified}" setting.</td>
</tr>
</table></dd>
diff --git a/docs/html/guide/topics/manifest/supports-screens-element.jd b/docs/html/guide/topics/manifest/supports-screens-element.jd
index 605a2bb..81d6e27 100644
--- a/docs/html/guide/topics/manifest/supports-screens-element.jd
+++ b/docs/html/guide/topics/manifest/supports-screens-element.jd
@@ -8,15 +8,15 @@ parent.link=manifest-intro.html
<dt>syntax:</dt>
<dd>
<pre class="stx">
-&lt;supports-screens android:<a href="#requiresSmallest">requiresSmallestWidthDp</a>="<em>integer</em>"
- android:<a href="#compatibleWidth">compatibleWidthLimitDp</a>="<em>integer</em>"
- android:<a href="#largestWidth">largestWidthLimitDp</a>="<em>integer</em>"
- android:<a href="#resizeable">resizeable</a>=["true"| "false"]
+&lt;supports-screens android:<a href="#resizeable">resizeable</a>=["true"| "false"]
android:<a href="#small">smallScreens</a>=["true" | "false"]
android:<a href="#normal">normalScreens</a>=["true" | "false"]
android:<a href="#large">largeScreens</a>=["true" | "false"]
android:<a href="#xlarge">xlargeScreens</a>=["true" | "false"]
- android:<a href="#any">anyDensity</a>=["true" | "false"] /&gt;
+ android:<a href="#any">anyDensity</a>=["true" | "false"]
+ android:<a href="#requiresSmallest">requiresSmallestWidthDp</a>="<em>integer</em>"
+ android:<a href="#compatibleWidth">compatibleWidthLimitDp</a>="<em>integer</em>"
+ android:<a href="#largestWidth">largestWidthLimitDp</a>="<em>integer</em>"/&gt;
</pre>
</dd>
@@ -24,37 +24,38 @@ parent.link=manifest-intro.html
<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
<dt>description:</dt>
-<dd>Lets you specify the screen sizes your application supports and enable screen
-compatibility mode for screens larger than what your application supports. By default, a modern
-application (using API Level 4 or higher) supports all screen sizes; older applications are assumed
-to support only the "normal" screen size. Screen size is determined by the number of pixels on the
-screen after the system accounts for screen density scaling.
+<dd>Lets you specify the screen sizes your application supports and enable <a
+href="{@docRoot}guide/practices/screen-compat-mode.html">screen compatibility mode</a> for screens
+larger than what your application supports. It's important that you always use this element in your
+application to specify the screen sizes your application supports.
<p>An application "supports" a given screen size if it resizes properly to fill the entire screen.
-By default, the system resizes your application UI to fill the screen if you have set
-either <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
-minSdkVersion}</a> or <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
-targetSdkVersion}</a> to {@code "4"} or higher. Normal resizing works well for most applications and
-you don't have to do any extra work to make your application work on screens larger than a
-handset device.</p>
-
-<p>In addition to allowing the system to resize your application to fit the current screen, you can
-optimize your UI for different screen sizes by providing <a
+Normal resizing applied by the system works well for most applications and you don't have to do any
+extra work to make your application work on screens larger than a handset device. However, it's
+often important that you optimize your application's UI for different screen sizes by providing <a
href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">alternative
-layout resources</a> for different sizes. For instance, you might want to modify the layout
-of an activity when it is on a tablet or similar device that has an <em>xlarge</em> screen.</p>
-
-<p>However, if your application does not work well when resized to fit different screen sizes,
-you can use the attributes of the {@code &lt;supports-screens&gt;} element to control whether
-your application should be distributed to smaller screens or have its UI scaled up to fit larger
-screens using the system's screen compatibility mode. When you have not designed for larger screen
-sizes and the normal resizing does not achieve the appropriate results, <em>screen compatibility
-mode</em> will scale your UI by emulating a <em>normal</em> size screen and then zooming in on it so
-that it fills the entire screen&mdash;thus achieving the same layout as a normal handset device on
-the large screen (but this usually causes pixelation and blurring of your UI).</p>
+layout resources</a>. For instance, you might want to modify the layout of an activity
+when it is on a tablet compared to when running on a handset device.</p>
+
+<p>However, if your application does not work well when resized to fit different screen sizes, you
+can use the attributes of the {@code &lt;supports-screens&gt;} element to control whether your
+application should be distributed to smaller screens or have its UI scaled up ("zoomed") to fit
+larger screens using the system's <a
+href="{@docRoot}guide/practices/screen-compat-mode.html">screen compatibility mode</a>. When you
+have not designed for larger screen sizes and the normal resizing does not achieve the appropriate
+results, screen compatibility mode will scale your UI by emulating a <em>normal</em> size
+screen and medium density, then zooming in so that it fills the entire screen. Beware that this
+causes pixelation and blurring of your UI, so it's better if you optimize your UI for large
+screens.</p>
+
+<p class="note"><strong>Note:</strong> Android 3.2 introduces new attributes: {@code
+android:requiresSmallestWidthDp}, {@code android:compatibleWidthLimitDp}, and {@code
+android:largestWidthLimitDp}. If you're developing your application for Android 3.2 and higher,
+you should use these attributes to declare your screen size support, instead of the attributes
+based on generalized screen sizes.</p>
<p>For more information about how to properly support different screen sizes so that you can avoid
-using screen compatibility mode, read
+using screen compatibility mode with your application, read
<a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
@@ -62,17 +63,90 @@ using screen compatibility mode, read
<dd>
<dl class="attr">
+
+ <dt><a name="resizeable"></a>{@code android:resizeable}</dt>
+ <dd>Indicates whether the application is resizeable for different screen sizes. This attribute is
+true, by default. If set false, the system will run your application in <a
+href="{@docRoot}guide/practices/screen-compat-mode.html">screen compatibility mode</a> on large
+screens.</p>
+
+ <p><strong>This attribute is deprecated</strong>. It was introduced to help applications
+transition from Android 1.5 to 1.6, when support for multiple screens was first introduced. You
+should not use it.</p>
+ </dd>
+
+ <dt><a name="small"></a>{@code android:smallScreens}</dt>
+ <dd>Indicates whether the application supports smaller screen form-factors.
+ A small screen is defined as one with a smaller aspect ratio than
+ the "normal" (traditional HVGA) screen. An application that does
+ not support small screens <em>will not be available</em> for
+ small screen devices from external services (such as Android Market), because there is little
+the platform can do to make such an application work on a smaller screen. This is {@code "true"} by
+default.
+ </dd>
+
+ <dt><a name="normal"></a>{@code android:normalScreens}</dt>
+ <dd>Indicates whether an application supports the "normal" screen
+ form-factors. Traditionally this is an HVGA medium density
+ screen, but WQVGA low density and WVGA high density are also
+ considered to be normal. This attribute is "true" by default.
+ </dd>
+
+ <dt><a name="large"></a>{@code android:largeScreens}</dt>
+ <dd>Indicates whether the application supports larger screen form-factors.
+ A large screen is defined as a screen that is significantly larger
+ than a "normal" handset screen, and thus might require some special care
+ on the application's part to make good use of it, though it may rely on resizing by the
+system to fill the screen.
+ <p>The default value for this actually varies between some versions, so it's better if
+you explicitly declare this attribute at all times. Beware that setting it "false" will
+generally enable <a href="{@docRoot}guide/practices/screen-compat-mode.html">screen
+compatibility mode</a>.</p>
+ </dd>
+
+ <dt><a name="xlarge"></a>{@code android:xlargeScreens}</dt>
+ <dd>Indicates whether the application supports extra large screen form-factors.
+ An xlarge screen is defined as a screen that is significantly larger
+ than a "large" screen, such as a tablet (or something larger) and may require special care
+ on the application's part to make good use of it, though it may rely on resizing by the
+system to fill the screen.
+ <p>The default value for this actually varies between some versions, so it's better if
+you explicitly declare this attribute at all times. Beware that setting it "false" will
+generally enable <a href="{@docRoot}guide/practices/screen-compat-mode.html">screen
+compatibility mode</a>.</p>
+ <p>This attribute was introduced in API level 9.</p>
+ </dd>
+
+ <dt><a name="any"></a>{@code android:anyDensity}</dt>
+ <dd>Indicates whether the application includes resources to accommodate any screen
+ density.
+ <p>For applications that support Android 1.6 (API level 4) and higher, this is "true"
+by default and <strong>you should not set it "false"</strong> unless you're absolutely certain that
+it's necessary for your application to work. The only time it might be necessary to disable this
+is if your app directly manipulates bitmaps (see the <a
+href="{@docRoot}guide/practices/screens_support.html#DensityConsiderations">Supporting Multiple
+Screens</a> document for more information).</p>
+ </dd>
<dt id="requiresSmallest">{@code android:requiresSmallestWidthDp}</dt>
- <dd>This attribute specifies the minimum "smallest screen width" with which your
-application is compatible. In order for a device to be considered compatible with your
-application, the shortest side of the available screen space must be equal to or greater than this
-value.
-<p>The width against which your value is compared takes into account screen decorations and system
-UI. For example, if the device has some persistent UI elements on the left or right edge of the
-display, the system declares the device's available width as one that is smaller than the actual
-screen size, accounting for these UI elements because those are screen pixels not available for your
-UI. Thus, the value you use should be the actual smallest width required by your layout.</p>
+ <dd>Specifies the minimum smallestWidth required. The smallestWidth is the shortest dimension of
+the screen space (in {@code dp} units) that must be available to your application UI&mdash;that is,
+the shortest of the available screen's two dimensions. So, in order for a device to be considered
+compatible with your application, the device's smallestWidth must be equal to or greater than this
+value. (Usually, the value you supply for this is the "smallest width" that your layout supports,
+regardless of the screen's current orientation.)
+
+ <p>For example, a typical handset screen has a smallestWidth of 320dp, a 7" tablet has a
+smallestWidth of 600dp, and a 10" tablet has a smallestWidth of 720dp. These values are generally
+the smallestWidth because they are the shortest dimension of the screen's available space.</p>
+
+<p>The size against which your value is compared takes into account screen decorations and system
+UI. For example, if the device has some persistent UI elements on the display, the system declares
+the device's smallestWidth as one that is smaller than the actual screen size, accounting for these
+UI elements because those are screen pixels not available for your UI. Thus, the value you use
+should be the minimum width required by your layout, regardless of the screen's current
+orientation.</p>
+
<p>If your application properly resizes for smaller screen sizes (down to the
<em>small</em> size or a minimum width of 320dp), you do
not need to use this attribute. Otherwise, you should use a value for this attribute that
@@ -80,12 +154,14 @@ matches the smallest value used by your application for the <a
href="{@docRoot}guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">
smallest screen width qualifier</a> ({@code sw&lt;N&gt;dp}).</p>
-<p>For example, a typical handset screen has a minimum width of 320dp, a 7" tablet has a minimum
-width of 600dp, and a 10" tablet has a minimum width of 720dp. If the smallest available screen
-width on a device is less than the value you supply here, then the application is considered
-incompatible with that
-device. External services such as Android Market use this to determine whether a device
-is compatible with your application and prevent incompatible devices from installing it.</p>
+ <p class="caution"><strong>Caution:</strong> The Android system does not pay attention to this
+attribute, so it does not affect how your application behaves at runtime. Instead, it is used
+to enable filtering for your application on services such as Android Market. However,
+<strong>Android Market currently does not support this attribute for filtering</strong> (on Android
+3.2), so you should continue using the other size attributes if your application does not support
+small screens.</p>
+
+<!--
<p>Beginning with Android 3.2 (API level 13), using this attribute is the preferred way to
specify the minimum screen size your application requires, instead of using the other attributes
for small, normal, large, and xlarge screens. The advantage of using this attribute is that you
@@ -95,29 +171,32 @@ to properly display its UI, rather than relying on the generalized size groups.<
<code><a href="#small">smallScreens</a></code>, <code><a href="#normal">normalScreens</a></code>,
<code><a href="#large">largeScreens</a></code>, or <code><a href="#xlarge">xlargeScreens</a></code>
attributes are used instead to determine the smallest screen required.</p>
+-->
<p>This attribute was introduced in API level 13.</p>
</dd>
<dt id="compatibleWidth">{@code android:compatibleWidthLimitDp}</dt>
- <dd>This attribute allows you to enable screen compatibility mode as a user-optional feature by
-specifying the maximum "smallest screen width" for which your application is designed. If the value
-you supply here is less than the shortest side of the available screen space, users can still
-install your application, but are offered to run it in screen compatibility mode. By default, screen
-compatibility mode is disabled and your layout is resized to fit the screen as usual, but a
-button is available in the system bar that allows the user to toggle screen compatibility mode on
-and off.
+ <dd>This attribute allows you to enable <a
+href="{@docRoot}guide/practices/screen-compat-mode.html">screen compatibility mode</a> as a
+user-optional feature by specifying the maximum "smallest screen width" for which your application
+is designed. If the smallest side of a device's available screen is greater than your value here,
+users can still install your application, but are offered to run it in screen compatibility mode. By
+default, screen compatibility mode is disabled and your layout is resized to fit the screen as
+usual, but a button is available in the system bar that allows the user to toggle screen
+compatibility mode on and off.
<p>If your application is compatible with all screen sizes and its layout properly resizes, you do
not need to use this attribute.</p>
- <p class="note"><strong>Note:</strong> Currently, screen compatibility mode only emulates handset
+ <p class="note"><strong>Note:</strong> Currently, screen compatibility mode emulates only handset
screens with a 320dp width, so screen compatibility mode is not applied if your value for {@code
android:compatibleWidthLimitDp} is larger than 320.</p>
<p>This attribute was introduced in API level 13.</p>
</dd>
<dt id="largestWidth">{@code android:largestWidthLimitDp}</dt>
- <dd>This attribute allows you to force enable screen compatibility mode by specifying the maximum
-"smallest screen width" for which your application is designed. If the value you supply here is less
-than the shortest side of the available screen space, the application runs in screen
+ <dd>This attribute allows you to force-enable <a
+href="{@docRoot}guide/practices/screen-compat-mode.html">screen compatibility mode</a> by specifying
+the maximum "smallest screen width" for which your application is designed. If the smallest side of
+a device's available screen is greater than your value here, the application runs in screen
compatibility mode with no way for the user to disable it.
<p>If your application is compatible with all screen sizes and its layout properly resizes, you do
not need to use this attribute. Otherwise, you should first consider using the <a
@@ -125,102 +204,11 @@ href="#compatibleWidth">{@code android:compatibleWidthLimitDp}</a> attribute. Yo
{@code android:largestWidthLimitDp} attribute only when your application is functionally broken when
resized for larger screens and screen compatibility mode is the only way that users should use
your application.</p>
- <p class="note"><strong>Note:</strong> Currently, screen compatibility mode only emulates handset
+ <p class="note"><strong>Note:</strong> Currently, screen compatibility mode emulates only handset
screens with a 320dp width, so screen compatibility mode is not applied if your value for {@code
android:largestWidthLimitDp} is larger than 320.</p>
<p>This attribute was introduced in API level 13.</p>
</dd>
-
- <dt><a name="resizeable"></a>{@code android:resizeable}</dt>
- <dd>Indicates whether the application is resizeable for different screen sizes. This attribute is
-true, by default, if you have set either <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
-{@code "4"} or higher. Otherwise, it is false by default. If set false, the system will not resize
-your application when run on <em>large</em> or <em>xlarge</em> screens. Instead, the
-application appears in a "postage stamp" that equals the <em>normal</em> screen size that your
-application does support. This is less than an ideal experience for users, because the
-application appears smaller than the available screen, but it might help your application run
-normally if it were designed only for the <em>normal</em> screen size and some behaviors do not work
-when resized.</p>
- <p>To provide the best experience on all screen sizes, you should allow resizing and, if your
-application does not work well on larger screens, follow the guide to <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a> to enable
-additional screen support.</p>
- <p><strong>This attribute is deprecated</strong> as of API level 13.</p>
- </dd>
-
-
- <dt><a name="small"></a>{@code android:smallScreens}</dt>
- <dd>Indicates whether the application supports smaller screen form-factors.
- A small screen is defined as one with a smaller aspect ratio than
- the "normal" (traditional HVGA) screen. An application that does
- not support small screens <em>will not be available</em> for
- small screen devices from external services (such as Android Market), because there is little
-the platform can do
- to make such an application work on a smaller screen. If the application has set either <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
-{@code "4"} or higher,
-the default value for this is {@code "true"}, any value less than {@code "4"} results in this set to
-{@code "false"}.
- <p><strong>This attribute is deprecated</strong> as of API level 13.</p>
- </dd>
-
- <dt><a name="normal"></a>{@code android:normalScreens}</dt>
- <dd>Indicates whether an application supports the "normal" screen
- form-factors. Traditionally this is an HVGA medium density
- screen, but WQVGA low density and WVGA high density are also
- considered to be normal. This attribute is "true" by default,
- and applications currently should leave it that way.
- <p><strong>This attribute is deprecated</strong> as of API level 13.</p>
- </dd>
-
- <dt><a name="large"></a>{@code android:largeScreens}</dt>
- <dd>Indicates whether the application supports larger screen form-factors.
- A large screen is defined as a screen that is significantly larger
- than a "normal" handset screen, and thus might require some special care
- on the application's part to make good use of it, though it may rely on resizing by the
-system to fill the screen. If the application has set either <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
-{@code "4"} or higher,
-the default value for this is {@code "true"}, any value less than {@code "4"} results in this set to
-{@code "false"}.
- <p><strong>This attribute is deprecated</strong> as of API level 13.</p>
- </dd>
-
- <dt><a name="xlarge"></a>{@code android:xlargeScreens}</dt>
- <dd>Indicates whether the application supports extra large screen form-factors.
- An xlarge screen is defined as a screen that is significantly larger
- than a "large" screen, such as a tablet (or something larger) and may require special care
- on the application's part to make good use of it, though it may rely on resizing by the
-system to fill the screen. If the application has set either <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
-{@code "4"} or higher,
-the default value for this is {@code "true"}, any value less than {@code "4"} results in this set to
-{@code "false"}.
- <p>This attribute was introduced in API level 9.</p>
- <p><strong>This attribute is deprecated</strong> as of API level 13.</p>
- </dd>
-
- <dt><a name="any"></a>{@code android:anyDensity}</dt>
- <dd>Indicates whether the application includes resources to accommodate any screen
- density. Older applications (before API Level 4) are assumed unable to
- accomodate all densities and this is {@code "false"} by default. If the application has set
-either <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
-{@code "4"} or higher,
-the default value for this is {@code "true"}. Otherwise, it is {@code "false"}.
- You can explicitly supply your abilities here.
- <p>Based on the "standard" device screen density (medium dpi), the Android framework will scale
-down application assets by a factor of 0.75 (low dpi screens) or scale them up by a factor of 1.5
-(high dpi screens), when you don't provide alternative resources for a specifc screen density. The
-screen density is expressed as dots-per-inch (dpi).</p>
- <p><strong>This attribute is deprecated</strong> as of API level 13.</p>
- </dd>
</dl></dd>
diff --git a/docs/html/guide/topics/resources/animation-resource.jd b/docs/html/guide/topics/resources/animation-resource.jd
index 3df669c..480ca78 100644
--- a/docs/html/guide/topics/resources/animation-resource.jd
+++ b/docs/html/guide/topics/resources/animation-resource.jd
@@ -10,8 +10,8 @@ parent.link=available-resources.html
<li><a href="#Property">Property Animation</a></li>
<li><a href="#View">View Animation</a>
<ol>
- <li><a href="Tween">Tween animation</li>
- <li><a href="Frame">Frame animation</li>
+ <li><a href="Tween">Tween animation</a></li>
+ <li><a href="Frame">Frame animation</a></li>
</ol>
</li>
</ol>
diff --git a/docs/html/guide/topics/resources/drawable-resource.jd b/docs/html/guide/topics/resources/drawable-resource.jd
index 89c85e2..912b6fd 100644
--- a/docs/html/guide/topics/resources/drawable-resource.jd
+++ b/docs/html/guide/topics/resources/drawable-resource.jd
@@ -1418,7 +1418,7 @@ bound. The value's format is XX%. For instance: 100%, 12.5%, etc.</dd>
The filename is used as the resource ID.</dd>
<dt>compiled resource datatype:</dt>
-<dd>Resource pointer to a {@link android.graphics.drawable.ShapeDrawable}.</dd>
+<dd>Resource pointer to a {@link android.graphics.drawable.GradientDrawable}.</dd>
<dt>resource reference:</dt>
@@ -1458,9 +1458,7 @@ In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code>
android:bottom="<em>integer</em>" /&gt;
&lt;<a href="#size-element">size</a>
android:width="<em>integer</em>"
- android:color="<em>color</em>"
- android:dashWidth="<em>integer</em>"
- android:dashGap="<em>integer</em>" /&gt;
+ android:height="<em>integer</em>" /&gt;
&lt;<a href="#solid-element">solid</a>
android:color="<em>color</em>" /&gt;
&lt;<a href="#stroke-element">stroke</a>
diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd
index ea778c1..252c153 100644
--- a/docs/html/guide/topics/resources/providing-resources.jd
+++ b/docs/html/guide/topics/resources/providing-resources.jd
@@ -334,7 +334,7 @@ indicates the current locale.</p>
</td>
</tr>
<tr id="SmallestScreenWidthQualifier">
- <td>Smallest screen width</td>
+ <td>smallestWidth</td>
<td><code>sw&lt;N&gt;dp</code><br/><br/>
Examples:<br/>
<code>sw320dp</code><br/>
@@ -343,18 +343,23 @@ indicates the current locale.</p>
etc.
</td>
<td>
- <p>Specifies the "smallest width" in {@code dp} units that must be available to your
- application in order for the resources to be used, regardless of the screen's current
- orientation. For example, if your layout requires that its shortest side be at least 600
- dp in length at all times, then you can use this to create the layout resources, {@code
- res/layout-sw600dp/}, and the system will use them only when the shortest side of
- available screen space it at least 600dp.</p>
- <p>The width against which the system compares your value takes into account screen
- decorations and system UI. For example, if the device has some persistent UI elements on the
- left or right edge of the display, the system declares its own available width as one that
- is smaller than the actual screen size, accounting for these UI elements because those are
- screen pixels not available for your UI. Thus, the value you use should be the actual
- smallest width required by your layout.</p>
+ <p>The fundamental size of a screen, as indicated by the shortest dimension of the available
+screen area. Specifically, the device's smallestWidth is the shortest of the screen's available
+height and width (you may also think of it as the "smallest possible width" for the screen). You can
+use this qualifier to ensure that, regardless of the screen's current orientation, your
+application's has at least {@code &lt;N&gt;} dps of width available for it UI.</p>
+ <p>For example, if your layout requires that its smallest dimension of screen area be at
+least 600 dp at all times, then you can use this qualifer to create the layout resources, {@code
+res/layout-sw600dp/}. The system will use these resources only when the smallest dimension of
+available screen is at least 600dp, regardless of whether the 600dp side is the user-perceived
+height or width. The smallestWidth is a fixed screen size characteristic of the device; <strong>the
+device's smallestWidth does not change when the screen's orientation changes</strong>.</p>
+ <p>The smallestWidth of a device takes into account screen decorations and system UI. For
+example, if the device has some persistent UI elements on the screen that account for space along
+the axis of the smallestWidth, the system declares the smallestWidth to be smaller than the actual
+screen size, because those are screen pixels not available for your UI. Thus, the value you use
+should be the actual smallest dimension <em>required by your layout</em> (usually, this value is the
+"smallest width" that your layout supports, regardless of the screen's current orientation).</p>
<p>Some values you might use here for common screen sizes:</p>
<ul>
<li>320, for devices with screen configurations such as:
@@ -369,19 +374,22 @@ indicates the current locale.</p>
<li>720, for screens such as 720x1280 mdpi (10" tablet).</li>
</ul>
<p>When your application provides multiple resource directories with different values for
- this qualifier, the system uses the one closest to (without exceeding) the smallest width
- for the available space. </p>
+ the smallestWidth qualifier, the system uses the one closest to (without exceeding) the
+device's smallestWidth. </p>
<p><em>Added in API level 13.</em></p>
<p>Also see the <a
- href="{@docRoot}guide/topics/manifest/supports-screens-element.html#requiresSmallest">{@code
- android:requiresSmallestWidthDp}</a> attribute, which declares the smallest available width
- with which your application is compatible, and the {@link
- android.content.res.Configuration#smallestScreenWidthDp} configuration field, which holds
- the current smallest screen width for the device.</p>
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html#requiresSmallest">{@code
+android:requiresSmallestWidthDp}</a> attribute, which declares the minimum smallestWidth with which
+your application is compatible, and the {@link
+android.content.res.Configuration#smallestScreenWidthDp} configuration field, which holds the
+device's smallestWidth value.</p>
+ <p>For more information about designing for different screens and using this
+qualifier, see the <a href="{@docRoot}guide/practices/screens_support.html">Supporting
+Multiple Screens</a> developer guide.</p>
</td>
</tr>
<tr id="ScreenWidthQualifier">
- <td>Screen width</td>
+ <td>Available width</td>
<td><code>w&lt;N&gt;dp</code><br/><br/>
Examples:<br/>
<code>w720dp</code><br/>
@@ -389,7 +397,7 @@ indicates the current locale.</p>
etc.
</td>
<td>
- <p>Specifies a minimum screen width, in {@code dp} units at which the resource
+ <p>Specifies a minimum available screen width, in {@code dp} units at which the resource
should be used&mdash;defined by the <code>&lt;N&gt;</code> value. This
configuration value will change when the orientation
changes between landscape and portrait to match the current actual width.</p>
@@ -403,10 +411,13 @@ indicates the current locale.</p>
<p><em>Added in API level 13.</em></p>
<p>Also see the {@link android.content.res.Configuration#screenWidthDp}
configuration field, which holds the current screen width.</p>
+ <p>For more information about designing for different screens and using this
+qualifier, see the <a href="{@docRoot}guide/practices/screens_support.html">Supporting
+Multiple Screens</a> developer guide.</p>
</td>
</tr>
<tr id="ScreenHeightQualifier">
- <td>Screen height</td>
+ <td>Available height</td>
<td><code>h&lt;N&gt;dp</code><br/><br/>
Examples:<br/>
<code>h720dp</code><br/>
@@ -414,7 +425,7 @@ indicates the current locale.</p>
etc.
</td>
<td>
- <p>Specifies a minimum screen height, in "dp" units at which the resource
+ <p>Specifies a minimum available screen height, in "dp" units at which the resource
should be used&mdash;defined by the <code>&lt;N&gt;</code> value. This
configuration value will change when the orientation
changes between landscape and portrait to match the current actual height.</p>
@@ -432,6 +443,9 @@ indicates the current locale.</p>
<p><em>Added in API level 13.</em></p>
<p>Also see the {@link android.content.res.Configuration#screenHeightDp}
configuration field, which holds the current screen width.</p>
+ <p>For more information about designing for different screens and using this
+qualifier, see the <a href="{@docRoot}guide/practices/screens_support.html">Supporting
+Multiple Screens</a> developer guide.</p>
</td>
</tr>
<tr id="ScreenSizeQualifier">
@@ -444,30 +458,35 @@ indicates the current locale.</p>
</td>
<td>
<ul class="nolist">
- <li>{@code small}: Screens based on the space available on a
- low-density QVGA screen. Considering a portrait HVGA display, this has
- the same available width but less height&mdash;it is 3:4 vs. HVGA's
- 2:3 aspect ratio. The minimum layout size for this screen configuration
+ <li>{@code small}: Screens that are of similar size to a
+ low-density QVGA screen. The minimum layout size for a small screen
is approximately 320x426 dp units. Examples are QVGA low density and VGA high
density.</li>
- <li>{@code normal}: Screens based on the traditional
- medium-density HVGA screen. A screen is considered to be normal if it is
- at least this size (independent of density) and not larger. The minimum
- layout size for this screen configuration is approximately 320x470 dp units. Examples
+ <li>{@code normal}: Screens that are of similar size to a
+ medium-density HVGA screen. The minimum
+ layout size for a normal screen is approximately 320x470 dp units. Examples
of such screens a WQVGA low density, HVGA medium density, WVGA
high density.</li>
- <li>{@code large}: Screens based on the space available on a
- medium-density VGA screen. Such a screen has significantly more
- available space in both width and height than an HVGA display.
- The minimum layout size for this screen configuration is approximately 480x640 dp units.
+ <li>{@code large}: Screens that are of similar size to a
+ medium-density VGA screen.
+ The minimum layout size for a large screen is approximately 480x640 dp units.
Examples are VGA and WVGA medium density screens.</li>
<li>{@code xlarge}: Screens that are considerably larger than the traditional
- medium-density HVGA screen. The minimum layout size for this screen configuration
+ medium-density HVGA screen. The minimum layout size for an xlarge screen
is approximately 720x960 dp units. In most cases, devices with extra large
screens would be too large to carry in a pocket and would most likely
be tablet-style devices. <em>Added in API level 9.</em></li>
</ul>
+ <p class="note"><strong>Note:</strong> Using a size qualifier does not imply that the
+resources are <em>only</em> for screens of that size. If you do not provide alternative
+resources with qualifiers that better match the current device configuration, the system may use
+whichever resources are the <a href="#BestMatch">best match</a>.</p>
+ <p class="caution"><strong>Caution:</strong> If all your resources use a size qualifier that
+is <em>larger</em> than the current screen, the system will <strong>not</strong> use them and your
+application will crash at runtime (for example, if all layout resources are tagged with the {@code
+xlarge} qualifier, but the device is a normal-size screen).</p>
<p><em>Added in API level 4.</em></p>
+
<p>See <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
Screens</a> for more information.</p>
<p>Also see the {@link android.content.res.Configuration#screenLayout} configuration field,
@@ -557,7 +576,8 @@ application during runtime.</p>
<code>mdpi</code><br/>
<code>hdpi</code><br/>
<code>xhdpi</code><br/>
- <code>nodpi</code>
+ <code>nodpi</code><br/>
+ <code>tvdpi</code>
</td>
<td>
<ul class="nolist">
@@ -569,21 +589,23 @@ application during runtime.</p>
Level 8</em></li>
<li>{@code nodpi}: This can be used for bitmap resources that you do not want to be scaled
to match the device density.</li>
+ <li>{@code tvdpi}: Screens somewhere between mdpi and hdpi; approximately 213dpi. This is
+not considered a "primary" density group. It is mostly intended for televisions and most
+apps shouldn't need it&mdash;providing mdpi and hdpi resources is sufficient for most apps and
+the system will scale them as appropriate. This qualifier was introduced with API level 13.</li>
</ul>
- <p><em>Added in API level 4.</em></p>
- <p>There is thus a 3:4:6:8 scaling ratio between the four densities, so a 9x9 bitmap
- in ldpi is 12x12 in mdpi, 18x18 in hdpi and 24x24 in xhdpi.</p>
- <p>When Android selects which resource files to use,
- it handles screen density differently than the other qualifiers.
- In step 1 of <a href="#BestMatch">How Android finds the best
- matching directory</a> (below), screen density is always considered to
- be a match. In step 4, if the qualifier being considered is screen
- density, Android selects the best final match at that point,
- without any need to move on to step 5.
- </p>
+ <p>There is a 3:4:6:8 scaling ratio between the four primary densities (ignoring the
+tvdpi density). So, a 9x9 bitmap in ldpi is 12x12 in mdpi, 18x18 in hdpi and 24x24 in xhdpi.</p>
+ <p>If you decide that your image resources don't look good enough on a television or
+other certain devices and want to try tvdpi resources, the scaling factor is 1.33*mdpi. For
+example, a 100px x 100px image for mdpi screens should be 133px x 133px for tvdpi.</p>
+ <p class="note"><strong>Note:</strong> Using a density qualifier does not imply that the
+resources are <em>only</em> for screens of that density. If you do not provide alternative
+resources with qualifiers that better match the current device configuration, the system may use
+whichever resources are the <a href="#BestMatch">best match</a>.</p>
<p>See <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a> for more information about how to handle screen sizes and how Android might scale
-your bitmaps.</p>
+Screens</a> for more information about how to handle different screen densities and how Android
+might scale your bitmaps to fit the current density.</p>
</td>
</tr>
<tr id="TouchscreenQualifier">
@@ -993,7 +1015,10 @@ Primary text input method = <code>12key</code>
</p>
<p>By comparing the device configuration to the available alternative resources, Android selects
-drawables from {@code drawable-en-port}. It arrives at this decision using the following logic:</p>
+drawables from {@code drawable-en-port}.</p>
+
+<p>The system arrives at its decision for which resources to use with the following
+logic:</p>
<div class="figure" style="width:280px">
@@ -1069,6 +1094,14 @@ language is English ("en"), then any resource directory that has a language qual
something other than English is never included in the pool of resources checked (though a
resource directory <em>without</em> the language qualifier is still included).</p>
+<p>When selecting resources based on the screen size qualifiers, the system will use resources
+designed for a screen smaller than the current screen if there are no resources that better match
+(for example, a large-size screen will use normal-size screen resources if necessary). However, if
+the only available resources are <em>larger</em> than the current screen, the system will
+<strong>not</strong> use them and your application will crash if no other resources match the device
+configuration (for example, if all layout resources are tagged with the {@code xlarge} qualifier,
+but the device is a normal-size screen).</p>
+
<p class="note"><strong>Note:</strong> The <em>precedence</em> of the qualifier (in <a
href="#table2">table 2</a>) is more important
than the number of qualifiers that exactly match the device. For example, in step 4 above, the last
diff --git a/docs/html/guide/topics/resources/string-resource.jd b/docs/html/guide/topics/resources/string-resource.jd
index 2db38f1..ecd2d48 100644
--- a/docs/html/guide/topics/resources/string-resource.jd
+++ b/docs/html/guide/topics/resources/string-resource.jd
@@ -107,7 +107,7 @@ ID.</dd>
String string = {@link android.content.Context#getString(int) getString}(R.string.hello);
</pre>
<p>You can use either {@link android.content.Context#getString(int)} or
-{@link android.content.Context#getText(int)} to retieve a string. {@link
+{@link android.content.Context#getText(int)} to retrieve a string. {@link
android.content.Context#getText(int)} will retain any rich text styling applied to the string.</p>
</dd> <!-- end example -->
@@ -233,9 +233,9 @@ the appropriate resource for you.
<p>Note that the selection is made based on grammatical necessity. A string for <code>zero</code>
in English will be ignored even if the quantity is 0, because 0 isn't grammatically different
-from 2, or any other number except 1 ("zero books", "one book", "two books", et cetera).
+from 2, or any other number except 1 ("zero books", "one book", "two books", and so on).
Don't be misled either by the fact that, say, <code>two</code> sounds like it could only apply to
-the quantity 2: a language may require that 2, 12, 102 (et cetera) are all treated like one
+the quantity 2: a language may require that 2, 12, 102 (and so on) are all treated like one
another but differently to other quantities. Rely on your translator to know what distinctions
their language actually insists upon.
@@ -359,8 +359,15 @@ values, with non-exhaustive examples in parentheses:
int count = getNumberOfsongsAvailable();
Resources res = {@link android.content.Context#getResources()};
String songsFound = res.{@link android.content.res.Resources#getQuantityString(int,int)
-getQuantityString}(R.plurals.numberOfSongsAvailable, count);
+getQuantityString}(R.plurals.numberOfSongsAvailable, count, count);
</pre>
+<p>When using the {@link android.content.res.Resources#getQuantityString(int,int)
+getQuantityString()} method, you need to pass the {@code count} twice if your string includes
+<a href="#FormattingAndStyling">string formatting</a> with a number. For example, for the string
+{@code %d songs found}, the first {@code count} parameter selects the appropriate plural string and
+the second {@code count} parameter is inserted into the {@code %d} placeholder. If your plural
+strings do not include string formatting, you don't need to pass the third parameter to {@link
+android.content.res.Resources#getQuantityString(int,int) getQuantityString}.</p>
</dd> <!-- end example -->
</dl>
@@ -405,7 +412,7 @@ your format arguments in the string resource. For example, with the following re
</pre>
<p>In this example, the format string has two arguments: {@code %1$s} is a string and {@code %2$d}
-is a decimal number. You can format the string with arguements from your application like this:</p>
+is a decimal number. You can format the string with arguments from your application like this:</p>
<pre>
Resources res = {@link android.content.Context#getResources()};
diff --git a/docs/html/guide/topics/usb/adk.jd b/docs/html/guide/topics/usb/adk.jd
index b5a3f30..463ec9c 100644
--- a/docs/html/guide/topics/usb/adk.jd
+++ b/docs/html/guide/topics/usb/adk.jd
@@ -59,7 +59,6 @@ page.title=Android Open Accessory Development Kit
<li><a href="https://dl-ssl.google.com/android/adk/adk_release_0512.zip">ADK package</a></li>
</ol>
-
<h2>See also</h2>
<ol>
@@ -70,22 +69,29 @@ page.title=Android Open Accessory Development Kit
<h2>Where to buy</h2>
<ol>
+
+ <li><a href="http://store.arduino.cc/">
+ Arduino Store</a></li>
+
+ <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">
+ DIY Drones</a></li>
+
+ <li><a href=
+ "http://www.microchip.com/android">
+ Microchip</a></li>
+
<li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">
Modern Device</a></li>
- <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
- Seeed Studio</a></li>
-
- <li><a href=
+ <li><a href=
"http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
RT Corp</a></li>
- <li><a href=
- "http://www.microchip.com/android">
- Microchip</a></li>
+ <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
+ Seeed Studio</a></li>
- <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">
- DIY Drones</a></li>
+ <li><a href="http://www.sparkfun.com/products/10748">
+ SparkFun</a></li>
</ol>
</div>
@@ -114,21 +120,30 @@ page.title=Android Open Accessory Development Kit
development boards:</p>
<ul>
+
+ <li>The <a href="http://store.arduino.cc/">Arduino Store</a> provides the Arduino Mega ADK
+ (in <a href="http://store.arduino.cc/eu/index.php?main_page=product_info&cPath=11_12&products_id=144">EU nations</a>
+ or <a href="http://store.arduino.cc/ww/index.php?main_page=product_info&cPath=11_12&products_id=144">non-EU nations</a>)
+ that is based on the ATmega2560 and supports the ADK firmware.</li>
+
+ <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">DIY
+ Drones</a> provides an Arduino-compatible board geared towards RC (radio controlled) and UAV
+ (unmanned aerial vehicle) enthusiasts.</li>
+
+ <li><a href="http://www.microchip.com/android">Microchip</a> provides a PIC based USB
+ microcontroller board.</li>
+
<li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">Modern
Device</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
- <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
- Seeed Studio</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
-
<li><a href="http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
RT Corp</a> provides an Arduino-compatible board based on the Android ADK board design.</li>
- <li><a href="http://www.microchip.com/android">Microchip</a> provides a A PIC based USB
- microcontroller board.</li>
+ <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
+ Seeed Studio</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
- <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">DIY
- Drones</a> provides an Arduino-compatible board geared towards RC (radio controlled) and UAV
- (unmanned aerial vehicle) enthusiasts.</li>
+ <li><a href="http://www.sparkfun.com/products/10748">
+ SparkFun</a>'s IOIO board now has beta support for the ADK firmware.</li>
</ul>
@@ -140,7 +155,7 @@ page.title=Android Open Accessory Development Kit
accessory that is based on the <a href="http://www.arduino.cc/">Arduino open source electronics
prototyping platform</a>, the accessory's hardware design files, code that implements the
accessory's firmware, and the Android application that interacts with the accessory. The hardware
- design files and firmware code are contained in the <a href=ctive
+ design files and firmware code are contained in the <a href=
"https://dl-ssl.google.com/android/adk/adk_release_0512.zip">ADK package download</a>.</p>
<p>The main hardware and software components of the ADK include:</p>
@@ -347,7 +362,7 @@ page.title=Android Open Accessory Development Kit
2.3.4 devices that support accessory mode. This library is also forward compatible with Android
3.1 or newer devices that support accessory mode. If you only care about Android 3.1 or newer
devices, all you need is API Level 12. For more information on deciding which API level to use,
- see the <a href="{@docRoot}guide/topics/USB/accessory.html#choosing">USB Accessory</a>
+ see the <a href="{@docRoot}guide/topics/usb/accessory.html#choosing">USB Accessory</a>
documentation.</li>
<li>Click <strong>File &gt; New &gt; Project...</strong>, then select <strong>Android &gt;
@@ -885,4 +900,4 @@ int AndroidAccessory::write(void *buff, int len) {
</pre>
<p>See the <code>firmware/demokit/demokit.pde</code> file for information about how the ADK board
- reads and writes data.</p> \ No newline at end of file
+ reads and writes data.</p>
diff --git a/docs/html/guide/topics/usb/host.jd b/docs/html/guide/topics/usb/host.jd
index 942708d..4967033 100644
--- a/docs/html/guide/topics/usb/host.jd
+++ b/docs/html/guide/topics/usb/host.jd
@@ -264,11 +264,7 @@ UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE
UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
...
HashMap&lt;String, UsbDevice&gt; deviceList = manager.getDeviceList();
-Iterator&lt;UsbDevice&gt; deviceIterator = deviceList.values().iterator();
-while(deviceIterator.hasNext()){
- UsbDevice device = deviceIterator.next();
- // your code
-}
+UsbDevice device = deviceList.get("deviceName");
</pre>
<p>If desired, you can also just obtain an iterator from the hash map and process each device one