docs: remove trailing white space from jd files
Change-Id: Id7fb958460bf2f28d88c6120df0395690f32783a
diff --git a/docs/html/about/android.jd b/docs/html/about/android.jd
index e3b6958..6e57390 100644
--- a/docs/html/about/android.jd
+++ b/docs/html/about/android.jd
@@ -26,11 +26,11 @@
<blockquote>Every day more than a million new Android devices are activated worldwide.</blockquote>
<p>Android’s openness has made it a favorite for consumers and developers alike,
-driving strong growth in app consumption. Android users download
+driving strong growth in app consumption. Android users download
billions of apps and games from Google Play each month. </p>
<p>With its partners, Android is continuously pushing the boundaries of hardware and software
-forward to bring new capabilities to users and developers. For developers,
+forward to bring new capabilities to users and developers. For developers,
Android innovation lets you build powerful, differentiated applications
that use the latest mobile technologies.</p>
@@ -59,7 +59,7 @@
advantage of the hardware capabilities available on each device. It
automatically adapts your UI to look its best on each device, while giving you
as much control as you want over your UI on different device
-types. </p>
+types. </p>
<p>For example, you can create a single app binary that's optimized for
both phone and tablet form factors. You declare your UI in lightweight sets of XML
@@ -70,7 +70,7 @@
and so on.</p>
-<p>To help you develop efficiently, the <a href="{@docRoot}tools/index.html">Android
+<p>To help you develop efficiently, the <a href="{@docRoot}tools/index.html">Android
Developer Tools</a>
offer a full Java IDE with advanced features for developing, debugging, and
packaging Android apps. Using the IDE, you can develop on any available Android
diff --git a/docs/html/about/index.jd b/docs/html/about/index.jd
index 22f504e..274a511 100644
--- a/docs/html/about/index.jd
+++ b/docs/html/about/index.jd
@@ -34,11 +34,11 @@
<blockquote>Every day more than 1 million new Android devices are activated worldwide.</blockquote>
<p>Android’s openness has made it a favorite for consumers and developers alike,
-driving strong growth in app consumption. Android users download more than
+driving strong growth in app consumption. Android users download more than
1.5 billion apps and games from Google Play each month. </p>
<p>With its partners, Android is continuously pushing the boundaries of hardware and software
-forward to bring new capabilities to users and developers. For developers,
+forward to bring new capabilities to users and developers. For developers,
Android innovation lets you build powerful, differentiated applications
that use the latest mobile technologies.</p>
@@ -68,7 +68,7 @@
advantage of the hardware capabilities available on each device. It
automatically adapts your UI to look its best on each device, while giving you
as much control as you want over your UI on different device
-types. </p>
+types. </p>
<p>For example, you can create a single app binary that's optimized for
both phone and tablet form factors. You declare your UI in lightweight sets of XML
@@ -79,7 +79,7 @@
and so on.</p>
-<p>To help you develop efficiently, the <a href="{@docRoot}tools/index.html">Android
+<p>To help you develop efficiently, the <a href="{@docRoot}tools/index.html">Android
Developer Tools</a>
offer a full Java IDE with advanced features for developing, debugging, and
packaging Android apps. Using the IDE, you can develop on any available Android
diff --git a/docs/html/about/versions/android-1.1.jd b/docs/html/about/versions/android-1.1.jd
index b2a1615..e7d059e 100644
--- a/docs/html/about/versions/android-1.1.jd
+++ b/docs/html/about/versions/android-1.1.jd
@@ -9,7 +9,7 @@
<em>API Level:</em> <strong>2</strong></p>
-<p>This document provides version notes for the Android 1.1 system image included in the SDK.
+<p>This document provides version notes for the Android 1.1 system image included in the SDK.
<ul>
<li><a href="#overview">Overview</a>
@@ -29,7 +29,7 @@
Android-powered handsets starting in February 2009. </p>
<p>The Android 1.1 system image delivers an updated version of the framework
-API. As with the Android 1.0 API, the Android 1.1 API
+API. As with the Android 1.0 API, the Android 1.1 API
is assigned an integer identifier — <strong>2</strong> — that is
stored in the system itself. This identifier, called the "API Level", allows the
system to correctly determine whether an application is compatible with
@@ -37,8 +37,8 @@
<p>Applications indicate the lowest system API Level that they are compatible with by adding
a value to the <code>android:minSdkVersion</code> attribute.
-The value of the attribute is an integer corresponding to an API Level
-identifier. Prior to installing an application, the system checks the value of
+The value of the attribute is an integer corresponding to an API Level
+identifier. Prior to installing an application, the system checks the value of
<code>android:minSdkVersion</code> and allows the install only
if the referenced integer is less than or equal to the API Level integer stored
in the system itself. </p>
@@ -139,7 +139,7 @@
<li>German (de) </li>
</ul>
-<p>Localized UI strings match the locales that are displayable in
+<p>Localized UI strings match the locales that are displayable in
the emulator, accessible through the device Settings application.</p>
<h2 id="resolved-issues">Resolved Issues</h2>
diff --git a/docs/html/about/versions/android-1.5-highlights.jd b/docs/html/about/versions/android-1.5-highlights.jd
index dd4d218..e0bae48 100644
--- a/docs/html/about/versions/android-1.5-highlights.jd
+++ b/docs/html/about/versions/android-1.5-highlights.jd
@@ -7,7 +7,7 @@
</p>
-<p>The Android 1.5 platform introduces many new features for users and developers.
+<p>The Android 1.5 platform introduces many new features for users and developers.
The list below provides an overview of the changes. </p>
<ul>
@@ -65,7 +65,7 @@
<ul>
<li>Widgets
<ul>
- <li>Bundled home screen widgets include: analog clock, calendar,
+ <li>Bundled home screen widgets include: analog clock, calendar,
music player, picture frame, and search</li>
</ul></li>
<li>Live folders</li>
@@ -121,7 +121,7 @@
<li>Google applications (not available in the Android 1.5 System Image that is
included in the Android SDK)
<ul>
- <li>View Google Talk friends' status in Contacts, SMS, MMS, GMail, and
+ <li>View Google Talk friends' status in Contacts, SMS, MMS, GMail, and
Email applications</li>
<li>Batch actions such as archive, delete, and label on Gmail messages</li>
<li>Upload videos to Youtube</li>
@@ -165,7 +165,7 @@
</ul>
</li>
-<li>Input Method framework
+<li>Input Method framework
<ul>
<li>{@link android.inputmethodservice.InputMethodService Input Method
Service} framework</li>
diff --git a/docs/html/about/versions/android-1.5.jd b/docs/html/about/versions/android-1.5.jd
index 775561b..45a27ee 100644
--- a/docs/html/about/versions/android-1.5.jd
+++ b/docs/html/about/versions/android-1.5.jd
@@ -55,7 +55,7 @@
<h2 id="features">Platform Highlights</h2>
<p>For a list of new user features and platform highlights, see the <a
-href="http://developer.android.com/about/versions/android-{@sdkPlatformVersion}-highlights.html">Android
+href="http://developer.android.com/about/versions/android-{@sdkPlatformVersion}-highlights.html">Android
{@sdkPlatformVersion} Platform Highlights</a> document.</p>
<h2 id="relnotes">Revisions</h2>
@@ -119,10 +119,10 @@
<dt>Tools:</dt>
<dd>
-<ul>
+<ul>
<li>Adds support for library projects in the Ant build system.</li>
<li>Fixes test project build in the Ant build system.</li>
-</ul>
+</ul>
</dd>
</dl>
@@ -256,8 +256,8 @@
<h3 id="api-diff">API differences report</h3>
-<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
-the previous version, see the <a href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
+the previous version, see the <a href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
Differences Report</a>.</p>
@@ -300,8 +300,8 @@
<p>The system image included in the downloadable platform provides a variety of
built-in locales. In some cases, region-specific strings are available for the
locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em>
+languages that are available in the Android {@sdkPlatformVersion} system
+image are listed below (with <em>language</em>_<em>country/region</em>
locale descriptor).</p>
<table style="border:0;padding-bottom:0;margin-bottom:0;">
@@ -341,7 +341,7 @@
</tr>
</table>
-<p>Localized UI strings match the locales that are accessible
+<p>Localized UI strings match the locales that are accessible
through Settings.</p>
<h2 id="skins">Emulator Skins</h2>
diff --git a/docs/html/about/versions/android-1.6-highlights.jd b/docs/html/about/versions/android-1.6-highlights.jd
index 88c0f55..9179579 100644
--- a/docs/html/about/versions/android-1.6-highlights.jd
+++ b/docs/html/about/versions/android-1.6-highlights.jd
@@ -28,13 +28,13 @@
<object width="278" height="180">
<param name="movie" value="http://www.youtube.com/v/MBRFkLKRwFw&hl=en&fs=1&"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
-<embed src="//www.youtube.com/v/MBRFkLKRwFw&hl=en&fs=1&" type="application/x-shockwave-flash"
+<embed src="//www.youtube.com/v/MBRFkLKRwFw&hl=en&fs=1&" type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
</object>
</div>
-<p>The Android 1.6 platform introduces new features for users and developers.
+<p>The Android 1.6 platform introduces new features for users and developers.
This page provides an overview of some new features and technologies.</p>
<ul>
@@ -44,7 +44,7 @@
</ul>
-
+
<h2 id="UserFeatures" style="clear:right">New User Features</h2>
<!-- screenshots float right -->
@@ -53,7 +53,7 @@
<img src="{@docRoot}sdk/images/search.png" class="screenshot" alt="" /><br/>
Quick Search Box
</div>
-
+
<div class="screenshot">
<img src="{@docRoot}sdk/images/camera.png" class="screenshot" alt="" /><br/>
New Camera/Camcorder UI
@@ -67,32 +67,32 @@
<h3 id="QuickSearchBox">Quick Search Box for Android</h3>
-<p>Android 1.6 includes a redesigned search framework that provides a quick,
-effective, and consistent way for users to search across multiple sources—such as
-browser bookmarks & history, contacts, and the web—directly from
+<p>Android 1.6 includes a redesigned search framework that provides a quick,
+effective, and consistent way for users to search across multiple sources—such as
+browser bookmarks & history, contacts, and the web—directly from
the home screen.</p>
-<p>The system constantly learns which search results are more relevant based on what is
-clicked. So popular contacts or apps that have previously been picked will bubble up to
+<p>The system constantly learns which search results are more relevant based on what is
+clicked. So popular contacts or apps that have previously been picked will bubble up to
the top when a user types the first few letters of a relevant query.</p>
-<p>The search framework also provides developers a way to easily expose relevant
+<p>The search framework also provides developers a way to easily expose relevant
content from their applications in Quick Search Box.</p>
<h3 id="Camera">Camera, Camcorder, and Gallery</h3>
-<p>An updated user interface provides an integrated camera, camcorder, and gallery experience.
-Users can quickly toggle between still and video capture modes. Additionally, the gallery
+<p>An updated user interface provides an integrated camera, camcorder, and gallery experience.
+Users can quickly toggle between still and video capture modes. Additionally, the gallery
enables users to select multiple photos for deletion.</p>
<p>Android 1.6 also provides a much faster camera experience.
-Compared to the previous release, launching the camera is now 39% faster,
+Compared to the previous release, launching the camera is now 39% faster,
and there is a 28% improvement in the time from completing one shot to the next.</p>
<h3 id="VPN">VPN, 802.1x</h3>
-<p>A new Virtual Private Network (VPN) control panel in Settings allows users
+<p>A new Virtual Private Network (VPN) control panel in Settings allows users
to configure and connect to the following types of VPNs:</p>
<ul>
@@ -105,8 +105,8 @@
<h3 id="Battery">Battery usage indicator</h3>
-<p>A new battery usage screen lets users see which apps and services are consuming
-battery power. If the user determines that a particular service or application is
+<p>A new battery usage screen lets users see which apps and services are consuming
+battery power. If the user determines that a particular service or application is
using too much power, they can take action to save the battery by
adjusting settings, stopping the application, or uninstalling the application.</p>
@@ -132,11 +132,11 @@
<ul>
<li>At the homescreen, users can choose among <em>Apps</em>, <em>Games</em>, and <em>Downloads</em>.</li>
<li>Inside a category, users can explore titles that are <em>Top paid</em>, <em>Top free</em>, and <em>Just in</em>.</li>
- <li>For each title, users can now see screenshots submitted by developers in addition to
+ <li>For each title, users can now see screenshots submitted by developers in addition to
reviews from other users.</li>
</ul>
-
-
+
+
<h2 id="PlatformTechnologies" style="clear:right">New Platform Technologies</h2>
@@ -145,44 +145,44 @@
<p>The Android search framework has been redesigned and expanded to provide
third-party applications the opportunity to surface
-content from their applications in Quick Search Box, the global search tool.
-To do this, developers will need to make their app "searchable" and provide
+content from their applications in Quick Search Box, the global search tool.
+To do this, developers will need to make their app "searchable" and provide
suggestions in response to user queries.
-To enable application search suggestions, users simply select each application from which
+To enable application search suggestions, users simply select each application from which
they'd like to receive suggestions, under Searchable items in the Search settings.</p>
<h3 id="TTS">Text-to-speech engine</h3>
-<p>Android 1.6 features a multi-lingual speech synthesis engine called Pico.
-It allows any Android application to "speak" a string of text with an accent that matches the language.
-The engine supports the following languages: English (American and British accents), French,
-Italian, German and Spanish. If you're using a T-Mobile G1 or Dream device, you'll need to download the
-SpeechSynthesis Data Installer from Google Play, which includes the "voices" needed by the
+<p>Android 1.6 features a multi-lingual speech synthesis engine called Pico.
+It allows any Android application to "speak" a string of text with an accent that matches the language.
+The engine supports the following languages: English (American and British accents), French,
+Italian, German and Spanish. If you're using a T-Mobile G1 or Dream device, you'll need to download the
+SpeechSynthesis Data Installer from Google Play, which includes the "voices" needed by the
text-to-speech engine.</p>
<h3 id="Gestures">Gestures</h3>
-<p>A new gestures framework provides application developers with a framework for creating, storing,
+<p>A new gestures framework provides application developers with a framework for creating, storing,
loading, and recognizing gestures and associating them with specific actions.</p>
-<p>Developers can use the new GestureBuilder tool included in the Android 1.6 SDK to generate libraries
+<p>Developers can use the new GestureBuilder tool included in the Android 1.6 SDK to generate libraries
of gestures to include with their application.</p>
<h3 id="A11y">Accessibility</h3>
-<p>Android 1.6 provides a new accessibility framework.
-With this framework, developers can create accessibility plugins that respond to user input,
-such as making a sound when a new window is shown, vibrating when navigating to the top of
+<p>Android 1.6 provides a new accessibility framework.
+With this framework, developers can create accessibility plugins that respond to user input,
+such as making a sound when a new window is shown, vibrating when navigating to the top of
a list, and providing spoken feedback.</p>
<h3 id="Screens">Expanded support for screen densities and resolutions</h3>
-<p>Android 1.6 adds screen support that enables applications to be rendered properly on different
-display resolutions and densities. Developers can also specify the types of screens supported by their
+<p>Android 1.6 adds screen support that enables applications to be rendered properly on different
+display resolutions and densities. Developers can also specify the types of screens supported by their
application.</p>
@@ -208,7 +208,7 @@
<h3 id="DeveloperAPIs">New Framework APIs</h3>
-<p>For a detailed overview of new APIs, see the
-<a href="{@docRoot}about/versions/android-1.6.html#api-changes">Version Notes</a>.
-For a complete report of all API changes, see the
+<p>For a detailed overview of new APIs, see the
+<a href="{@docRoot}about/versions/android-1.6.html#api-changes">Version Notes</a>.
+For a complete report of all API changes, see the
<a href="{@docRoot}sdk/api_diff/4/changes.html">API Differences Report</a>.
diff --git a/docs/html/about/versions/android-2.0-highlights.jd b/docs/html/about/versions/android-2.0-highlights.jd
index c16088a..3f7e1c8 100644
--- a/docs/html/about/versions/android-2.0-highlights.jd
+++ b/docs/html/about/versions/android-2.0-highlights.jd
@@ -33,7 +33,7 @@
<object width="278 height="180">
<param name="movie" value="http://www.youtube.com/v/opZ69P-0Jbc&hl=en&fs=1&"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
-<embed src="//www.youtube.com/v/opZ69P-0Jbc&hl=en&fs=1&" type="application/x-shockwave-flash"
+<embed src="//www.youtube.com/v/opZ69P-0Jbc&hl=en&fs=1&" type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
</object>
</div>
@@ -49,7 +49,7 @@
</ul>
-
+
<h2 id="UserFeatures" style="clear:right">New User Features</h2>
<!-- screenshots float right -->
@@ -99,10 +99,10 @@
<!--
<ul>
- <li>Sync support for contacts from multiple data sources including Exchange.
- Handset manufacturers can choose whether or not to include Exchange support
+ <li>Sync support for contacts from multiple data sources including Exchange.
+ Handset manufacturers can choose whether or not to include Exchange support
in their devices.</li>
- <li>New way to hover on a person to see more info and select communication
+ <li>New way to hover on a person to see more info and select communication
mode (for example, phone, SMS, email).</li>
</ul>
-->
@@ -150,7 +150,7 @@
<h3 id="Browser">Browser</h3>
<ul>
- <li>Refreshed UI with actionable browser URL bar enables users to directly
+ <li>Refreshed UI with actionable browser URL bar enables users to directly
tap the address bar for instant searches and navigation.</li>
<li>Bookmarks with web page thumbnails.</li>
<li>Support for double-tap zoom.</li>
@@ -192,10 +192,10 @@
<h3 id="DeveloperAPIs">New Framework APIs</h3>
<p>Android 2.0 includes several new developer APIs.
-For an overview of new APIs, see the
+For an overview of new APIs, see the
<a href="{@docRoot}about/versions/android-2.0.html#api">Android 2.0 version notes</a>.</p>
-<p>For a complete report of all API changes, see the
+<p>For a complete report of all API changes, see the
<a href="{@docRoot}sdk/api_diff/5/changes.html">API Differences Report</a>.</p>
diff --git a/docs/html/about/versions/android-2.0.1.jd b/docs/html/about/versions/android-2.0.1.jd
index 48f7ae8..b0f4db6 100644
--- a/docs/html/about/versions/android-2.0.1.jd
+++ b/docs/html/about/versions/android-2.0.1.jd
@@ -162,8 +162,8 @@
<p>The system image included in the downloadable platform provides a variety of
built-in locales. In some cases, region-specific strings are available for the
locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
+languages that are available in the Android {@sdkPlatformVersion} system
+image are listed below (with <em>language</em>_<em>country/region</em> locale
descriptor).</p>
<table style="border:0;padding-bottom:0;margin-bottom:0;">
@@ -203,7 +203,7 @@
</tr>
</table>
-<p>Localized UI strings match the locales that are accessible
+<p>Localized UI strings match the locales that are accessible
through Settings.</p>
<h2 id="skins">Emulator Skins</h2>
@@ -263,8 +263,8 @@
system to correctly determine whether an application is compatible with
the system, prior to installing the application. </p>
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
-set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
+set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
element in your application's manifest. </p>
<p>For more information about how to use API Level, see the <a
@@ -345,10 +345,10 @@
<h3 id="api-diff">API differences report</h3>
-<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
+<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
API Level 5, see the <a
href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a>. There are very few API changes in API Level 6,
+Differences Report</a>. There are very few API changes in API Level 6,
so you might also be interested in reviewing the <a
href="{@docRoot}sdk/api_diff/5/changes.html">API
differences between 4 and 5</a>.</p>
diff --git a/docs/html/about/versions/android-2.0.jd b/docs/html/about/versions/android-2.0.jd
index 329af3c..0323686 100644
--- a/docs/html/about/versions/android-2.0.jd
+++ b/docs/html/about/versions/android-2.0.jd
@@ -50,7 +50,7 @@
<h2 id="features">Platform Highlights</h2>
<p>For a list of new user features and platform highlights, see the <a
-href="http://developer.android.com/about/versions/android-{@sdkPlatformVersion}-highlights.html">Android
+href="http://developer.android.com/about/versions/android-{@sdkPlatformVersion}-highlights.html">Android
{@sdkPlatformVersion} Platform Highlights</a> document.</p>
<h2 id="relnotes">Revisions</h2>
@@ -151,8 +151,8 @@
<p>The system image included in the downloadable platform provides a variety of
built-in locales. In some cases, region-specific strings are available for the
locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
+languages that are available in the Android {@sdkPlatformVersion} system
+image are listed below (with <em>language</em>_<em>country/region</em> locale
descriptor).</p>
<table style="border:0;padding-bottom:0;margin-bottom:0;">
@@ -192,7 +192,7 @@
</tr>
</table>
-<p>Localized UI strings match the locales that are accessible
+<p>Localized UI strings match the locales that are accessible
through Settings.</p>
<h2 id="skins">Emulator Skins</h2>
@@ -242,14 +242,14 @@
<h3 id="api-level">API level</h3>
<p>The Android {@sdkPlatformVersion} platform delivers an updated version of the framework
-API. As with previous versions, the Android {@sdkPlatformVersion} API
+API. As with previous versions, the Android {@sdkPlatformVersion} API
is assigned an integer identifier — <strong>{@sdkPlatformApiLevel}</strong> — that is
stored in the system itself. This identifier, called the "API Level", allows the
system to correctly determine whether an application is compatible with
the system, prior to installing the application. </p>
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
-set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
+set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
element in your application's manifest. </p>
<p>For more information about how to use API Level, see the <a
@@ -319,8 +319,8 @@
<p>Android 2.0 is designed to run on devices that use virtual keys for HOME,
MENU, BACK, and SEARCH, rather than physical keys. To support the best user
experience on those devices, the Android platform now executes these buttons at
-key-up, for a key-down/key-up pair, rather than key-down. This helps prevent
-accidental button events and lets the user press the button area and then drag
+key-up, for a key-down/key-up pair, rather than key-down. This helps prevent
+accidental button events and lets the user press the button area and then drag
out of it without generating an event. </p>
<p>This change in behavior should only affect your application if it is
@@ -332,7 +332,7 @@
however, if your application is doing so and it invokes some action on
key-down, rather than key-up, you should modify your code. </p>
-<p>If your application will use APIs introduced in Android 2.0 (API Level 5),
+<p>If your application will use APIs introduced in Android 2.0 (API Level 5),
you can take advantage of new APIs for managing key-event pairs:</p>
<ul>
@@ -363,16 +363,16 @@
</ul>
<p>If you want to update a legacy application so that its handling of the BACK
-key works properly for both Android 2.0 and older platform versions, you
+key works properly for both Android 2.0 and older platform versions, you
can use an approach similar to that shown above. Your code can catch the
-target button event on key-down, set a flag to track the key event, and
-then also catch the event on key-up, executing the desired action if the tracking
-flag is set. You'll also want to watch for focus changes and clear the tracking
+target button event on key-down, set a flag to track the key event, and
+then also catch the event on key-up, executing the desired action if the tracking
+flag is set. You'll also want to watch for focus changes and clear the tracking
flag when gaining/losing focus.</p>
<h3 id="api-diff">API differences report</h3>
-<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
+<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
the previous version, see the <a
href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
diff --git a/docs/html/about/versions/android-2.1.jd b/docs/html/about/versions/android-2.1.jd
index ce6f1b2..5f8f624 100644
--- a/docs/html/about/versions/android-2.1.jd
+++ b/docs/html/about/versions/android-2.1.jd
@@ -113,10 +113,10 @@
<dt>Tools:</dt>
<dd>
-<ul>
+<ul>
<li>Adds support for library projects in the Ant build system.</li>
<li>Adds improved layout rendering in ADT’s visual layout editor.</li>
-</ul>
+</ul>
</dd>
</dl>
diff --git a/docs/html/about/versions/android-2.3.3.jd b/docs/html/about/versions/android-2.3.3.jd
index eec0735..91f1d28 100644
--- a/docs/html/about/versions/android-2.3.3.jd
+++ b/docs/html/about/versions/android-2.3.3.jd
@@ -81,7 +81,7 @@
<code>android.nfc.action.NDEF_DISCOVERED</code> and
<code>android.nfc.action.TECH_DISCOVERED</code>.</p>
-<p>The NFC API is available in the {@link android.nfc} and
+<p>The NFC API is available in the {@link android.nfc} and
{@link android.nfc.tech} packages. The key classes are: </p>
<ul>
@@ -89,7 +89,7 @@
<li>{@link android.nfc.NdefMessage}, which represents an NDEF data message,
the standard format in which "records" carrying data are transmitted between
devices and tags. An NDEF message certain many NDEF records of different types.
-Applications can receive these messages from
+Applications can receive these messages from
{@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED NDEF_DISCOVERED},
{@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED TECH_DISCOVERED}, or
{@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED TAG_DISCOVERED} Intents.</li>
@@ -124,15 +124,15 @@
<code><uses-feature android:name="android.hardware.nfc"
android:required="true"></code> to the application's manifest.</p>
-<p class="note">For more information, read the
+<p class="note">For more information, read the
<a href="{@docRoot}guide/topics/connectivity/nfc/index.html">NFC</a> developer guide.</p>
<h3 id="bluetooth">Bluetooth</h3>
<p>Android 2.3.3 adds platform and API support for Bluetooth nonsecure socket
connections. This lets applications communicate with simple devices that may not
-offer a UI for authentication. See
-{@link android.bluetooth.BluetoothDevice#createInsecureRfcommSocketToServiceRecord(java.util.UUID)} and
+offer a UI for authentication. See
+{@link android.bluetooth.BluetoothDevice#createInsecureRfcommSocketToServiceRecord(java.util.UUID)} and
{@link android.bluetooth.BluetoothAdapter#listenUsingInsecureRfcommWithServiceRecord(java.lang.String, java.util.UUID)}
for more information. </p>
@@ -183,7 +183,7 @@
<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
you need compile the application against the Android library that is provided in
-the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
+the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
attribute to the <code><uses-sdk></code> element in the application's
manifest. If your application is designed to run only on Android 2.3 and higher,
diff --git a/docs/html/about/versions/android-2.3.4.jd b/docs/html/about/versions/android-2.3.4.jd
index 963df9a..8705d1d 100644
--- a/docs/html/about/versions/android-2.3.4.jd
+++ b/docs/html/about/versions/android-2.3.4.jd
@@ -31,7 +31,7 @@
<p>Android 2.3.4 ({@link android.os.Build.VERSION_CODES#GINGERBREAD_MR1})
is a maintenance release that adds several bug fixes and patches
-to the Android 2.3 platform, without any API changes from Android 2.3.3. Additionally,
+to the Android 2.3 platform, without any API changes from Android 2.3.3. Additionally,
Android 2.3.4 brings support for the Open Accessory API to mobile devices,
through the optional <a href="#usb">Open Accessory Library</a>. </p>
diff --git a/docs/html/about/versions/android-2.3.jd b/docs/html/about/versions/android-2.3.jd
index 34fdb52..bc54903 100644
--- a/docs/html/about/versions/android-2.3.jd
+++ b/docs/html/about/versions/android-2.3.jd
@@ -240,7 +240,7 @@
<li>Applications can obtain an instance of the {@link android.app.DownloadManager}
class by calling {@link
android.content.Context#getSystemService(String)} and passing
-{@link android.content.Context#DOWNLOAD_SERVICE}. Applications that request
+{@link android.content.Context#DOWNLOAD_SERVICE}. Applications that request
downloads through this API should register a broadcast receiver for {@link
android.app.DownloadManager#ACTION_NOTIFICATION_CLICKED}, to appropriately
handle when the user clicks on a running download in a notification or from the
@@ -690,7 +690,7 @@
<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
you need compile the application against the Android library that is provided in
-the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
+the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
attribute to the <code><uses-sdk></code> element in the application's
manifest. If your application is designed to run only on Android 2.3 and higher,
diff --git a/docs/html/about/versions/android-3.0-highlights.jd b/docs/html/about/versions/android-3.0-highlights.jd
index 21dbda6..e9d2b39 100644
--- a/docs/html/about/versions/android-3.0-highlights.jd
+++ b/docs/html/about/versions/android-3.0-highlights.jd
@@ -40,7 +40,7 @@
<p>Welcome to Android 3.0!</p>
-<p>The Android 3.0 platform introduces many new and exciting features for users and developers.
+<p>The Android 3.0 platform introduces many new and exciting features for users and developers.
This document provides a glimpse of some of the new features and technologies, as delivered in
Android 3.0. For a more detailed look at new developer APIs, see the <a
href="{@docRoot}about/versions/android-3.0.html">Android 3.0 Platform</a> document.</p>
@@ -61,7 +61,7 @@
<p>Android 3.0 is a new version of the Android platform that is specifically optimized for devices with larger screen sizes, particularly tablets. It introduces a brand new, truly virtual and “holographic” UI design, as well as an elegant, content-focused interaction model.</p>
-<p>Android 3.0 builds on the things people love most about Android — refined multitasking, rich notifications, Home screen customization, widgets, and more — and transforms them with a vibrant, 3D experience and deeper interactivity, making them familiar but even better than before.</p>
+<p>Android 3.0 builds on the things people love most about Android — refined multitasking, rich notifications, Home screen customization, widgets, and more — and transforms them with a vibrant, 3D experience and deeper interactivity, making them familiar but even better than before.</p>
<p>The new UI brings fresh paradigms for interaction, navigation, and customization and makes them available to all applications — even those built for earlier versions of the platform. Applications written for Android 3.0 are able to use an extended set of UI objects, powerful graphics, and media capabilities to engage users in new ways.</p>
diff --git a/docs/html/about/versions/android-3.0.jd b/docs/html/about/versions/android-3.0.jd
index 5184743..3175d3c 100644
--- a/docs/html/about/versions/android-3.0.jd
+++ b/docs/html/about/versions/android-3.0.jd
@@ -392,7 +392,7 @@
<h3>Extended UI framework</h3>
<ul>
-
+
<li><b>Multiple-choice selection for ListView and GridView</b>
<p>New {@link android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL} mode for {@link
@@ -419,9 +419,9 @@
class in the API Demos sample application.</p>
</li>
-
+
<li><b>New APIs to transform views</b>
-
+
<p>New APIs allow you to easily apply 2D and 3D transformations to views in your activity
layout. New transformations are made possible with a set of object properties that define the view's
layout position, orientation, transparency and more.</p>
@@ -452,7 +452,7 @@
</pre>
</li>
-
+
<li><b>New holographic themes</b>
<p>The standard system widgets and overall look have been redesigned and incorporate a new
@@ -475,55 +475,55 @@
version</a>.</p>
</li>
-
-
+
+
<li><b>New widgets</b>
<ul>
<li>{@link android.widget.AdapterViewAnimator}
<p>Base class for an {@link android.widget.AdapterView} that performs animations when switching
between its views.</p></li>
-
+
<li>{@link android.widget.AdapterViewFlipper}
<p>Simple {@link android.widget.ViewAnimator} that animates between two or more views that have
been added to it. Only one child is shown at a time. If requested, it can automatically flip
between
each child at a regular interval.</p></li>
-
+
<li>{@link android.widget.CalendarView}
<p>Allows users to select dates from a calendar by touching the date and can scroll or fling the
calendar to a desired date. You can configure the range of dates available in the widget.</p></li>
-
+
<li>{@link android.widget.ListPopupWindow}
<p>Anchors itself to a host view and displays a list of choices, such as for a list of
suggestions when typing into an {@link android.widget.EditText} view.</p></li>
-
+
<li>{@link android.widget.NumberPicker}
<p>Enables the user to select a number from a predefined range. The widget presents an input
field and up and down buttons for selecting a number. Touching the input field allows the user to
scroll through values or touch again to directly edit the current value. It also allows you to map
positions to strings, so that the corresponding string is displayed instead of the index
position.</p></li>
-
+
<li>{@link android.widget.PopupMenu}
<p>Displays a {@link android.view.Menu} in a modal popup window that's anchored to a view. The
popup appears below the anchor view if there is room, or above it if there is not. If the IME (soft
keyboard) is visible, the popup does not overlap the IME it until the user touches the
menu.</p></li>
-
+
<li>{@link android.widget.SearchView}
<p>Provides a search box that you can configure to deliver search queries to a specified
activity and display search suggestions (in the same manner as the traditional search dialog). This
widget is particularly useful for offering a search widget in the Action Bar. For more information,
see <a href="{@docRoot}guide/topics/search/search-dialog.html">Creating a Search Interface.</p></li>
-
+
<li>{@link android.widget.StackView}
<p>A view that displays its children in a 3D stack and allows users to swipe through
views like a rolodex.</p></li>
-
+
</ul>
</li>
-
+
</ul>
@@ -545,7 +545,7 @@
<li><b>View support for hardware and software layers</b>
-
+
<p>By default, a {@link android.view.View} has no layer specified. You can specify that the
view be backed by either a hardware or software layer, specified by values {@link
android.view.View#LAYER_TYPE_HARDWARE} and {@link android.view.View#LAYER_TYPE_SOFTWARE}, using
@@ -563,7 +563,7 @@
<p>For more information, see the {@link android.view.View#LAYER_TYPE_HARDWARE} and {@link
android.view.View#LAYER_TYPE_SOFTWARE} documentation.</p>
</li>
-
+
<li><b>Renderscript 3D graphics engine</b>
@@ -591,7 +591,7 @@
should be captured.</p></li>
<li><b>Texture support for image streams</b>
-
+
<p>New {@link android.graphics.SurfaceTexture} allows you to capture an image stream as an OpenGL ES
texture. By calling {@link android.hardware.Camera#setPreviewTexture setPreviewTexture()} for your
{@link android.hardware.Camera} instance, you can specify the {@link
@@ -599,7 +599,7 @@
camera.</p></li>
<li><b>HTTP Live streaming</b>
-
+
<p>Applications can now pass an M3U playlist URL to the media framework to begin an HTTP Live
streaming session. The media framework supports most of the HTTP Live streaming specification,
including adaptive bit rate. See the <a
@@ -607,7 +607,7 @@
more information.</p></li>
<li><b>EXIF data</b>
-
+
<p>The {@link android.media.ExifInterface} includes new fields for photo aperture, ISO, and exposure
time.</p></li>
@@ -810,7 +810,7 @@
events by calling {@code window.addEventListener} with event type {@code "deviceorientation"}
and register for motion events by registering the {@code "devicemotion"} event type.</p>
</li>
-
+
<li><b>CSS 3D Transforms</b>
<p>As defined by the <a href="http://www.w3.org/TR/css3-3d-transforms/">CSS 3D Transform
Module</a> specification, the Browser allows elements rendered by CSS to be transformed in three
@@ -967,7 +967,7 @@
<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
you need compile the application against the Android library that is provided in
-the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
+the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
attribute to the <code><uses-sdk></code> element in the application's
manifest. If your application is designed to run only on Android 2.3 and higher,
diff --git a/docs/html/about/versions/android-3.1-highlights.jd b/docs/html/about/versions/android-3.1-highlights.jd
index 5283c2a..2a70698 100644
--- a/docs/html/about/versions/android-3.1-highlights.jd
+++ b/docs/html/about/versions/android-3.1-highlights.jd
@@ -93,7 +93,7 @@
<p>The platform also adds new support for USB accessories — external
hardware devices designed to attach to Android-powered devices as USB hosts. When an
accessory is attached, the framework will look for a corresponding application
-and offer to launch it for the user. The accessory can also present a URL
+and offer to launch it for the user. The accessory can also present a URL
to the user, for downloading an appropriate application if one is not already
installed. Users can interact with the application to control powered accessories such
as robotics controllers; docking stations; diagnostic and musical equipment;
@@ -215,7 +215,7 @@
<div style="padding-top:0em;">
<div style="margin-right:1em;float:left;margin-left:0em;"><img src="{@docRoot}sdk/images/3.1/resizeable.png" alt="" width="170" target="_android" style="margin-bottom:0;" />
-<div style="padding-left:1.4em;padding-bottom:1em;width:180px;font-size:.9em"><strong>Figure
+<div style="padding-left:1.4em;padding-bottom:1em;width:180px;font-size:.9em"><strong>Figure
4.</strong> Home screen widgets can now be resized.</div></div>
<p><strong>Calendar</strong></p>
diff --git a/docs/html/about/versions/android-3.1.jd b/docs/html/about/versions/android-3.1.jd
index cdcf51e..e1486be 100644
--- a/docs/html/about/versions/android-3.1.jd
+++ b/docs/html/about/versions/android-3.1.jd
@@ -240,7 +240,7 @@
android.view.MotionEvent#AXIS_HAT_Y}, {@link
android.view.MotionEvent#AXIS_RTRIGGER}, {@link
android.view.MotionEvent#AXIS_ORIENTATION}, {@link
-android.view.MotionEvent#AXIS_THROTTLE}, and many others.
+android.view.MotionEvent#AXIS_THROTTLE}, and many others.
Existing {@link android.view.MotionEvent} axes are represented by {@link
android.view.MotionEvent#AXIS_X}, {@link android.view.MotionEvent#AXIS_Y},
{@link android.view.MotionEvent#AXIS_PRESSURE}, {@link
@@ -299,7 +299,7 @@
<p>Finally, since the motion events from joysticks, gamepads, mice, and
trackballs are not touch events, the platform adds a new callback method for
passing them to a {@link android.view.View} as "generic" motion events.
-Specifically, it reports the non-touch motion events to
+Specifically, it reports the non-touch motion events to
{@link android.view.View}s through a call to {@link
android.view.View#onGenericMotionEvent(android.view.MotionEvent)
onGenericMotionEvent()}, rather than to {@link
@@ -318,7 +318,7 @@
<p class="note">To look at a sample application that uses joystick motion
events, see <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/GameControllerInput.html">GameControllerInput</a>
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/GameControllerInput.html">GameControllerInput</a>
and <a
href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/GameView.html">GameView</a>.</p>
diff --git a/docs/html/about/versions/android-3.2.jd b/docs/html/about/versions/android-3.2.jd
index 887755c..c6df7f5 100644
--- a/docs/html/about/versions/android-3.2.jd
+++ b/docs/html/about/versions/android-3.2.jd
@@ -132,7 +132,7 @@
<ul>
<li>New resource qualifiers for targeting layouts and other resources to a
-minimum smallestWidth, width, or height, and</li>
+minimum smallestWidth, width, or height, and</li>
<li>New manifest attributes, for specifying the app's maximum
screen compatibility range</li>
</ul>
@@ -201,7 +201,7 @@
screen's smallestWidth is constant, regardless of orientation. Examples:
<code>sw320dp</code>, <code>sw720dp</code>, <code>sw720dp</code>.</li>
-<li><code>wNNNdp</code> and <code>hNNNdp</code> — Specifies the minimum
+<li><code>wNNNdp</code> and <code>hNNNdp</code> — Specifies the minimum
width or height on which the resource should be used, measured in "dp" units. As
mentioned above, a screen's width and height are relative to the orientation of
the screen and change whenever the orientation changes. Examples:
@@ -214,7 +214,7 @@
multiple resource configurations are qualified for a given screen, the system
selects the configuration that is the closest match. For precise control over
which resources are loaded on a given screen, you can tag resources with one
-qualifier or combine several new or existing qualifiers.
+qualifier or combine several new or existing qualifiers.
<p>Based on the typical dimensions listed earlier, here are some examples of how
you could use the new qualifiers:</p>
diff --git a/docs/html/about/versions/android-4.0.3.jd b/docs/html/about/versions/android-4.0.3.jd
index 3be684d..bcfa35c 100644
--- a/docs/html/about/versions/android-4.0.3.jd
+++ b/docs/html/about/versions/android-4.0.3.jd
@@ -102,16 +102,16 @@
<li>Adds the class {@link android.provider.CalendarContract.Colors} to represent
a color table in the <a href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar
Provider</a>. The class provides fields for accessing
-colors available for a given account. Colors are referenced by
+colors available for a given account. Colors are referenced by
{@link android.provider.CalendarContract.ColorsColumns#COLOR_KEY COLOR_KEY}
which must be unique for a given account name/type. These values can only be
updated by the sync adapter.</li>
<li>Adds {@link android.provider.CalendarContract.CalendarColumns#ALLOWED_AVAILABILITY ALLOWED_AVAILABILITY}
-and
+and
{@link android.provider.CalendarContract.CalendarColumns#ALLOWED_ATTENDEE_TYPES ALLOWED_ATTENDEE_TYPES}
for exchange/sync support.</li>
<li>Adds {@link android.provider.CalendarContract.AttendeesColumns#TYPE_RESOURCE}
-(such as conference rooms) for attendees and
+(such as conference rooms) for attendees and
{@link android.provider.CalendarContract.EventsColumns#AVAILABILITY_TENTATIVE},
as well as {@link android.provider.CalendarContract.EventsColumns#EVENT_COLOR_KEY}
for events.</li>
@@ -123,7 +123,7 @@
own padding. Instead, the system now automatically adds padding for each widget,
based the characteristics of the current screen. This leads to a more uniform,
consistent presentation of widgets in a grid. To assist applications that host
-home screen widgets, the platform provides a new method
+home screen widgets, the platform provides a new method
{@link android.appwidget.AppWidgetHostView#getDefaultPaddingForWidget(android.content.Context, android.content.ComponentName, android.graphics.Rect)
getDefaultPaddingForWidget()}. Applications can call this method to get the
system-defined padding and account for it when computing the number of cells to
@@ -136,7 +136,7 @@
android.view.textservice.SpellCheckerSession#cancel() cancel()} method cancels
any pending and running spell-checker tasks in a session.</li>
-<li>For spell-checker services, a new suggestions flag,
+<li>For spell-checker services, a new suggestions flag,
{@link android.view.textservice.SuggestionsInfo#RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS},
lets the services distinguish higher-confidence suggestions from
lower-confidence ones. For example, a spell-checker could set the flag if an
@@ -206,8 +206,8 @@
allow apps to get and set the maximum scroll offset for an
{@link android.view.accessibility.AccessibilityRecord} object.</li>
-<li>When touch-exploration mode is enabled, a new secure setting
-{@link android.provider.Settings.Secure#ACCESSIBILITY_SPEAK_PASSWORD}
+<li>When touch-exploration mode is enabled, a new secure setting
+{@link android.provider.Settings.Secure#ACCESSIBILITY_SPEAK_PASSWORD}
indicates whether the user requests the IME to speak text entered in password fields, even when
a headset is not in use. By default, no password text is spoken unless a headset
is in use.</li>
diff --git a/docs/html/about/versions/android-4.0.jd b/docs/html/about/versions/android-4.0.jd
index 4318582..48afcd4 100644
--- a/docs/html/about/versions/android-4.0.jd
+++ b/docs/html/about/versions/android-4.0.jd
@@ -99,7 +99,7 @@
<h4>User Profile</h4>
<p>Android now includes a personal profile that represents the device owner, as defined by the
-{@link android.provider.ContactsContract.Profile} table. Social apps that maintain a user identity
+{@link android.provider.ContactsContract.Profile} table. Social apps that maintain a user identity
can contribute to the user's profile data by creating a new {@link
android.provider.ContactsContract.RawContacts} entry within the {@link
android.provider.ContactsContract.Profile}. That is, raw contacts that represent the device user do
@@ -210,7 +210,7 @@
them when their related events are deleted.</li>
</ul>
-<p>To access a user’s calendar data with the Calendar Provider, your application must request
+<p>To access a user’s calendar data with the Calendar Provider, your application must request
the {@link android.Manifest.permission#READ_CALENDAR} permission (for read access) and
{@link android.Manifest.permission#WRITE_CALENDAR} (for write access).</p>
@@ -850,7 +850,7 @@
event).</li>
<li>From either {@link android.view.accessibility.AccessibilityEvent} or an individual {@link
-android.view.accessibility.AccessibilityRecord}, you can call {@link
+android.view.accessibility.AccessibilityRecord}, you can call {@link
android.view.accessibility.AccessibilityRecord#getSource() getSource()} to retrieve a {@link
android.view.accessibility.AccessibilityNodeInfo} object.
<p>An {@link android.view.accessibility.AccessibilityNodeInfo} represents a single node
diff --git a/docs/html/about/versions/android-4.1.jd b/docs/html/about/versions/android-4.1.jd
index 4131c36..4d7cb85 100644
--- a/docs/html/about/versions/android-4.1.jd
+++ b/docs/html/about/versions/android-4.1.jd
@@ -103,8 +103,8 @@
<div class="sidebox-wrapper">
-<div class="sidebox">
-
+<div class="sidebox">
+
<h3 id="ApiLevel">Declare your app API Level</h3>
<p>To better optimize your app for devices running Android {@sdkPlatformVersion},
@@ -117,7 +117,7 @@
can use APIs in Android {@sdkPlatformVersion} while also supporting older versions by adding
conditions to your code that check for the system API level before executing
APIs not supported by your <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>.
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>.
To learn more about
maintaining backward-compatibility, read <a
href="{@docRoot}training/backward-compatible-ui/index.html">Creating Backward-Compatible
@@ -148,15 +148,15 @@
<h3 id="Isolated">Isolated services</h3>
-<p>By specifying <a href="{@docRoot}guide/topics/manifest/service-element.html#isolated">{@code android:isolatedProcess="true"}</a> in the
+<p>By specifying <a href="{@docRoot}guide/topics/manifest/service-element.html#isolated">{@code android:isolatedProcess="true"}</a> in the
<a href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> tag, your {@link android.app.Service} will run under
its own isolated user ID process that has no permissions of its own.</p>
<h3 id="Memory">Memory management</h3>
-<p>New {@link android.content.ComponentCallbacks2} constants such as {@link
-android.content.ComponentCallbacks2#TRIM_MEMORY_RUNNING_LOW} and {@link
+<p>New {@link android.content.ComponentCallbacks2} constants such as {@link
+android.content.ComponentCallbacks2#TRIM_MEMORY_RUNNING_LOW} and {@link
android.content.ComponentCallbacks2#TRIM_MEMORY_RUNNING_CRITICAL} provide foreground
processes more information about
memory state before the system calls {@link android.app.Activity#onLowMemory()}.</p>
@@ -178,7 +178,7 @@
<h3 id="LiveWallpapers">Live Wallpapers</h3>
<p>New intent protocol to directly launch the live wallpaper preview activity so you can help
- users easily select your live wallpaper without forcing them to leave
+ users easily select your live wallpaper without forcing them to leave
your app and navigate through the Home wallpaper picker.</p>
<p>To launch the live wallpaper picker, call {@link android.content.Context#startActivity
@@ -207,7 +207,7 @@
<p>This is particularly powerful for scenarios in which the user enters one of your app's activities
through a "deep dive" intent such as from a notification or an intent from
-different app (as described in the design guide for <a
+different app (as described in the design guide for <a
href="{@docRoot}design/patterns/navigation.html#between-apps">Navigating Between Apps</a>). When
the user enters your activity this way, your app may not naturally have a back stack of
activities that can be resumed as the user navigates up. However, when you supply the <a
@@ -216,12 +216,12 @@
whether or not your app already contains a back stack of parent activities and, if not, constructs
a synthetic back stack that contains all parent activities.</p>
-<p class="note"><strong>Note:</strong> When the user enters a deep activity in your app and
- it creates a new task for your app, the system actually inserts the stack of parent activities
+<p class="note"><strong>Note:</strong> When the user enters a deep activity in your app and
+ it creates a new task for your app, the system actually inserts the stack of parent activities
into the task. As such, pressing the Back button also navigates back through the stack of parent
activities.</p>
-<p>When the system creates a synthetic back stack for your app, it builds a basic {@link
+<p>When the system creates a synthetic back stack for your app, it builds a basic {@link
android.content.Intent} to create a new instance of each parent activity. So there's no
saved state for the parent activities the way you'd expect had the user naturally navigated
through
@@ -251,9 +251,9 @@
the length of the array with {@link android.app.TaskStackBuilder#getIntentCount()} and pass that
value to {@link android.app.TaskStackBuilder#editIntentAt editIntentAt()}.</p>
-<p>If your app structure is more complex, there are several other APIs
+<p>If your app structure is more complex, there are several other APIs
available that allow you to handle the behavior of Up navigation and
- fully customize the synthetic back stack. Some of the APIs that give you additional
+ fully customize the synthetic back stack. Some of the APIs that give you additional
control include:</p>
<dl>
<dt>{@link android.app.Activity#onNavigateUp}</dt>
@@ -342,7 +342,7 @@
<!--
<h3 id="Routing">Media routing</h3>
-<p>The new {@link android.media.MediaRouter} class allows you to route media channels and
+<p>The new {@link android.media.MediaRouter} class allows you to route media channels and
streams from the current device to external speakers and other devices. You
can acquire an instance of {@link android.media.MediaRouter} by calling {@link
android.content.Context#getSystemService getSystemService(}{@link
@@ -354,7 +354,7 @@
<p>New method {@link android.media.AudioRecord#startRecording startRecording()} allows
you to begin audio recording based on a cue defined by a {@link android.media.MediaSyncEvent}.
-The {@link android.media.MediaSyncEvent} specifies an audio session
+The {@link android.media.MediaSyncEvent} specifies an audio session
(such as one defined by {@link android.media.MediaPlayer}), which when complete, triggers
the audio recorder to begin recording. For example, you can use this functionality to
play an audio tone that indicates the beginning of a recording session and recording
@@ -423,7 +423,7 @@
for changes to the auto focus movement. You can register your interface with {@link
android.hardware.Camera#setAutoFocusMoveCallback setAutoFocusMoveCallback()}. Then when the camera
is in a continuous autofocus mode ({@link
-android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_VIDEO} or
+android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_VIDEO} or
{@link android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_PICTURE}), you'll receive a call
to {@link android.hardware.Camera.AutoFocusMoveCallback#onAutoFocusMoving onAutoFocusMoving()},
which tells you whether auto focus has started moving or has stopped moving.</p>
@@ -434,7 +434,7 @@
standard sounds made by the camera or other media actions. You should use these APIs to play
the appropriate sound when building a custom still or video camera.</p>
-<p>To play a sound, simply instantiate a {@link android.media.MediaActionSound} object, call
+<p>To play a sound, simply instantiate a {@link android.media.MediaActionSound} object, call
{@link android.media.MediaActionSound#load load()} to pre-load the desired sound, then at the
appropriate time, call {@link android.media.MediaActionSound#play play()}.</p>
@@ -483,7 +483,7 @@
<p>To register your service, you must first create an {@link android.net.nsd.NsdServiceInfo}
object and define the various properties of your service with methods such as
- {@link android.net.nsd.NsdServiceInfo#setServiceName setServiceName()},
+ {@link android.net.nsd.NsdServiceInfo#setServiceName setServiceName()},
{@link android.net.nsd.NsdServiceInfo#setServiceType setServiceType()}, and
{@link android.net.nsd.NsdServiceInfo#setPort setPort()}.
</p>
@@ -498,7 +498,7 @@
<p>When your {@link
android.net.nsd.NsdManager.DiscoveryListener} receives callbacks about services
-found, you need to resolve the service by calling
+found, you need to resolve the service by calling
{@link android.net.nsd.NsdManager#resolveService resolveService()}, passing it an
implementation of {@link android.net.nsd.NsdManager.ResolveListener} that receives
an {@link android.net.nsd.NsdServiceInfo} object that contains information about the
@@ -515,13 +515,13 @@
network).</p>
<p>To broadcast your app as a service over Wi-Fi so that other devices can discover
- your app and connect to it, call {@link
+ your app and connect to it, call {@link
android.net.wifi.p2p.WifiP2pManager#addLocalService addLocalService()} with a
{@link android.net.wifi.p2p.nsd.WifiP2pServiceInfo} object that describes your app services.</p>
<p>To initiate discover of nearby devices over Wi-Fi, you need to first decide whether you'll
communicate using Bonjour or Upnp. To use Bonjour, first set up some callback listeners with
- {@link android.net.wifi.p2p.WifiP2pManager#setDnsSdResponseListeners setDnsSdResponseListeners()}, which takes both a {@link android.net.wifi.p2p.WifiP2pManager.DnsSdServiceResponseListener} and {@link android.net.wifi.p2p.WifiP2pManager.DnsSdTxtRecordListener}. To use Upnp, call
+ {@link android.net.wifi.p2p.WifiP2pManager#setDnsSdResponseListeners setDnsSdResponseListeners()}, which takes both a {@link android.net.wifi.p2p.WifiP2pManager.DnsSdServiceResponseListener} and {@link android.net.wifi.p2p.WifiP2pManager.DnsSdTxtRecordListener}. To use Upnp, call
{@link android.net.wifi.p2p.WifiP2pManager#setUpnpServiceResponseListener setUpnpServiceResponseListener()}, which takes a {@link android.net.wifi.p2p.WifiP2pManager.UpnpServiceResponseListener}.</p>
<p>Before you can start discovering services on local devices, you also need to call {@link android.net.wifi.p2p.WifiP2pManager#addServiceRequest addServiceRequest()}. When the {@link android.net.wifi.p2p.WifiP2pManager.ActionListener} you pass to this method receives a
@@ -644,7 +644,7 @@
<h3 id="ActivityOptions">Activity launch animations</h3>
<p>You can now launch an {@link android.app.Activity} using zoom animations or
-your own custom animations. To specify the animation you want, use the {@link
+your own custom animations. To specify the animation you want, use the {@link
android.app.ActivityOptions} APIs to build a {@link android.os.Bundle} that you can
then pass to any of the
methods that start an activity, such as {@link
@@ -659,8 +659,8 @@
Android 4.1 uses this when opening an app.</dd>
<dt>{@link android.app.ActivityOptions#makeThumbnailScaleUpAnimation
makeThumbnailScaleUpAnimation()}</dt>
- <dd>Creates an animation that scales up the activity window starting from a specified
- position and a provided thumbnail image. For example, the Recent Apps window in
+ <dd>Creates an animation that scales up the activity window starting from a specified
+ position and a provided thumbnail image. For example, the Recent Apps window in
Android 4.1 uses this when returning to an app.</dd>
<dt>{@link android.app.ActivityOptions#makeCustomAnimation
makeCustomAnimation()}</dt>
@@ -672,7 +672,7 @@
<h3 id="TimeAnimator">Time animator</h3>
-<p>The new {@link android.animation.TimeAnimator} provides a simple callback
+<p>The new {@link android.animation.TimeAnimator} provides a simple callback
mechanism with the {@link android.animation.TimeAnimator.TimeListener} that notifies
you upon every frame of the animation. There is no duration, interpolation, or object value-setting with this Animator. The listener's callback receives information for each frame including
total elapsed time and the elapsed time since the previous animation frame.</p>
@@ -692,7 +692,7 @@
<p>The new method {@link android.app.Notification.Builder#setStyle setStyle()} allows you to specify
one of three new styles for your notification that each offer a larger content region. To
-specify the style for your large content region, pass {@link
+specify the style for your large content region, pass {@link
android.app.Notification.Builder#setStyle setStyle()} one of the following objects:</p>
<dl>
<dt>{@link android.app.Notification.BigPictureStyle}</dt>
@@ -720,7 +720,7 @@
order of your notification in the list by setting
the priority with {@link android.app.Notification.Builder#setPriority setPriority()}. You
can pass this one of five different priority levels defined by {@code PRIORITY_*} constants
-in the {@link android.app.Notification} class. The default is {@link
+in the {@link android.app.Notification} class. The default is {@link
android.app.Notification#PRIORITY_DEFAULT}, and there's two levels higher and two levels lower.</p>
<p>High priority notifications are things that users generally want to respond to quickly,
@@ -738,17 +738,17 @@
<dl>
<dt>{@link android.view.View#SYSTEM_UI_FLAG_FULLSCREEN}</dt>
- <dd>Hides non-critical system UI (such as the status bar).
+ <dd>Hides non-critical system UI (such as the status bar).
If your activity uses the action bar in overlay mode (by
enabling <a href="{@docRoot}reference/android/R.attr.html#windowActionBarOverlay">{@code
android:windowActionBarOverlay}</a>), then this flag also hides the action bar and does
so with a coordinated animation when both hiding and showing the two.</dd>
-
+
<dt>{@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}</dt>
<dd>Sets your activity layout to use the same screen area that's available when you've
enabled {@link android.view.View#SYSTEM_UI_FLAG_FULLSCREEN} even if the system UI elements
are still visible. Although parts of your layout will be overlayed by the
- system UI, this is useful if your app often hides and shows the system UI with
+ system UI, this is useful if your app often hides and shows the system UI with
{@link android.view.View#SYSTEM_UI_FLAG_FULLSCREEN}, because it avoids your layout from
adjusting to the new layout bounds each time the system UI hides or appears.</dd>
@@ -779,7 +779,7 @@
<h3 id="RemoteViews">Remote views</h3>
-<p>{@link android.widget.GridLayout} and {@link android.view.ViewStub}
+<p>{@link android.widget.GridLayout} and {@link android.view.ViewStub}
are now remotable views so you can use them in layouts for your
app widgets and notification custom layouts.</p>
@@ -787,7 +787,7 @@
<h3 id="Fonts">Font families</h3>
-<p>Android 4.1 adds several more variants of the Roboto font style for a total of 10 variants,
+<p>Android 4.1 adds several more variants of the Roboto font style for a total of 10 variants,
and they're all usable by apps. Your apps now have access to the full set of both light and
condensed variants.</p>
@@ -820,14 +820,14 @@
{@code "bold"} and {@code "italic"}. You can apply both like so: {@code
android:textStyle="bold|italic"}.</p>
-<p>You can also use {@link android.graphics.Typeface#create Typeface.create()}.
+<p>You can also use {@link android.graphics.Typeface#create Typeface.create()}.
For example, {@code Typeface.create("sans-serif-light", Typeface.NORMAL)}.</p>
-
+
<h2 id="Input">Input Framework</h2>
@@ -864,7 +864,7 @@
<dl>
<dt>{@link android.Manifest.permission#READ_EXTERNAL_STORAGE}</dt>
- <dd>Provides protected read access to external storage. In Android 4.1 by
+ <dd>Provides protected read access to external storage. In Android 4.1 by
default all applications still have read
access. This will be changed in a future release to require that applications explicitly request
read access using this permission. If your application already requests write access, it will
@@ -898,9 +898,9 @@
</manifest>
</pre>
-<p>This feature defines "television" to be a typical living room television experience:
- displayed on a big screen, where the user is sitting far away and the dominant form of
- input is be something like a d-pad, and generally not through touch or a
+<p>This feature defines "television" to be a typical living room television experience:
+ displayed on a big screen, where the user is sitting far away and the dominant form of
+ input is be something like a d-pad, and generally not through touch or a
mouse/pointer-device.</p>
diff --git a/docs/html/about/versions/android-4.2.jd b/docs/html/about/versions/android-4.2.jd
index c26d4a2..34fa1d4 100755
--- a/docs/html/about/versions/android-4.2.jd
+++ b/docs/html/about/versions/android-4.2.jd
@@ -6,7 +6,7 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>In this document</h2>
<ol>
<li><a href="#Behaviors">Important Behavior Changes</a></li>
@@ -46,8 +46,8 @@
<div class="sidebox-wrapper">
-<div class="sidebox">
-
+<div class="sidebox">
+
<h3 id="ApiLevel">Declare your app API Level</h3>
<p>To better optimize your app for devices running Android {@sdkPlatformVersion},
@@ -60,7 +60,7 @@
can use APIs in Android {@sdkPlatformVersion} while also supporting older versions by adding
conditions to your code that check for the system API level before executing
APIs not supported by your <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>.
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>.
To learn more about
maintaining backward-compatibility, read <a
href="{@docRoot}training/backward-compatible-ui/index.html">Creating Backward-Compatible
@@ -94,7 +94,7 @@
android:minSdkVersion}</a> to 17 or higher. Otherwise, the default value is still {@code “true"}
even when running on Android 4.2 and higher.</p>
</li>
-
+
<li>Compared to previous versions of Android, <b>user location</b> results may be less accurate
if your app requests the {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} permission but
does not request the {@link android.Manifest.permission#ACCESS_FINE_LOCATION} permission.
@@ -102,7 +102,7 @@
coarse location (and not fine location), the system will not provide a user location estimate
that’s more accurate than a city block.</p>
</li>
-
+
<li>Some <b>device settings</b> defined by {@link android.provider.Settings.System} are now
read-only. If your app attempts to write changes to settings defined in {@link
android.provider.Settings.System} that have moved to {@link android.provider.Settings.Global},
@@ -410,7 +410,7 @@
<ol>
<li>Convert left- and right-oriented layout properties to start- and end-oriented layout
-properties.
+properties.
<p>For example, use {@link android.R.attr#layout_marginStart android:layout_marginStart}
in place of {@code android:layout_marginLeft} and {@link android.R.attr#layout_marginEnd
android:layout_marginEnd} in place of {@code android:layout_marginRight}.
@@ -526,7 +526,7 @@
scripts by calling {@link android.renderscript.ScriptGroup.Builder#addConnection addConnection()}.
When you are done adding the connections, call {@link android.renderscript.ScriptGroup.Builder#create create()}
to create the script group. Before executing the script group, specify the input
-{@link android.renderscript.Allocation} and initial script to run with the
+{@link android.renderscript.Allocation} and initial script to run with the
{@link android.renderscript.ScriptGroup#setInput} method and provide the output
{@link android.renderscript.Allocation} where the result will be written to and final script to
run with {@link android.renderscript.ScriptGroup#setOutput setOutput()}. Finally, call
diff --git a/docs/html/about/versions/android-4.4.jd b/docs/html/about/versions/android-4.4.jd
index b898fe3..cbc8e6e 100644
--- a/docs/html/about/versions/android-4.4.jd
+++ b/docs/html/about/versions/android-4.4.jd
@@ -318,7 +318,7 @@
<h3 id="Ratings">Ratings from remote controllers</h3>
-<p>Android 4.4 builds upon the existing capabilities for remote control clients (apps that receive media control events with the {@link android.media.RemoteControlClient}) by adding the ability for users to rate the current track from the remote controller.</p>
+<p>Android 4.4 builds upon the existing capabilities for remote control clients (apps that receive media control events with the {@link android.media.RemoteControlClient}) by adding the ability for users to rate the current track from the remote controller.</p>
<p>The new {@link android.media.Rating} class encapsulates information about a user rating. A rating is defined by its rating style (either {@link android.media.Rating#RATING_HEART}, {@link android.media.Rating#RATING_THUMB_UP_DOWN}, {@link android.media.Rating#RATING_3_STARS}, {@link android.media.Rating#RATING_4_STARS}, {@link android.media.Rating#RATING_5_STARS} or {@link android.media.Rating#RATING_PERCENTAGE}) and the rating value that's appropriate for that style.</p>
diff --git a/docs/html/about/versions/jelly-bean.jd b/docs/html/about/versions/jelly-bean.jd
index 25f88e3..82cac2b 100644
--- a/docs/html/about/versions/jelly-bean.jd
+++ b/docs/html/about/versions/jelly-bean.jd
@@ -21,13 +21,13 @@
link = $("#title-tabs a[href$="+sectionId+"]");
link.parent().addClass("selected");
link.parent().siblings().removeClass("selected");
-
+
sectionDiv = $(".version-section"+link.attr("href"));
if (sectionDiv.length) {
$(".version-section").hide();
sectionDiv.show();
}
-
+
$('html, body').animate({
scrollTop: $(hashy).offset().top
}, 100);
@@ -672,7 +672,7 @@
<div style="float:left;margin:16px 24px 12px 0px;">
<a href="" target="_android">
<img src="{@docRoot}images/jb-nexus10-1.png" alt="10-inch tablet running Android 4.2" width="380" height="281" /></a>
-</div>
+</div>
<h2 id="42-ui" style="margin-top:2em;">Refined, refreshed UI</h2>
@@ -902,7 +902,7 @@
appropriate.</p>
<p>For precise control over your app UI, Android 4.2 includes new APIs that let
-you manage layout direction, text direction, text alignment, gravity, and
+you manage layout direction, text direction, text alignment, gravity, and
locale direction in View components. You can even create custom versions of
layout, drawables, and other resources for display when a right-to-left script
is in use.</p>
@@ -1005,7 +1005,7 @@
<p>Filterscript is ideal for hardware-accelerating simple image-processing and
computation operations such as those that might be written for OpenGL ES
fragment shaders. Because it places a relaxed set of constraints on hardware,
-your operations are optimized and accelerated on more types of device chipsets.
+your operations are optimized and accelerated on more types of device chipsets.
Any app targeting API level 17 or higher can make use of Filterscript.</p>
<h3 id="42-rs-intrinsics">Script intrinsics</h3>
@@ -1028,7 +1028,7 @@
<div style="float:right;padding-top:1em;width:400px;margin-left:2em;">
<img src="{@docRoot}images/jb-rs-chart-versions.png" alt="Renderscipt optimizations chart" width="360" height="252"
style="border:1px solid #ddd;border-radius: 6px;" />
-<p style="image-caption">Renderscript image-processing
+<p style="image-caption">Renderscript image-processing
benchmarks run on different Android platform versions (Android 4.0, 4.1, and 4.2)
in CPU only on a Galaxy Nexus device.</p>
<img src="{@docRoot}images/jb-rs-chart-gpu.png" style="border:1px solid #ddd;border-radius: 6px; alt="" width="360" height="252" />
@@ -1143,7 +1143,7 @@
certificates. This protects against possible compromise of Certificate
Authorities.</li>
<li><strong>Improved display of Android permissions</strong> — Permissions
-have been organized into groups that are more easily understood by users.
+have been organized into groups that are more easily understood by users.
During review of the permissions, the user can click on the permission to see
more detailed information about the permission.</li>
<li><strong>installd hardening</strong> — The installd daemon does not run
@@ -1196,7 +1196,7 @@
Android 4.2 introduces support for controllers based on the NCI standard from
the NFC-Forum. NCI provides a standard communication protocol between an NFC
Controller (NFCC) and a device Host, and the new NFC stack developed in
-collaboration between Google and Broadcom supports it.
+collaboration between Google and Broadcom supports it.
<h3 id="42-dalvik">Dalvik runtime optimizations</h3>
@@ -1248,7 +1248,7 @@
</div>
<p>Welcome to Android 4.1 the first version of Jelly Bean!</p>
-<p>Android 4.1 is the fastest and smoothest version of Android yet. We’ve made
+<p>Android 4.1 is the fastest and smoothest version of Android yet. We’ve made
improvements throughout the platform and added great new features
for users and developers. This document provides a glimpse of what's new for developers.
@@ -1552,7 +1552,7 @@
<h3 id="gps">Google Play services</h3>
-<p>Google Play services helps developers to <strong>integrate Google services</strong> such as authentication and Google+ into their apps delivered through Google Play.</p>
+<p>Google Play services helps developers to <strong>integrate Google services</strong> such as authentication and Google+ into their apps delivered through Google Play.</p>
<p>Google Play services is automatically provisioned to end user devices by Google Play, so all you need is a <strong>thin client library</strong> in your apps.</p>
diff --git a/docs/html/about/versions/kitkat.jd b/docs/html/about/versions/kitkat.jd
index 2987bd4..b73e70d 100644
--- a/docs/html/about/versions/kitkat.jd
+++ b/docs/html/about/versions/kitkat.jd
@@ -13,13 +13,13 @@
link = $("#title-tabs a[href$="+sectionId+"]");
link.parent().addClass("selected");
link.parent().siblings().removeClass("selected");
-
+
sectionDiv = $(".version-section"+link.attr("href"));
if (sectionDiv.length) {
$(".version-section").hide();
sectionDiv.show();
}
-
+
$('html, body').animate({
scrollTop: $(hashy).offset().top
}, 100);
diff --git a/docs/html/auto/index.jd b/docs/html/auto/index.jd
index 5b67641..8680df0 100644
--- a/docs/html/auto/index.jd
+++ b/docs/html/auto/index.jd
@@ -568,7 +568,7 @@
width="120" height="120" class="img-logo" />
</a>
</div>
-
+
<div class="col-5">
<a href="http://www.ramtrucks.com/">
<img src="{@docRoot}auto/images/logos/auto/ram.png"
@@ -590,7 +590,7 @@
width="120" height="120" class="img-logo" />
</a>
</div>
-
+
<div class="col-5">
<a href="http://www.seat.com/">
<img src="{@docRoot}auto/images/logos/auto/seat.png"
@@ -604,7 +604,7 @@
width="120" height="120" class="img-logo" />
</a>
</div>
-
+
<div class="col-5">
<a href="http://www.smotor.com/">
<img src="{@docRoot}auto/images/logos/auto/ssangyong.png"
@@ -626,7 +626,7 @@
width="120" height="120" class="img-logo" />
</a>
</div>
-
+
<div class="col-5">
<a href="http://www.tatamotors.com/">
<img src="{@docRoot}auto/images/logos/auto/tata.png"
@@ -648,8 +648,8 @@
width="120" height="120" class="img-logo" />
</a>
</div>
-
-
+
+
<div class="col-5">
<a href="http://www.volvocars.com/intl">
<img src="{@docRoot}auto/images/logos/auto/volvo.png"
diff --git a/docs/html/design/index.jd b/docs/html/design/index.jd
index b4e909f..1a0c125 100644
--- a/docs/html/design/index.jd
+++ b/docs/html/design/index.jd
@@ -18,7 +18,7 @@
<h1 class="dac-hero-title">Up and running with material design</h1>
<p class="dac-hero-description">
Android uses a new design metaphor inspired by paper and ink that provides a reassuring
- sense of tactility. Visit the <a href="https://www.google.com/design/spec/material-design/introduction.html">material design</a> site for more resources.
+ sense of tactility. Visit the <a href="https://www.google.com/design/spec/material-design/introduction.html">material design</a> site for more resources.
</p>
<a class="dac-hero-cta" href="https://www.google.com/design/spec/material-design/introduction.html">
<span class="dac-sprite dac-auto-chevron"></span>
diff --git a/docs/html/design/patterns/help.jd b/docs/html/design/patterns/help.jd
index 6ef155a..b5ee05e 100644
--- a/docs/html/design/patterns/help.jd
+++ b/docs/html/design/patterns/help.jd
@@ -76,7 +76,7 @@
</div>
<div class="col-5">
<img src="{@docRoot}design/media/help_evenbetter.png">
- </div>
+ </div>
</div>
<div class="cols">
diff --git a/docs/html/distribute/analyze/build-better-apps.jd b/docs/html/distribute/analyze/build-better-apps.jd
index 823562a..d0db392 100644
--- a/docs/html/distribute/analyze/build-better-apps.jd
+++ b/docs/html/distribute/analyze/build-better-apps.jd
@@ -108,7 +108,7 @@
</h2>
</div>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/analyzebuild"
data-sortorder="-timestamp"
data-cardsizes="6x3"
diff --git a/docs/html/distribute/analyze/google-services.jd b/docs/html/distribute/analyze/google-services.jd
index 0d82c8a..44eed8e 100644
--- a/docs/html/distribute/analyze/google-services.jd
+++ b/docs/html/distribute/analyze/google-services.jd
@@ -109,7 +109,7 @@
</h2>
</div>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/analyzeact"
data-sortorder="-timestamp"
data-cardsizes="6x3"
diff --git a/docs/html/distribute/analyze/improve-roi.jd b/docs/html/distribute/analyze/improve-roi.jd
index 6c05962..95c4db5 100644
--- a/docs/html/distribute/analyze/improve-roi.jd
+++ b/docs/html/distribute/analyze/improve-roi.jd
@@ -155,7 +155,7 @@
</h2>
</div>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/analyzeimprove"
data-sortorder="-timestamp"
data-cardsizes="6x3"
diff --git a/docs/html/distribute/analyze/measure.jd b/docs/html/distribute/analyze/measure.jd
index 5b29e95..4cb9bde 100644
--- a/docs/html/distribute/analyze/measure.jd
+++ b/docs/html/distribute/analyze/measure.jd
@@ -82,7 +82,7 @@
<li>Analyze how far shoppers get in the shopping funnel and where they drop
off</li>
<li>Understand which products are viewed most, which are frequently abandoned
-in cart, and which ones convert well</li>
+in cart, and which ones convert well</li>
<li>Upload rich product metadata to slice and dice your data</li>
<li>Create rich user segments to delve deeper into your users’ shopping
behavior and the products they interact with</li>
diff --git a/docs/html/distribute/analyze/start.jd b/docs/html/distribute/analyze/start.jd
index 0221f72..0a90b4f 100644
--- a/docs/html/distribute/analyze/start.jd
+++ b/docs/html/distribute/analyze/start.jd
@@ -36,7 +36,7 @@
<li><a href="https://accounts.google.com/SignUp?continue=https%3A%2F%2Fwww.google.com%2Fanalytics%2Fmobile%2F&hl=en">Create
your Google Analytics account</a>.</li>
<li>Write down your tracking ID. </li>
-<li>Initialize Google Analytics in your app to start measuring activity immediately.</li>
+<li>Initialize Google Analytics in your app to start measuring activity immediately.</li>
</ul>
<p>
@@ -97,7 +97,7 @@
</h2>
</div>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/analyzestart"
data-sortorder="-timestamp"
data-cardsizes="6x3"
diff --git a/docs/html/distribute/analyze/understand-user-value.jd b/docs/html/distribute/analyze/understand-user-value.jd
index 99fd11a..6bc192d 100644
--- a/docs/html/distribute/analyze/understand-user-value.jd
+++ b/docs/html/distribute/analyze/understand-user-value.jd
@@ -45,7 +45,7 @@
</p>
-<h2 id="audiencereporting">Know your users with Audience Reporting and Demographic
+<h2 id="audiencereporting">Know your users with Audience Reporting and Demographic
and Interest reports</h2>
<p>
@@ -230,7 +230,7 @@
</h2>
</div>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/analyzeunderstand"
data-sortorder="-timestamp"
data-cardsizes="6x3"
diff --git a/docs/html/distribute/engage/ads.jd b/docs/html/distribute/engage/ads.jd
index 10dbea6..8cfbdf2 100644
--- a/docs/html/distribute/engage/ads.jd
+++ b/docs/html/distribute/engage/ads.jd
@@ -54,7 +54,7 @@
<h2 id="related_resources">Related resources</h2>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/engage/reengage"
data-sortorder="-timestamp"
data-cardsizes="9x3"
diff --git a/docs/html/distribute/engage/analytics.jd b/docs/html/distribute/engage/analytics.jd
index 5f7cade..0343def 100644
--- a/docs/html/distribute/engage/analytics.jd
+++ b/docs/html/distribute/engage/analytics.jd
@@ -42,7 +42,7 @@
</h2>
</div>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/engage/analytics"
data-sortorder="-timestamp"
data-cardsizes="9x3"
diff --git a/docs/html/distribute/engage/deep-linking.jd b/docs/html/distribute/engage/deep-linking.jd
index 713bfbb..510fa5c 100644
--- a/docs/html/distribute/engage/deep-linking.jd
+++ b/docs/html/distribute/engage/deep-linking.jd
@@ -8,7 +8,7 @@
Users who have your app installed might overlook it as a way to get the answers
they need. With App Indexing, deep links to your Android app appear in Google Search
results so users can get to your native mobile experience quickly, landing exactly
- on the right content within the app.
+ on the right content within the app.
</p>
<p>
diff --git a/docs/html/distribute/engage/gcm.jd b/docs/html/distribute/engage/gcm.jd
index 55bd40a..9fa9d5f 100644
--- a/docs/html/distribute/engage/gcm.jd
+++ b/docs/html/distribute/engage/gcm.jd
@@ -43,7 +43,7 @@
</div>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/engage/gcm"
data-sortorder="-timestamp"
data-cardsizes="9x3"
diff --git a/docs/html/distribute/engage/intents.jd b/docs/html/distribute/engage/intents.jd
index 07791e8..33ed125 100644
--- a/docs/html/distribute/engage/intents.jd
+++ b/docs/html/distribute/engage/intents.jd
@@ -1,5 +1,5 @@
page.title=Increase Usage with Android Intents
-page.metaDescription=Use Android Intents to make your app available to users as they perform tasks in other apps.
+page.metaDescription=Use Android Intents to make your app available to users as they perform tasks in other apps.
page.tags="engagement, intents"
@jd:body
diff --git a/docs/html/distribute/engage/notifications.jd b/docs/html/distribute/engage/notifications.jd
index 1aa0637..c38f649 100644
--- a/docs/html/distribute/engage/notifications.jd
+++ b/docs/html/distribute/engage/notifications.jd
@@ -51,7 +51,7 @@
</h2>
</div>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/getusers/notifications"
data-sortorder="-timestamp"
data-cardsizes="9x3"
diff --git a/docs/html/distribute/engage/video.jd b/docs/html/distribute/engage/video.jd
index c5a4997..cf06ce0 100644
--- a/docs/html/distribute/engage/video.jd
+++ b/docs/html/distribute/engage/video.jd
@@ -1,5 +1,5 @@
page.title=Delight Users with Videos
-page.metaDescription=Videos are one of the most effective ways to get users excited about your apps.
+page.metaDescription=Videos are one of the most effective ways to get users excited about your apps.
page.tags="engagement"
page.image=/images/gp-engage-smule.jpg
diff --git a/docs/html/distribute/engage/widgets.jd b/docs/html/distribute/engage/widgets.jd
index 6adb55c..a6623ba 100644
--- a/docs/html/distribute/engage/widgets.jd
+++ b/docs/html/distribute/engage/widgets.jd
@@ -37,7 +37,7 @@
</h2>
</div>
-<div class="resource-widget resource-flow-layout col-13"
+<div class="resource-widget resource-flow-layout col-13"
data-query="collection:distribute/engage/widgets"
data-sortorder="-timestamp"
data-cardsizes="9x3"
diff --git a/docs/html/distribute/essentials/optimizing-your-app.jd b/docs/html/distribute/essentials/optimizing-your-app.jd
index 696ef53..09c52d4 100644
--- a/docs/html/distribute/essentials/optimizing-your-app.jd
+++ b/docs/html/distribute/essentials/optimizing-your-app.jd
@@ -4,7 +4,7 @@
@jd:body
-<div id="qv-wrapper">
+<div id="qv-wrapper">
<div id="qv">
<h2>Strategies</h2>
<ol>
diff --git a/docs/html/distribute/essentials/quality/billions.jd b/docs/html/distribute/essentials/quality/billions.jd
index 7042143..2e14b37 100644
--- a/docs/html/distribute/essentials/quality/billions.jd
+++ b/docs/html/distribute/essentials/quality/billions.jd
@@ -1,5 +1,5 @@
page.title=Building for Billions
-page.metaDescription=Best practices on how to optimize Android apps for low- and no-bandwidth and low-cost devices.
+page.metaDescription=Best practices on how to optimize Android apps for low- and no-bandwidth and low-cost devices.
page.image=/distribute/images/billions-guidelines.png
@jd:body
@@ -18,7 +18,7 @@
<li><a href="#compatibility">Backward compatibility</a></li>
<li><a href="#memory">Efficient memory usage</a></li>
</ol>
-
+
<h2><a href="#cost">Data Cost</a></h2>
<ol>
<li><a href="#appsize">Reduce app size</a></li>
@@ -42,14 +42,14 @@
<!-- intro -->
<p>Internet use—and smartphone penetration—is growing fastest in markets with
- low, intermittent, or expensive connectivity. Successful apps in these
- markets need to perform across a variety of speeds and devices, as well as
+ low, intermittent, or expensive connectivity. Successful apps in these
+ markets need to perform across a variety of speeds and devices, as well as
conserve and share information about battery and data consumption.</p>
<p>To help you address these important considerations, we’ve compiled the
- following checklist. These do not follow a particular order, and as
- always it's a good idea to research particularities of any market or country
- you're targeting.
+ following checklist. These do not follow a particular order, and as
+ always it's a good idea to research particularities of any market or country
+ you're targeting.
</p>
<!-- connectivity -->
@@ -67,40 +67,40 @@
<h4 id="images-format">Serve WebP images</h4>
<ul>
<li>Serve <a
- href="https://developers.google.com/speed/webp/">WebP</a> files over the
- network. WebP reduces image load times, saves network bandwidth, and often
- results in smaller file sizes than its PNG and JPG counterparts, with at
- least the same image quality. Even at lossy settings, WebP can produce a
- nearly identical image. Android has had lossy <a
- href="{@docRoot}guide/appendix/media-formats.html">WebP support</a> since
- Android 4.0 (API level 14: Ice Cream Sandwich) and support for lossless /
+ href="https://developers.google.com/speed/webp/">WebP</a> files over the
+ network. WebP reduces image load times, saves network bandwidth, and often
+ results in smaller file sizes than its PNG and JPG counterparts, with at
+ least the same image quality. Even at lossy settings, WebP can produce a
+ nearly identical image. Android has had lossy <a
+ href="{@docRoot}guide/appendix/media-formats.html">WebP support</a> since
+ Android 4.0 (API level 14: Ice Cream Sandwich) and support for lossless /
transparent WebP since Android 4.2 (API level 17: Jelly Bean).</li>
</ul>
<h4 id="images-sizing">Dynamic image sizing</h4>
<ul>
<li>Have your apps request images at the targeted rendering size, and have
- your server provide those images to fit; the target rendering size will
- vary based on device specifications. Doing this minimizes the network
- overhead and reduces the amount of memory needed to hold each image,
+ your server provide those images to fit; the target rendering size will
+ vary based on device specifications. Doing this minimizes the network
+ overhead and reduces the amount of memory needed to hold each image,
resulting in improved performance and user satisfaction.</li>
<li>Your user experience degrades when users are waiting for images to
- download. Using appropriate image sizes helps to address these issues.
- Consider making image size requests based on network type or network
+ download. Using appropriate image sizes helps to address these issues.
+ Consider making image size requests based on network type or network
quality; this size could be smaller than the target rendering size.</li>
<li>Dynamic placeholders like <a
href="{@docRoot}reference/android/support/v7/graphics/Palette.html">
- pre-computed palette values</a> or low-resolution thumbnails can improve
+ pre-computed palette values</a> or low-resolution thumbnails can improve
the user experience while the image is being fetched.</li>
</ul>
<h4 id="images-libraries">Use image loading libraries</h4>
<ul>
<li>Your app should not have to fetch any image more than once. Image
- loading libraries such as <a class="external-link"
- href="https://github.com/bumptech/glide">Glide</a> and <a
- class="external-link" href="http://square.github.io/picasso/">Picasso</a>
- fetch the image, cache it, and provide hooks into your Views to show
- placeholder images until the actual images are ready. Because images are
- cached, these libraries return the local copy the next time they are
+ loading libraries such as <a class="external-link"
+ href="https://github.com/bumptech/glide">Glide</a> and <a
+ class="external-link" href="http://square.github.io/picasso/">Picasso</a>
+ fetch the image, cache it, and provide hooks into your Views to show
+ placeholder images until the actual images are ready. Because images are
+ cached, these libraries return the local copy the next time they are
requested.</li>
<li>Image-loading libraries manage their cache, holding onto the most recent
images so that your app storage doesn’t grow indefinitely.</li>
@@ -110,59 +110,59 @@
<h4 id="network-offline">Make your app usable offline</h4>
<ul>
<li>In places like subways, planes, elevators, and parking garages, it is
- common for devices to lose network connectivity. Creating a useful offline
- state results in users being able to interact with the app at all times, by
- presenting cached information. Ensure that your app is usable offline or
- when network connectivity is poor by storing data locally, caching data,
+ common for devices to lose network connectivity. Creating a useful offline
+ state results in users being able to interact with the app at all times, by
+ presenting cached information. Ensure that your app is usable offline or
+ when network connectivity is poor by storing data locally, caching data,
and queuing outbound requests for when connectivity is restored.</li>
<li>Where possible, apps should not notify users that connectivity has
- been lost. It is only when the user performs an operation where connectivity
+ been lost. It is only when the user performs an operation where connectivity
is essential that the user needs to be notified.</li>
<li>When a device lacks connectivity, your app should batch up network
- requests—on behalf of the user—that can be executed when
- connectivity is restored. An example of this is an email client that allows
- users to compose, send, read, move, and delete existing mails even when the
- device is offline. These operations can be cached and executed when
- connectivity is restored. In doing so, the app is able to provide a similar
+ requests—on behalf of the user—that can be executed when
+ connectivity is restored. An example of this is an email client that allows
+ users to compose, send, read, move, and delete existing mails even when the
+ device is offline. These operations can be cached and executed when
+ connectivity is restored. In doing so, the app is able to provide a similar
user experience whether the device is online or offline.</li>
</ul>
<h4 id="network-arch">Use GcmNetworkManager and/or Content Providers</h4>
<ul>
<li>Ensure that your app stores all data on disk via a database or similar
- structure so that it performs optimally regardless of network conditions
- (for example, via SQLite + ContentProvider). The <a
+ structure so that it performs optimally regardless of network conditions
+ (for example, via SQLite + ContentProvider). The <a
href="https://developers.google.com/cloud-messaging/network-manager">
- GCM Network Manager</a>
+ GCM Network Manager</a>
(<a href="https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmNetworkManager">
- <code>GcmNetworkManager</code></a>) can result in a robust mechanism to
- sync data with servers while <a
- href="{@docRoot}guide/topics/providers/content-providers.html">content
- providers</a> ({@link android.content.ContentProvider}) cache that data,
+ <code>GcmNetworkManager</code></a>) can result in a robust mechanism to
+ sync data with servers while <a
+ href="{@docRoot}guide/topics/providers/content-providers.html">content
+ providers</a> ({@link android.content.ContentProvider}) cache that data,
combining to provide an architecture that enables a useful offline state.</li>
<li>Apps should cache content that is fetched from the network. Before making
- subsequent requests, apps should display locally cached data. This ensures
- that the app is functional regardless of whether the device is offline or
+ subsequent requests, apps should display locally cached data. This ensures
+ that the app is functional regardless of whether the device is offline or
on a slow/unreliable network.</li>
</ul>
<h4 id="network-duplicate">Deduplicate network requests</h4>
<ul>
<li>An offline-first architecture initially tries to fetch data from local
- storage and, failing that, requests the data from the network. After being
- retrieved from the network, the data is cached locally for future
- retrieval. This helps to ensure that network requests for the same piece of
- data only occur once—the rest of the requests are satisfied locally. To
- achieve this, use a local database for long-lived data (usually
- {@link android.database.sqlite} or
+ storage and, failing that, requests the data from the network. After being
+ retrieved from the network, the data is cached locally for future
+ retrieval. This helps to ensure that network requests for the same piece of
+ data only occur once—the rest of the requests are satisfied locally. To
+ achieve this, use a local database for long-lived data (usually
+ {@link android.database.sqlite} or
{@link android.content.SharedPreferences}).</li>
<li>An offline-first architecture always looks for data locally first, then
- makes the request over the network. The response is cached and then returned
- locally. Such an architecture simplifies an app’s flow between offline and
- online states as one side fetches from the network to the cache, while the
+ makes the request over the network. The response is cached and then returned
+ locally. Such an architecture simplifies an app’s flow between offline and
+ online states as one side fetches from the network to the cache, while the
other retrieves data from the cache to present to the user.</li>
<li>For transitory data, use a bounded disk cache such as a <a class="external-link"
href="https://github.com/JakeWharton/DiskLruCache"><code>DiskLruCache</code>
- </a>. Data that doesn’t typically change should only be requested once over
- the network and cached for future use. Examples of such data are images and
+ </a>. Data that doesn’t typically change should only be requested once over
+ the network and cached for future use. Examples of such data are images and
non-temporal documents like news articles or social posts.</li>
</ul>
@@ -170,29 +170,29 @@
<h4 id="transfer-prioritize">Prioritize bandwidth</h4>
<ul>
<li>Writers of apps should not assume that any network that the device is
- connected to is long-lasting or reliable. For this reason, apps should
- prioritize network requests to display the most useful information to the
+ connected to is long-lasting or reliable. For this reason, apps should
+ prioritize network requests to display the most useful information to the
user as soon as possible.</li>
<li>Presenting users with visible and relevant information immediately is a
- better user experience than making them wait for information that might not
- be necessary. This reduces the time that the user has to wait and
+ better user experience than making them wait for information that might not
+ be necessary. This reduces the time that the user has to wait and
increases the usefulness of the app on slow networks.</li>
<li>To achieve this, sequence your network requests such that text is
- fetched before rich media. Text requests tend to be smaller, compress
- better, and hence transfer faster, meaning that your app can display useful
- content quickly. For more information on managing network requests, visit
- the Android training on <a
- href="{@docRoot}training/basics/network-ops/managing.html">Managing Network
+ fetched before rich media. Text requests tend to be smaller, compress
+ better, and hence transfer faster, meaning that your app can display useful
+ content quickly. For more information on managing network requests, visit
+ the Android training on <a
+ href="{@docRoot}training/basics/network-ops/managing.html">Managing Network
Usage</a>.</li>
</ul>
<h4 id="network-bandwidth">Use less bandwidth on slower connections</h4>
<ul>
<li>The ability for your app to transfer data in a timely fashion is
- dependent on the network connection. Detecting the quality of the network
- and adjusting the way your app uses it can help provide an excellent user
+ dependent on the network connection. Detecting the quality of the network
+ and adjusting the way your app uses it can help provide an excellent user
experience.</li>
<li>You can use the following methods to detect the underlying network
- quality. Using the data from these methods, your app should tailor its use
+ quality. Using the data from these methods, your app should tailor its use
of the network to continue to provide a timely response to user actions:
<ul>
<li>{@link android.net.ConnectivityManager}>
@@ -206,27 +206,27 @@
</ul>
</li>
<li>On slower connections, consider downloading only lower-resolution media
- or perhaps none at all. This ensures that your users are still able to use
- the app on slow connections. Where you don’t have an image or the image is
- still loading, you should always show a placeholder. You can create a
- dynamic placeholder by using the <a
+ or perhaps none at all. This ensures that your users are still able to use
+ the app on slow connections. Where you don’t have an image or the image is
+ still loading, you should always show a placeholder. You can create a
+ dynamic placeholder by using the <a
href="{@docRoot}tools/support-library/features.html#v7-palette">
- Palette library</a> to generate placeholder colors that match the target
+ Palette library</a> to generate placeholder colors that match the target
image.</li>
<li>Prioritize network requests such that text is fetched before rich media.
- Text requests tend to be smaller, compress better, and hence transfer
- faster, meaning that your app can display useful content quickly. For more
- information on adjusting bandwidth based on network connection, see the
- Android training on <a
- href="{@docRoot}training/basics/network-ops/managing.html">Managing Network
+ Text requests tend to be smaller, compress better, and hence transfer
+ faster, meaning that your app can display useful content quickly. For more
+ information on adjusting bandwidth based on network connection, see the
+ Android training on <a
+ href="{@docRoot}training/basics/network-ops/managing.html">Managing Network
Usage</a>.</li>
</ul>
<h4 id="network-behavior">Detect network changes, then change app behavior</h4>
<ul>
<li>Network quality is not static; it changes based on location, network
- traffic, and local population density. Apps should detect changes in
- network and adjust bandwidth accordingly. By doing so, your app can tailor
- the user experience to the network quality. Detect network state using
+ traffic, and local population density. Apps should detect changes in
+ network and adjust bandwidth accordingly. By doing so, your app can tailor
+ the user experience to the network quality. Detect network state using
these methods:
<ul>
<li>{@link android.net.ConnectivityManager}>
@@ -238,26 +238,26 @@
</ul>
</li>
<li>As the network quality degrades, scale down the number and size of
- requests. As the connection quality improves, you can scale up your
+ requests. As the connection quality improves, you can scale up your
requests to optimal levels.</li>
<li>On higher quality, unmetered networks, consider <a
href="{@docRoot}training/efficient-downloads/efficient-network-access.html#PrefetchData">
- prefetching data</a> to make it available ahead of time. From a user
- experience standpoint, this might mean that news reader apps only fetch
- three articles at a time on 2G but fetch twenty articles at a time on
- Wi-Fi. For more information on adjusting app behavior based on network changes,
- visit the Android training on <a
+ prefetching data</a> to make it available ahead of time. From a user
+ experience standpoint, this might mean that news reader apps only fetch
+ three articles at a time on 2G but fetch twenty articles at a time on
+ Wi-Fi. For more information on adjusting app behavior based on network changes,
+ visit the Android training on <a
href="{@docRoot}training/monitoring-device-state/connectivity-monitoring.html">
Monitoring the Connectivity Status</a>.</li>
<li>The broadcast <a
href="{@docRoot}reference/android/net/ConnectivityManager.html#CONNECTIVITY_ACTION">
- <code>CONNECTIVITY_CHANGE</code></a> is sent when a change in network
- connectivity occurs. When your app is in the foreground, you can call <a
+ <code>CONNECTIVITY_CHANGE</code></a> is sent when a change in network
+ connectivity occurs. When your app is in the foreground, you can call <a
href="{@docRoot}reference/android/content/Context.html#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)">
- <code>registerReceiver</code></a> to receive this broadcast. After receiving
- the broadcast, you should reevaluate the current network state and adjust
- your UI and network usage appropriately. You should not declare this receiver
- in your manifest, as it will no longer function beginning with Android N.
+ <code>registerReceiver</code></a> to receive this broadcast. After receiving
+ the broadcast, you should reevaluate the current network state and adjust
+ your UI and network usage appropriately. You should not declare this receiver
+ in your manifest, as it will no longer function beginning with Android N.
For more details see <a href="{@docRoot}preview/behavior-changes.html">
Android N behavior changes</a>.</li>
</ul>
@@ -274,55 +274,55 @@
<h2 id="capability">Device Capability</h2>
</div>
<p>Reaching new users means supporting an increasing variety of Android
- platform versions and device specifications. Optimize for common RAM and
+ platform versions and device specifications. Optimize for common RAM and
screen sizes and resolutions to improve the user experience. </p>
<h3 id="screens">Support varying screen sizes</h3>
<h4 id="screens-dp">Use density-independent pixels (dp)</h4>
<ul>
<li>Defining layout dimensions with pixels is a problem because different
- screens have different pixel densities, so the same number of pixels may
- correspond to different physical sizes on different devices. The
- density-independent pixel (dp) corresponds to the physical size of a pixel
+ screens have different pixel densities, so the same number of pixels may
+ correspond to different physical sizes on different devices. The
+ density-independent pixel (dp) corresponds to the physical size of a pixel
at 160 dots per inch (mdpi density).</li>
<li>Defining layouts with dp ensures that the physical size of your user
- interface is consistent regardless of device. Visit the Android
- guide on <a
+ interface is consistent regardless of device. Visit the Android
+ guide on <a
href="https://developer.android.com/guide/practices/screens_support.html">
- Supporting Multiple Screens</a> for best practices using
+ Supporting Multiple Screens</a> for best practices using
density-independent pixels.</li>
</ul>
<h4 id="screens-density">Test graphics on ldpi/mdpi screen densities</h4>
<ul>
<li>Ensure that your app layouts work well on low- and medium-density
- (ldpi/mdpi) screens because these are <a
+ (ldpi/mdpi) screens because these are <a
href="https://developer.android.com/about/dashboards/index.html#Screens">
- common densities</a>, especially in lower-cost devices. Testing on
- lower-density screens helps to validate that your layouts are legible on
+ common densities</a>, especially in lower-cost devices. Testing on
+ lower-density screens helps to validate that your layouts are legible on
lower-density screens.</li>
<li>Lower-density screens can result in unclear text where the finer details
- aren't visible. The Material Design guidelines describe <a
+ aren't visible. The Material Design guidelines describe <a
class="external-link" href="https://www.google.com/design/spec/layout/metrics-keylines.html">
- metrics and keylines</a> to ensure that your layouts can scale across
+ metrics and keylines</a> to ensure that your layouts can scale across
screen densities.</li>
<li>Devices with lower-density screens tend to have lower hardware
- specifications. To ensure that your app performs well on these devices,
- consider reducing or eliminating heavy loads, such as animations and
- transitions. For more information on supporting different densities, see
- the Android training on <a
+ specifications. To ensure that your app performs well on these devices,
+ consider reducing or eliminating heavy loads, such as animations and
+ transitions. For more information on supporting different densities, see
+ the Android training on <a
href="https://developer.android.com/training/multiscreen/screendensities.html">
Supporting Different Densities</a>.</li>
</ul>
<h4 id="screens-sizes">Test layouts on small/medium screen sizes</h4>
<ul>
<li>Validate that your layouts scale down by testing on smaller screens. As
- screen sizes shrink, be very selective about visible UI elements, because
+ screen sizes shrink, be very selective about visible UI elements, because
there is limited space for them.</li>
<li>Devices with smaller screens tend to have lower hardware specifications.
- To ensure that your app performs well on these devices, try reducing or
- eliminating heavy loads, such as animations or transitions. For more
- information on supporting different screen sizes, see the Android
- training on <a
+ To ensure that your app performs well on these devices, try reducing or
+ eliminating heavy loads, such as animations or transitions. For more
+ information on supporting different screen sizes, see the Android
+ training on <a
href="https://developer.android.com/training/multiscreen/screendensities.html">
Supporting Different Screen Sizes</a>.</li>
</ul>
@@ -332,57 +332,57 @@
appropriately</h4>
<ul>
<li>Apps should build and target a recent version of Android to ensure most
- current behavior across a broad range of devices; this still provides
- backward compatibility to older versions. Here are the best practices for
+ current behavior across a broad range of devices; this still provides
+ backward compatibility to older versions. Here are the best practices for
targeting API levels appropriately:
<ul>
<li><a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">
- {@code targetSdkVersion}</a> should be the latest version of Android.
- Targeting the most recent version ensures that your app inherits newer
- runtime behaviors when running newer versions of Android. Be sure to
- test your app on newer Android versions when updating the
+ {@code targetSdkVersion}</a> should be the latest version of Android.
+ Targeting the most recent version ensures that your app inherits newer
+ runtime behaviors when running newer versions of Android. Be sure to
+ test your app on newer Android versions when updating the
targetSdkVersion as it can affect app behavior.</li>
<li><a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">
- {@code minSdkVersion}</a> sets the minimum supported Android version.
- Use Android 4.0 (API level 14: Ice Cream Sandwich) or Android 4.1 (API
- level 16: Jelly Bean)—these versions give maximum coverage for modern
- devices. Setting {@code minSdkVersion} also results in the Android build
- tools reporting incorrect use of new APIs that might not be available in
- older versions of the platform. By doing so, developers are protected
+ {@code minSdkVersion}</a> sets the minimum supported Android version.
+ Use Android 4.0 (API level 14: Ice Cream Sandwich) or Android 4.1 (API
+ level 16: Jelly Bean)—these versions give maximum coverage for modern
+ devices. Setting {@code minSdkVersion} also results in the Android build
+ tools reporting incorrect use of new APIs that might not be available in
+ older versions of the platform. By doing so, developers are protected
from inadvertently breaking backward compatibility.</li>
</ul>
</li>
<li>Consult the <a
href="https://developer.android.com/about/dashboards/index.html#Platform">
- Android dashboards</a>, the <a class="external-link"
- href="https://play.google.com/apps/publish/">Google Play Developer
- Console</a> for your app, and industry research in your target markets to
+ Android dashboards</a>, the <a class="external-link"
+ href="https://play.google.com/apps/publish/">Google Play Developer
+ Console</a> for your app, and industry research in your target markets to
gauge which versions of Android to target, based on your target users.</li>
</ul>
<h4 id="compatibility-libraries">Use the Android Support libraries</h4>
<ul>
<li>Ensure your app provides a consistent experience across OS versions by
using the Google-provided support libraries such as AppCompat and the Design
- Support Library. The Android Support Library package is a set of code
- libraries that provides backward-compatible versions of Android framework
+ Support Library. The Android Support Library package is a set of code
+ libraries that provides backward-compatible versions of Android framework
APIs as well as features that are only available through the library APIs.
</li>
<li>Some of the the highlights include:
<ul>
<li>v4 & v7 support library: Many framework APIs for older versions of
- Android such as {@link android.support.v4.view.ViewPager},
- {@link android.app.ActionBar},
- {@link android.support.v7.widget.RecyclerView}, and
+ Android such as {@link android.support.v4.view.ViewPager},
+ {@link android.app.ActionBar},
+ {@link android.support.v7.widget.RecyclerView}, and
{@link android.support.v7.graphics.Palette}.</li>
<li><a href="{@docRoot}tools/support-library/features.html#design">Design
- Support</a> library: APIs to support adding Material Design components
+ Support</a> library: APIs to support adding Material Design components
and patterns to your apps.</li>
<li><a href="{@docRoot}tools/support-library/features.html#multidex">
- Multidex Support</a> library: provides support for large apps that have
- more than 65K methods. This can happen if your app is using many
- libraries.</li>
+ Multidex Support</a> library: provides support for large apps that have
+ more than 65K methods. This can happen if your app is using many
+ libraries.</li>
</ul>
</li>
<li>For more information on the available support libraries, see the <a
@@ -392,14 +392,14 @@
<h4 id="compatibility-playservices">Use Google Play services</h4>
<ul>
<li>Google Play services brings the best of Google APIs independent of
- Android platform version. Consider using features from Google Play services
+ Android platform version. Consider using features from Google Play services
to offer the most streamlined Google experience on Android devices.</li>
- <li>Google Play services also include useful APIs such as <a
+ <li>Google Play services also include useful APIs such as <a
href="https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmNetworkManager">
- <code>GcmNetworkManager</code></a>, which provides much of Android 5.0’s
+ <code>GcmNetworkManager</code></a>, which provides much of Android 5.0’s
{@link android.app.job.JobScheduler} API for older versions of Android. </li>
<li>Updates to Google Play services are distributed automatically by the
- Google Play Store, and new versions of the client library are delivered
+ Google Play Store, and new versions of the client library are delivered
through the Android SDK Manager. </li>
</ul>
<h3 id="memory">Efficient memory usage</h3>
@@ -408,44 +408,44 @@
<li>Adjusting your memory footprint dynamically helps to ensure compatibility
across devices with different RAM configurations.</li>
<li>Methods such as {@link android.app.ActivityManager#isLowRamDevice} and
- {@link android.app.ActivityManager#getMemoryClass()} help determine memory
- constraints at runtime. Based on this information, you can scale down your
- memory usage. As an example, you can use lower resolution images on low memory
+ {@link android.app.ActivityManager#getMemoryClass()} help determine memory
+ constraints at runtime. Based on this information, you can scale down your
+ memory usage. As an example, you can use lower resolution images on low memory
devices.</li>
<li>For more information on managing your app’s memory, see the Android
- training on <a href="{@docRoot}training/articles/memory.html">Managing
+ training on <a href="{@docRoot}training/articles/memory.html">Managing
Your App's Memory</a>.</li>
</ul>
<h4 id="memory-longprocesses">Avoid long-running processes</h4>
<ul>
<li>Long-running processes stay resident in memory and can result in slowing
- down the device. In most situations, your app should wake up for a given
- event, process data, and shut down. You should use <a
- href="https://developers.google.com/cloud-messaging">Google Cloud Messaging
- (GCM)</a> and/or <a
+ down the device. In most situations, your app should wake up for a given
+ event, process data, and shut down. You should use <a
+ href="https://developers.google.com/cloud-messaging">Google Cloud Messaging
+ (GCM)</a> and/or <a
href="https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmNetworkManager">
- <code>GcmNetworkManager</code></a> to avoid long running background
+ <code>GcmNetworkManager</code></a> to avoid long running background
services and reduce memory pressure on the user’s device.</li>
</ul>
<h4 id="memory-benchmark">Benchmark memory usage</h4>
<ul>
<li>Android Studio provides memory benchmarking and profiling tools, enabling
you to measure memory usage at run time. Benchmarking your app’s memory
- footprint enables you to monitor memory usage over multiple versions of
- the app. This can help catch unintentional memory footprint growth. These
+ footprint enables you to monitor memory usage over multiple versions of
+ the app. This can help catch unintentional memory footprint growth. These
tools can be used in the following ways:
<ul>
<li>Use the <a
- href="{@docRoot}tools/performance/memory-monitor/index.html">Memory
- Monitor</a> tool to find out whether undesirable garbage collection (GC)
- event patterns might be causing performance problems.</li>
+ href="{@docRoot}tools/performance/memory-monitor/index.html">Memory
+ Monitor</a> tool to find out whether undesirable garbage collection (GC)
+ event patterns might be causing performance problems.</li>
<li>Run <a
href="{@docRoot}tools/performance/heap-viewer/index.html">Heap Viewer</a>
- to identify object types that get or stay allocated unexpectedly or
+ to identify object types that get or stay allocated unexpectedly or
unnecessarily.</li>
<li>Use <a
href="{@docRoot}tools/performance/allocation-tracker/index.html">
- Allocation Tracker</a> to identify where in your code the problem might
+ Allocation Tracker</a> to identify where in your code the problem might
be.</li>
</ul>
</li>
@@ -466,35 +466,35 @@
<h2 id="cost">Data Cost</h2>
</div>
<p>Data plans in some countries can cost upwards of 10% of monthly income.
- Conserve data and give control to optimize user experience. Reduce data
+ Conserve data and give control to optimize user experience. Reduce data
consumption and give users control over your app’s use of data.</p>
<h3 id="appsize">Reduce app size</h3>
<h4 id="appsize-graphics">Reduce APK graphical asset size</h4>
<ul>
<li>Graphical assets are often the largest contributor to the size of the
- APK. Optimizing these can result in smaller downloads and thus faster
+ APK. Optimizing these can result in smaller downloads and thus faster
installation times for users.</li>
<li>For graphical assets like icons, use Scalable Vector Graphics (SVG)
- format. SVG images are relatively tiny in size and can be rendered at
- runtime to any resolution. The <a
- href="{@docRoot}tools/support-library/index.html">Android Support</a>
- library provides a backward-compatible implementation for vector resources as
- far back as Android 2.1 (API level 7). Get started with vectors with <a
- class="external-link"
+ format. SVG images are relatively tiny in size and can be rendered at
+ runtime to any resolution. The <a
+ href="{@docRoot}tools/support-library/index.html">Android Support</a>
+ library provides a backward-compatible implementation for vector resources as
+ far back as Android 2.1 (API level 7). Get started with vectors with <a
+ class="external-link"
href="https://medium.com/@chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88">
this Medium post</a>. </li>
<li>For non-vector images, like photos, use <a
- href="https://developers.google.com/speed/webp/">WebP</a>. WebP reduces
- image load times, saves network bandwidth, and is proven to result in
- smaller file sizes than its PNG and JPG counterparts, with at least the
- same image quality. Even at lossy settings, WebP can produce a nearly
- identical image. Android has had lossy WebP support since Android 4.0 (API
+ href="https://developers.google.com/speed/webp/">WebP</a>. WebP reduces
+ image load times, saves network bandwidth, and is proven to result in
+ smaller file sizes than its PNG and JPG counterparts, with at least the
+ same image quality. Even at lossy settings, WebP can produce a nearly
+ identical image. Android has had lossy WebP support since Android 4.0 (API
level 14: Ice Cream Sandwich) and support for lossless / transparent WebP since Android 4.2 (API level 17: Jelly Bean).</li>
<li>If you have many large images across multiple densities, consider
- using <a href="{@docRoot}google/play/publishing/multiple-apks.html">Multiple
- APK support</a> to split your APK by density. This results in builds
- targeted for specific densities, meaning users with low-density devices
+ using <a href="{@docRoot}google/play/publishing/multiple-apks.html">Multiple
+ APK support</a> to split your APK by density. This results in builds
+ targeted for specific densities, meaning users with low-density devices
won’t have to incur the penalty of unused high-density assets.</li>
<li>A detailed guide on reducing your APK size can be found in <a
class="external-link" href="https://medium.com/@wkalicinski/smallerapk-part-4-multi-apk-through-abi-and-density-splits-477083989006">
@@ -503,84 +503,84 @@
<h4 id="appsize-code">Reduce code size</h4>
<ul>
<li>Be careful about using external libraries because not all libraries are
- meant to be used in mobile apps. Ensure that the libraries your app is
+ meant to be used in mobile apps. Ensure that the libraries your app is
using are optimized for mobile use.</li>
<li>Every library in your Android project is adding potentially unused code
- to your APK. There are also some libraries that aren’t designed with mobile
- development in mind. These libraries can end up contributing to significant
+ to your APK. There are also some libraries that aren’t designed with mobile
+ development in mind. These libraries can end up contributing to significant
APK bloat.</li>
<li>Consider optimizing your compiled code using a tool such as <a
- href="{@docRoot}tools/help/proguard.html">ProGuard</a>. ProGuard identifies
- code that isn’t being used and removes it from your APK. Also <a
- class="external-link"
+ href="{@docRoot}tools/help/proguard.html">ProGuard</a>. ProGuard identifies
+ code that isn’t being used and removes it from your APK. Also <a
+ class="external-link"
href="http://tools.android.com/tech-docs/new-build-system/resource-shrinking">
- enable resource shrinking</a> at build time by setting
- <code>minifyEnabled=true</code>, <code>shrinkResources=true</code> in
- <code>build.gradle</code>—this automatically removes unused resources from
+ enable resource shrinking</a> at build time by setting
+ <code>minifyEnabled=true</code>, <code>shrinkResources=true</code> in
+ <code>build.gradle</code>—this automatically removes unused resources from
your APK.</li>
<li>When using Google Play services, you should <a
href="{@docRoot}google/play-services/setup.html#add_google_play_services_to_your_project">
selectively include</a> only the necessary APIs into your APK.</li>
<li>For more information on reducing code size in your APK, see the Android
- training on how to <a
- href="{@docRoot}training/articles/memory.html#DependencyInjection">Avoid
+ training on how to <a
+ href="{@docRoot}training/articles/memory.html#DependencyInjection">Avoid
dependency injection frameworks</a>.</li>
</ul>
<h4 id="appsize-external">Allow app to be moved to external (SD) storage</h4>
<ul>
<li>Low-cost devices often come with little on-device storage. Users can
- extend this with SD cards; however, apps need to explicitly declare that
+ extend this with SD cards; however, apps need to explicitly declare that
they support being installed to external storage before users can move them.
</li>
<li>Allow your app to be installed to external storage using the <a
href="{@docRoot}guide/topics/manifest/manifest-element.html#install"><code>
- android:installLocation</code></a> flag in your AndroidManifest. For more
- information on enabling your app to be moved to external storage, see the
- Android guide on <a
- href="{@docRoot}guide/topics/data/install-location.html">App Install
+ android:installLocation</code></a> flag in your AndroidManifest. For more
+ information on enabling your app to be moved to external storage, see the
+ Android guide on <a
+ href="{@docRoot}guide/topics/data/install-location.html">App Install
Location</a>.</li>
</ul>
<h4 id="appsize-postinstall">Reduce post-install app disk usage</h4>
<ul>
<li>Keeping your app’s disk usage low means that users are less likely to
- uninstall your app when the device is low on free space. When using caches,
- it’s important to apply bounds around your caches—this prevents your app’s
- disk usage from growing indefinitely. Be sure you put your cached data in
- {@link android.content.Context#getCacheDir()}—the system can delete files
- placed here as needed, so they won’t show up as storage committed to the
+ uninstall your app when the device is low on free space. When using caches,
+ it’s important to apply bounds around your caches—this prevents your app’s
+ disk usage from growing indefinitely. Be sure you put your cached data in
+ {@link android.content.Context#getCacheDir()}—the system can delete files
+ placed here as needed, so they won’t show up as storage committed to the
app.</li>
</ul>
<h3 id="configurablenetwork">Offer configurable network usage</h3>
-<h4 id="configurablenetwork-onboarding">Provide onboarding experiences for
+<h4 id="configurablenetwork-onboarding">Provide onboarding experiences for
subjective user choices</h4>
<ul>
<li>Apps that allow users to reduce data usage are well received, even if
- they demand heavy data requirements. If your app uses a considerable amount
- of bandwidth (for example, video streaming apps), you can provide an
- onboarding experience for users to configure network usage. For example,
- you could allow the user to force lower-bitrate video streams on cellular
+ they demand heavy data requirements. If your app uses a considerable amount
+ of bandwidth (for example, video streaming apps), you can provide an
+ onboarding experience for users to configure network usage. For example,
+ you could allow the user to force lower-bitrate video streams on cellular
networks. </li>
<li>Additional settings for users to control data syncing, prefetching, and
- network usage behavior (for example, prefetch all starred news categories on
+ network usage behavior (for example, prefetch all starred news categories on
Wi-Fi only), also help users tailor your app’s behavior to their needs.</li>
<li>For more information on managing network usage, see the Android training
- on <a href="{@docRoot}training/basics/network-ops/managing.html">Managing
+ on <a href="{@docRoot}training/basics/network-ops/managing.html">Managing
Network Usage</a>.</li>
</ul>
-<h4 id="configurablenetwork-preferences">Provide a network preferences
+<h4 id="configurablenetwork-preferences">Provide a network preferences
screen</h4>
<ul>
<li>You can navigate to the app’s network settings from outside the app by
- means of a network preferences screen. You can invoke this screen from
+ means of a network preferences screen. You can invoke this screen from
either the system settings screen or the system data usage screen.</li>
<li>To provide a network preferences screen that users can access from within
- your app as well as from the system settings, in your app include an
- activity that supports the
+ your app as well as from the system settings, in your app include an
+ activity that supports the
{@link android.content.Intent#ACTION_MANAGE_NETWORK_USAGE} action.</li>
<li>For further information on adding a network preferences screen, see the
- Android training on <a
+ Android training on <a
href="{@docRoot}training/basics/network-ops/managing.html#prefs">
Implementing a Preferences Activity</a>.</li>
</ul>
@@ -599,57 +599,57 @@
<div class="headerLine">
<h2 id="consumption">Battery Consumption</h2>
</div>
-<p>Access to reliable power supplies varies, and outages can disrupt planned
-charges. Defend your users' batteries against unnecessary drain by benchmarking
-your battery use, avoiding wakelocks, scheduling tasks, and monitoring sensor
+<p>Access to reliable power supplies varies, and outages can disrupt planned
+charges. Defend your users' batteries against unnecessary drain by benchmarking
+your battery use, avoiding wakelocks, scheduling tasks, and monitoring sensor
requests.</p>
<h3 id="consumption-reduce">Reduce battery consumption</h3>
<ul>
<li>Your app should do minimal activity when in the background and when the
device is running on battery power.</li>
<li><a href="{@docRoot}reference/android/os/PowerManager.WakeLock.html">Wake
- locks</a> are mechanisms to keep devices on so that they can perform
- background activities. Avoid using wake locks because they prevent the
+ locks</a> are mechanisms to keep devices on so that they can perform
+ background activities. Avoid using wake locks because they prevent the
device from going into low-power states.</li>
<li>To reduce the number of device wake-ups, batch network activity. For more
- information on batching, see the Android training on <a
+ information on batching, see the Android training on <a
href="{@docRoot}training/efficient-downloads/efficient-network-access.html">
Optimizing Downloads for Efficient Network Access</a>.</li>
- <li><a
+ <li><a
href="https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmNetworkManager">
- <code>GcmNetworkManager</code></a> schedules tasks and lets Google Play
- services batch operations across the system. This greatly
- simplifies the implementation of common patterns, such as waiting for
- network connectivity, device charging state, retries, and backoff. Use
- <code>GcmNetworkManager</code> to perform non-essential background activity
+ <code>GcmNetworkManager</code></a> schedules tasks and lets Google Play
+ services batch operations across the system. This greatly
+ simplifies the implementation of common patterns, such as waiting for
+ network connectivity, device charging state, retries, and backoff. Use
+ <code>GcmNetworkManager</code> to perform non-essential background activity
when the device is charging and is connected to an unmetered network.</li>
<li>Sensors, like GPS, can also have a significant drain on the battery. The
- recommended way to request location is to use the FusedLocationProvider API.
- The <a
- href="https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi">FusedLocationProvider</a> API manages the
- underlying location technology and provides a simple API so that you can
- specify requirements—like high accuracy or low power—at a high
- level. It also optimizes the device's use of battery power by caching
- locations and batching requests across apps. For more information on the
- ideal ways to request location, see the <a
- href="{@docRoot}training/location/retrieve-current.html">Getting the Last
+ recommended way to request location is to use the FusedLocationProvider API.
+ The <a
+ href="https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi">FusedLocationProvider</a> API manages the
+ underlying location technology and provides a simple API so that you can
+ specify requirements—like high accuracy or low power—at a high
+ level. It also optimizes the device's use of battery power by caching
+ locations and batching requests across apps. For more information on the
+ ideal ways to request location, see the <a
+ href="{@docRoot}training/location/retrieve-current.html">Getting the Last
Known Location</a> training guide.
</li>
</ul>
<h3 id="consumption-benchmark">Benchmark battery usage</h3>
<ul>
<li>Benchmarking your app’s usage in a controlled environment helps you
- understand the battery-heavy tasks in your app. It is a good practice to
- benchmark your app’s battery usage to gauge efficiency and track changes
+ understand the battery-heavy tasks in your app. It is a good practice to
+ benchmark your app’s battery usage to gauge efficiency and track changes
over time.
</li>
<li><a
href="{@docRoot}tools/performance/batterystats-battery-historian/index.html">
- Batterystats</a> collects battery data about your apps, and <a
+ Batterystats</a> collects battery data about your apps, and <a
href="{@docRoot}tools/performance/batterystats-battery-historian/index.html">
- Battery Historian</a> converts that data into an HTML visualization. For
- more information on reducing battery usage, see the Android training on <a
- href="{@docRoot}training/monitoring-device-state/index.html">Optimizing
+ Battery Historian</a> converts that data into an HTML visualization. For
+ more information on reducing battery usage, see the Android training on <a
+ href="{@docRoot}training/monitoring-device-state/index.html">Optimizing
Battery Life</a>.</li>
</ul>
@@ -665,55 +665,55 @@
<h2 id="contentsection">Content</h2>
</div>
<p>Make sure that your app works well on a variety of screens: offering good,
- crisp graphics and appropriate layouts on low resolution and physically small
- screens. Ensure that your app is designed to be easily localized by
- accommodating the variations between languages: allow for spacing, density,
- order, emphasis, and wording variations. Also make sure that date, time, and
- the like are internationalized and displayed according to the phone’s
+ crisp graphics and appropriate layouts on low resolution and physically small
+ screens. Ensure that your app is designed to be easily localized by
+ accommodating the variations between languages: allow for spacing, density,
+ order, emphasis, and wording variations. Also make sure that date, time, and
+ the like are internationalized and displayed according to the phone’s
settings.</p>
<h3 id="content-responsive">Fast and responsive UI</h3>
<h4 id="content-feedback">Touch feedback on all touchable items</h4>
<ul>
<li>Touch feedback adds a tactile feeling to the user interface. You should
- ensure your app provides touch feedback on all touchable elements to reduce
+ ensure your app provides touch feedback on all touchable elements to reduce
the perceived app latency as much as possible.
</li>
<li><a
href="https://www.google.com/design/spec/animation/responsive-interaction.html">
- Responsive interaction</a> encourages deeper exploration of an app by
- creating timely, logical, and delightful screen reactions to user input.
- Responsive interaction elevates an app from an information-delivery service
- to an experience that communicates using multiple visual and tactile
+ Responsive interaction</a> encourages deeper exploration of an app by
+ creating timely, logical, and delightful screen reactions to user input.
+ Responsive interaction elevates an app from an information-delivery service
+ to an experience that communicates using multiple visual and tactile
responses.</li>
<li>For more information, see the Android training on <a
- href="{@docRoot}training/material/animations.html#Touch">Customizing Touch
+ href="{@docRoot}training/material/animations.html#Touch">Customizing Touch
Feedback</a>.</li>
</ul>
<h4 id="content-interactive">UI should always be interactive</h4>
<ul>
<li>Apps that are unresponsive when performing background activity feel slow
- and reduce user satisfaction. Ensure your app always has a responsive UI
- regardless of any background activity. Achieve this by performing network
- operations or any heavy-duty operations in a background thread—keep the UI
+ and reduce user satisfaction. Ensure your app always has a responsive UI
+ regardless of any background activity. Achieve this by performing network
+ operations or any heavy-duty operations in a background thread—keep the UI
thread as idle as you can.</li>
<li>Material Design apps use minimal visual changes when your app is loading
- content by representing each operation with a single activity indicator.
- Avoid blocking dialogs with <a
+ content by representing each operation with a single activity indicator.
+ Avoid blocking dialogs with <a
href="https://www.google.com/design/spec/components/progress-activity.html">
loading indicators</a>.</li>
<li><a
- href="http://www.google.com/design/spec/patterns/empty-states.html">Empty
- states</a> occur when the regular content of a view can’t be shown. It might
- be a list that has no items or a search that returns no results. Avoid
- completely empty states. The most basic empty state displays a
- non-interactive image and a text tagline. Where you don’t have an image, or
- the image is still loading, you should always show either a static
- placeholder, or create a dynamic placeholder by using the <a
- href="{@docRoot}tools/support-library/features.html#v7-palette">Palette
+ href="http://www.google.com/design/spec/patterns/empty-states.html">Empty
+ states</a> occur when the regular content of a view can’t be shown. It might
+ be a list that has no items or a search that returns no results. Avoid
+ completely empty states. The most basic empty state displays a
+ non-interactive image and a text tagline. Where you don’t have an image, or
+ the image is still loading, you should always show either a static
+ placeholder, or create a dynamic placeholder by using the <a
+ href="{@docRoot}tools/support-library/features.html#v7-palette">Palette
library</a> to generate placeholder colors that match the target image.</li>
<li>For more information, see the Android training on <a
- href="{@docRoot}training/articles/perf-anr.html">Keeping Your App
+ href="{@docRoot}training/articles/perf-anr.html">Keeping Your App
Responsive</a>.</li>
</ul>
<h4 id="content-60fps">Target 60 frames per second on low-cost devices</h4>
@@ -721,34 +721,34 @@
<li>Ensure that your app always runs fast and smoothly, even on low-cost
devices.</li>
<li>Overdraw can significantly slow down your app—it occurs when the pixels
- are being drawn more than once per pass. An example of this is when you have
- an image with a button placed on top of it. While some overdraw is
- unavoidable, it should be minimized to ensure a smooth frame rate. Perform
- <a href="{@docRoot}tools/performance/debug-gpu-overdraw/index.html">Debug
+ are being drawn more than once per pass. An example of this is when you have
+ an image with a button placed on top of it. While some overdraw is
+ unavoidable, it should be minimized to ensure a smooth frame rate. Perform
+ <a href="{@docRoot}tools/performance/debug-gpu-overdraw/index.html">Debug
GPU overdraw</a> on your app to ensure it is minimized.</li>
<li>Android devices refresh the screen at 60 frames per second (fps), meaning
- your app has to update the screen within roughly 16 milliseconds. <a
- href="{@docRoot}tools/performance/profile-gpu-rendering/index.html">Profile
- your app</a> using on-device tools to see if and when your app is not
+ your app has to update the screen within roughly 16 milliseconds. <a
+ href="{@docRoot}tools/performance/profile-gpu-rendering/index.html">Profile
+ your app</a> using on-device tools to see if and when your app is not
meeting this 16-ms average.</li>
<li>Reduce or remove animations on low-cost devices to lessen the burden on
- the device’s CPU and GPU. For more information, see the Android training on
- <a href="{@docRoot}training/improving-layouts/index.html">Improving Layout
+ the device’s CPU and GPU. For more information, see the Android training on
+ <a href="{@docRoot}training/improving-layouts/index.html">Improving Layout
Performance</a>. </li>
</ul>
-<h4 id="content-firstload">If anticipated start speed is low, use launch screen
+<h4 id="content-firstload">If anticipated start speed is low, use launch screen
on first load</h4>
<ul>
<li>The launch screen is a user’s first experience of your application.
- Launching your app while displaying a blank canvas increases its perceived
- loading time, so consider using a placeholder UI or a branded launch screen
+ Launching your app while displaying a blank canvas increases its perceived
+ loading time, so consider using a placeholder UI or a branded launch screen
to reduce the perceived loading time.</li>
<li>A<a href="https://www.google.com/design/spec/patterns/launch-screens.html#launch-screens-types-of-launch-screens">
- placeholder UI</a> is the most seamless launch transition, appropriate for
+ placeholder UI</a> is the most seamless launch transition, appropriate for
both app launches and in-app activity transitions.</li>
<li><a
href="https://www.google.com/design/spec/patterns/launch-screens.html#launch-screens-placeholder-ui">
- Branded launch screens</a> provide momentary brand exposure, freeing the UI
+ Branded launch screens</a> provide momentary brand exposure, freeing the UI
to focus on content.</li>
<li>For more information on implementing splash screens, see the <a
href="https://www.google.com/design/spec/patterns/launch-screens.html">
@@ -758,24 +758,24 @@
<ul>
<li><a
href="https://www.google.com/design/spec/material-design/introduction.html">
- Material Design</a> is a visual language that synthesizes the classic
- principles of good design with the innovation and possibility of technology
- and science. Material Design aims to develop a single underlying system that
- allows for a unified experience across platforms and device sizes. Consider
- using key Material Design components so that users intuitively know how to
+ Material Design</a> is a visual language that synthesizes the classic
+ principles of good design with the innovation and possibility of technology
+ and science. Material Design aims to develop a single underlying system that
+ allows for a unified experience across platforms and device sizes. Consider
+ using key Material Design components so that users intuitively know how to
use your app.</li>
<li>Ready-to-use Material Design components are available via the <a
- href="{@docRoot}tools/support-library/features.html#design">Design Support
- library</a>. These components are supported in Android 2.1 (API level 7) and
+ href="{@docRoot}tools/support-library/features.html#design">Design Support
+ library</a>. These components are supported in Android 2.1 (API level 7) and
above.</li>
</ul>
<h3 id="localization">Localization</h3>
<ul>
<li>Your users could be from any part of the world and their first language
- may not be yours. If you don’t present your app in a language that your
- users can read, it is a missed opportunity. You should therefore
+ may not be yours. If you don’t present your app in a language that your
+ users can read, it is a missed opportunity. You should therefore
localize your app for key regional languages.</li>
- <li>To learn more, visit the Android training on <a
+ <li>To learn more, visit the Android training on <a
href="{@docRoot}training/basics/supporting-devices/languages.html">
Supporting Different Languages</a>.</li>
</ul>
diff --git a/docs/html/distribute/essentials/quality/core.jd b/docs/html/distribute/essentials/quality/core.jd
index 0ff44eb..637eaac 100644
--- a/docs/html/distribute/essentials/quality/core.jd
+++ b/docs/html/distribute/essentials/quality/core.jd
@@ -12,7 +12,7 @@
<li><a href="#listing">Google Play</a></li>
</ol>
-
+
<h2>Testing</h2>
<ol>
<li><a href="#test-environment">Setting Up a Test Environment</a></li>
@@ -24,7 +24,7 @@
<li><a href="{@docRoot}distribute/essentials/quality/tablets.html">Tablet App Quality</a></li>
<li><a href="{@docRoot}distribute/essentials/optimizing-your-app.html">Optimize Your App</a></li>
</ol>
-
+
</div>
</div>
@@ -85,7 +85,7 @@
<th style="width:54px;">
ID
</th>
-
+
<th>
Description
diff --git a/docs/html/distribute/essentials/quality/tablets.jd b/docs/html/distribute/essentials/quality/tablets.jd
index 2b2a5ae..3ff35f7 100644
--- a/docs/html/distribute/essentials/quality/tablets.jd
+++ b/docs/html/distribute/essentials/quality/tablets.jd
@@ -57,7 +57,7 @@
<p>The first step in delivering a great tablet app experience is making sure
that it meets the <em>core app quality criteria</em> for all of the devices
and form factors that the app is targeting. For complete information, see the <a
-href="{@docRoot}distribute/essentials/quality/core.html">Core App Quality Guidelines</a>.
+href="{@docRoot}distribute/essentials/quality/core.html">Core App Quality Guidelines</a>.
</p>
<p>
@@ -73,7 +73,7 @@
</ul>
<p>If your app is already uploaded to the Google Play Developer Console, you
- can see how it is doing against these checks
+ can see how it is doing against these checks
by visiting the <a href="#google-play-optimization-tips">Optimization
Tips page</a>.</p>
@@ -505,7 +505,7 @@
<pre><uses-feature android:name="android.hardware.telephony" android:required="false" /></pre></li>
-<li>Similarly, check the manifest for <a href="{@docRoot}guide/topics/manifest/permission-element.html"><code><permission></code></a> elements that
+<li>Similarly, check the manifest for <a href="{@docRoot}guide/topics/manifest/permission-element.html"><code><permission></code></a> elements that
<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html#permissions">imply hardware
feature requirements</a> that not be appropriate for tablets. If you find such
permissions, make sure to explicitly declare a corresponding
diff --git a/docs/html/distribute/googleplay/cast.jd b/docs/html/distribute/googleplay/cast.jd
index 937ab58..3112f81 100644
--- a/docs/html/distribute/googleplay/cast.jd
+++ b/docs/html/distribute/googleplay/cast.jd
@@ -26,7 +26,7 @@
<p>
<a href="https://developers.google.com/cast/">Find out how to get your app Google
- Cast-ready</a>.
+ Cast-ready</a>.
</p>
<h2 id="tips">Tips</h2>
diff --git a/docs/html/distribute/googleplay/families/faq.jd b/docs/html/distribute/googleplay/families/faq.jd
index 363dc91..663850f 100644
--- a/docs/html/distribute/googleplay/families/faq.jd
+++ b/docs/html/distribute/googleplay/families/faq.jd
@@ -10,7 +10,7 @@
font-weight:bold;
}
</style>
-
+
<div id="qv-wrapper">
<ol id="qv">
<h2>In this document</h2>
@@ -84,7 +84,7 @@
<dd>
No, you do not need to translate your privacy policy. However, if you
distribute your apps in a few select countries, it is advised that you do
- translate your privacy policy.
+ translate your privacy policy.
</dd>
<dt>
@@ -173,7 +173,7 @@
confirm that it is appropriate for families. Assuming your app complies with all program
requirements, we expect that publishing time should not take any longer
than normal; however, there may be a delay in publishing the app if it is
- rejected during the Designed for Families review.
+ rejected during the Designed for Families review.
</dd>
<dt>
@@ -301,7 +301,7 @@
<dd>
House ads are allowed, but they must comply with <a
- href="https://support.google.com/googleplay/android-developer/answer/6184502#ads">ads policies</a>.
+ href="https://support.google.com/googleplay/android-developer/answer/6184502#ads">ads policies</a>.
</dd>
<dt>
diff --git a/docs/html/distribute/googleplay/families/start.jd b/docs/html/distribute/googleplay/families/start.jd
index 0e773bd..f174dae 100644
--- a/docs/html/distribute/googleplay/families/start.jd
+++ b/docs/html/distribute/googleplay/families/start.jd
@@ -86,7 +86,7 @@
<p class="note">
<strong>Note</strong>: Published apps in the Designed for Families program
- are also available to all users on Google Play.
+ are also available to all users on Google Play.
</p>
<p>
diff --git a/docs/html/distribute/googleplay/tv.jd b/docs/html/distribute/googleplay/tv.jd
index a35edbc..981ba51 100644
--- a/docs/html/distribute/googleplay/tv.jd
+++ b/docs/html/distribute/googleplay/tv.jd
@@ -275,7 +275,7 @@
the criteria, you’ll receive a <strong>notification email sent to your developer account
address</strong>, with a summary of the areas that you need to address. When you’ve made
the necessary adjustments, you can upload a new version of your app to the Developer
- Console.
+ Console.
</p>
<p>
@@ -296,7 +296,7 @@
<li>
<em>Approved</em> — Your app was reviewed and approved. The app will be
- made available directly to Android TV users.
+ made available directly to Android TV users.
</li>
<li>
diff --git a/docs/html/distribute/tools/promote/device-art.jd b/docs/html/distribute/tools/promote/device-art.jd
index 9b4dd14..7fef02f 100644
--- a/docs/html/distribute/tools/promote/device-art.jd
+++ b/docs/html/distribute/tools/promote/device-art.jd
@@ -221,7 +221,7 @@
landOffset: [489,327],
portRes: ['shadow', 'back', 'fore'],
portOffset: [327,489],
- portSize: [1440, 2560],
+ portSize: [1440, 2560],
archived: true
},
{
diff --git a/docs/html/distribute/tools/promote/linking.jd b/docs/html/distribute/tools/promote/linking.jd
index 025480b..13b1574 100644
--- a/docs/html/distribute/tools/promote/linking.jd
+++ b/docs/html/distribute/tools/promote/linking.jd
@@ -18,7 +18,7 @@
<p>Google Play provides several link formats that let you bring users to your
products in the way you want, from Android apps, web pages, ads, reviews,
-articles, social media posts, and more.</p>
+articles, social media posts, and more.</p>
<p>The link formats let you:</p>
<ul>
diff --git a/docs/html/google/backup/signup.jd b/docs/html/google/backup/signup.jd
index 598003d..86518b6 100644
--- a/docs/html/google/backup/signup.jd
+++ b/docs/html/google/backup/signup.jd
@@ -105,7 +105,7 @@
8.4 You agree that you shall not remove, obscure, or alter any proprietary rights notices (including copyright, trade mark notices) which may be affixed to or contained within the Service.
<h3>9. License from Google</h3>
-9.1 Subject to terms and conditions of these Terms, Google gives you a personal, worldwide, royalty-free, non-assignable and non-exclusive license to use the Service as provided to you by Google. This license is for the sole purpose of enabling you to use and enjoy the benefit of the Service as provided by Google, in the manner permitted by the Terms.
+9.1 Subject to terms and conditions of these Terms, Google gives you a personal, worldwide, royalty-free, non-assignable and non-exclusive license to use the Service as provided to you by Google. This license is for the sole purpose of enabling you to use and enjoy the benefit of the Service as provided by Google, in the manner permitted by the Terms.
9.2 You may not (and you may not permit anyone else to) copy, modify, create a derivative work of, reverse engineer, decompile or otherwise attempt to extract the source code from the Service or any part thereof, unless this is expressly permitted or required by law, or unless you have been specifically told that you may do so by Google, in writing.
@@ -208,7 +208,7 @@
<input id="pname" type="text" name="pname" size="47" value="" onkeyup="onFormInput()"
onfocus="boxFocusChanged(this,true)" onblur="boxFocusChanged(this,false)"/>
</p>
-<p><a href="" class="dac-button dac-raised dac-primary disabled ndk" id="registerButton"
+<p><a href="" class="dac-button dac-raised dac-primary disabled ndk" id="registerButton"
onclick="onRegister(); return false;" >Register with Android Backup Service</a></p>
</div>
@@ -234,7 +234,7 @@
);
}
}
-
+
function boxFocusChanged(obj, focused) {
if (focused) {
if(obj.value == DEFAULT_TEXT){
@@ -248,14 +248,14 @@
}
}
}
-
-
+
+
function onFormInput() {
/* verify that the TOS is agreed and a bit version is chosen */
var packagename = $("#pname").val();
if ($("input#agree").is(":checked")
&& packagename.length
- && packagename != DEFAULT_TEXT) {
+ && packagename != DEFAULT_TEXT) {
/* reveal the button */
$("a#registerButton").removeClass('disabled');
} else {
diff --git a/docs/html/google/index.jd b/docs/html/google/index.jd
index 027ba23..9b7ff0b 100644
--- a/docs/html/google/index.jd
+++ b/docs/html/google/index.jd
@@ -53,7 +53,7 @@
<section class="dac-section dac-invert dac-darken-bg" style="background-image: url(/images/distribute/google-play-bg.jpg)"><div class="wrap">
<h1 class="dac-section-title">Google Play developer tools</h1>
<div class="dac-section-subtitle">
- Scale your publishing, manage your catalog, build revenue using Google Play developer tools.
+ Scale your publishing, manage your catalog, build revenue using Google Play developer tools.
</div>
<div class="resource-widget resource-flow-layout col-16"
data-query="collection:google/landing/googleplay"
diff --git a/docs/html/google/play/billing/api.jd b/docs/html/google/play/billing/api.jd
index 6816ff1..62f3367 100644
--- a/docs/html/google/play/billing/api.jd
+++ b/docs/html/google/play/billing/api.jd
@@ -34,7 +34,7 @@
<h2>See also</h2>
<ol>
<li><a href="{@docRoot}training/in-app-billing/index.html">Selling In-app Products</a></li>
- </ol>
+ </ol>
</div>
</div>
diff --git a/docs/html/google/play/licensing/adding-licensing.jd b/docs/html/google/play/licensing/adding-licensing.jd
index 3bf4c1a..bfd4f91 100644
--- a/docs/html/google/play/licensing/adding-licensing.jd
+++ b/docs/html/google/play/licensing/adding-licensing.jd
@@ -7,7 +7,7 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>In this document</h2>
<ol>
<li><a href="#manifest-permission">Adding the Licensing Permission</a></li>
@@ -42,7 +42,7 @@
<li><a href="#app-publishing">Publishing a Licensed Application</a></li>
<li><a href="#support">Where to Get Support</a></li>
</ol>
-
+
</div>
</div>
@@ -572,7 +572,7 @@
</li>
<li>In case of a recoverable local or server error, such as when the network is
not available to send the request, {@code LicenseChecker} passes a {@code RETRY} response to
-your {@code Policy} object's <code>processServerResponse()</code> method.
+your {@code Policy} object's <code>processServerResponse()</code> method.
<p>Also, both the {@code allow()} and {@code dontAllow()} callback methods receive a
<code>reason</code> argument. The {@code allow()} method's reason is usually {@code
Policy.LICENSED} or {@code Policy.RETRY} and the {@code dontAllow()} reason is usually {@code
@@ -672,7 +672,7 @@
return;
}
displayResult(getString(R.string.dont_allow));
-
+
if (reason == Policy.RETRY) {
// If the reason received from the policy is RETRY, it was probably
// due to a loss of connection with the service, so we should give the
@@ -854,9 +854,9 @@
<h3 id="account-key">Embed your public key for licensing</h3>
<p>For each application, the Google Play service automatically
-generates a 2048-bit RSA public/private key pair that is used for
-licensing and in-app billing. The key pair is uniquely associated with the
-application. Although associated with the application, the key pair is
+generates a 2048-bit RSA public/private key pair that is used for
+licensing and in-app billing. The key pair is uniquely associated with the
+application. Although associated with the application, the key pair is
<em>not</em> the same as the key that you use to sign your applications (or derived from it).</p>
<p>The Google Play Developer Console exposes the public key for licensing to any
@@ -876,11 +876,11 @@
href="http://play.google.com/apps/publish">Developer Console</a> and sign in.
Make sure that you sign in to the account from which the application you are
licensing is published (or will be published). </li>
-<li>In the application details page, locate the <strong>Services & APIs</strong>
+<li>In the application details page, locate the <strong>Services & APIs</strong>
link and click it. </li>
-<li>In the <strong>Services & APIs</strong> page, locate the
-<strong>Licensing & In-App Billing</strong> section. Your public key for
-licensing is given in the
+<li>In the <strong>Services & APIs</strong> page, locate the
+<strong>Licensing & In-App Billing</strong> section. Your public key for
+licensing is given in the
<strong>Your License Key For This Application</strong> field. </li>
</ol>
diff --git a/docs/html/google/play/licensing/licensing-reference.jd b/docs/html/google/play/licensing/licensing-reference.jd
index d4ca79a..2b16299 100644
--- a/docs/html/google/play/licensing/licensing-reference.jd
+++ b/docs/html/google/play/licensing/licensing-reference.jd
@@ -7,7 +7,7 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>In this document</h2>
<ol>
<li><a href="#lvl-summary">LVL Classes and Interfaces</a></li>
@@ -418,7 +418,7 @@
maintained in the <code>processServerResponse()</code> method, not shown. </p>
-<pre>
+<pre>
public boolean allowAccess() {
long ts = System.currentTimeMillis();
if (mLastResponse == LicenseResponse.LICENSED) {
diff --git a/docs/html/google/play/licensing/overview.jd b/docs/html/google/play/licensing/overview.jd
index ecb384d..8d7977e 100755
--- a/docs/html/google/play/licensing/overview.jd
+++ b/docs/html/google/play/licensing/overview.jd
@@ -6,14 +6,14 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>Quickview</h2>
<ul>
<li>Licensing allows you to verify your app was purchased from Google Play</li>
<li>Your app maintains control of how it enforces its licensing status</li>
<li>The service is free for all developers who publish on Google Play</li>
</ul>
-
+
<h2>In this document</h2>
<ol>
<li><a href="#Secure">License Responses are Secure</a></li>
@@ -21,7 +21,7 @@
<li><a href="#Reqs">Requirements and Limitations</a></li>
<li><a href="#CopyProtection">Replacement for Copy Protection</a></li>
</ol>
-
+
</div>
</div>
@@ -107,10 +107,10 @@
server and you.</p>
<p>The licensing service generates a single licensing key pair for each
-application and exposes the public key in your application's
-<strong>Services & APIs</strong> page in the Developer Console. You must copy
-the public key from the Developer Console and embed it in your application
-source code. The server retains the private key internally and uses it to sign
+application and exposes the public key in your application's
+<strong>Services & APIs</strong> page in the Developer Console. You must copy
+the public key from the Developer Console and embed it in your application
+source code. The server retains the private key internally and uses it to sign
license responses for the applications you publish with that account.</p>
<p>When your application receives a signed response, it uses the embedded public
@@ -209,7 +209,7 @@
secure.</li>
<li>Adding licensing to an application does not affect the way the application
functions when run on a device that does not offer Google Play.</li>
-<li>You can implement licensing controls for a free app, but only if you're using the service to
+<li>You can implement licensing controls for a free app, but only if you're using the service to
provide <a
href="{@docRoot}google/play/expansion-files.html">APK expansion files</a>.</li>
</ul>
diff --git a/docs/html/google/play/publishing/multiple-apks.jd b/docs/html/google/play/publishing/multiple-apks.jd
index fd4481d..a878fb3 100644
--- a/docs/html/google/play/publishing/multiple-apks.jd
+++ b/docs/html/google/play/publishing/multiple-apks.jd
@@ -250,11 +250,11 @@
</li>
<li><strong>Device feature sets</strong>
- <p>This is based on your manifest file's <a
+ <p>This is based on your manifest file's <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
element(s).</p>
<p>For example, you can provide one APK for devices that support multitouch and another
-APK for devices that do not support multitouch. See
+APK for devices that do not support multitouch. See
<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html#features-reference">Features
Reference</a> for a list of features supported by the platform.</p>
<br/>
diff --git a/docs/html/guide/appendix/app-intents.jd b/docs/html/guide/appendix/app-intents.jd
index 8898927..5fb004f 100644
--- a/docs/html/guide/appendix/app-intents.jd
+++ b/docs/html/guide/appendix/app-intents.jd
@@ -89,13 +89,13 @@
<tr><td>pitch</td><td>Panorama center-of-view in degrees from
-90 (look straight up) to 90 (look straight down.)</td></tr>
<tr><td>zoom</td><td>Panorama zoom. 1.0 = normal zoom, 2.0 = zoomed in 2x, 3.0 = zoomed in 4x, and so on.<br />
- A zoom of 1.0 is 90 degree horizontal FOV for a nominal
- landscape mode 4 x 3 aspect ratio display.
- Android phones in portrait mode will adjust the zoom so that
- the vertical FOV is approximately the same as the landscape vertical
- FOV. This means that the horizontal FOV of an Android phone in portrait
- mode is much narrower than in landscape mode. This is done to minimize
- the fisheye lens effect that would be present if a 90 degree horizontal
+ A zoom of 1.0 is 90 degree horizontal FOV for a nominal
+ landscape mode 4 x 3 aspect ratio display.
+ Android phones in portrait mode will adjust the zoom so that
+ the vertical FOV is approximately the same as the landscape vertical
+ FOV. This means that the horizontal FOV of an Android phone in portrait
+ mode is much narrower than in landscape mode. This is done to minimize
+ the fisheye lens effect that would be present if a 90 degree horizontal
FOV was used in portrait mode.</td></tr>
<tr><td>mapZoom</td><td>The map zoom of the map location associated with this panorama. This value is passed on to the
Maps activity when the Street View "Go to Maps" menu item is chosen. It corresponds to the <em>z</em> parameter in
diff --git a/docs/html/guide/appendix/g-app-intents.jd b/docs/html/guide/appendix/g-app-intents.jd
index 9ec72db..21c927b 100644
--- a/docs/html/guide/appendix/g-app-intents.jd
+++ b/docs/html/guide/appendix/g-app-intents.jd
@@ -83,7 +83,7 @@
</td>
</tr>
<tr>
- <td>Google Streetview</td>
+ <td>Google Streetview</td>
<td>google.streetview:cbll=<em>lat</em>,<em>lng</em>&cbp=1,<em>yaw</em>,,<em>pitch</em>,<em>zoom</em>&mz=<em>mapZoom</em>
</td>
<td>VIEW</td>
diff --git a/docs/html/guide/appendix/glossary.jd b/docs/html/guide/appendix/glossary.jd
index a200a6c..75a533a 100755
--- a/docs/html/guide/appendix/glossary.jd
+++ b/docs/html/guide/appendix/glossary.jd
@@ -15,7 +15,7 @@
</dd>
<dt id="dex">.dex file </dt>
- <dd>Compiled Android application code file.
+ <dd>Compiled Android application code file.
<p>Android programs are compiled into .dex (Dalvik Executable) files, which
are in turn zipped into a single .apk file on the device. .dex files can
be created by automatically translating compiled applications written in
@@ -26,7 +26,7 @@
a string value assigned to an Intent. Action strings can be defined by Android
or by a third-party developer. For example, android.intent.action.VIEW
for a Web URL, or com.example.rumbler.SHAKE_PHONE for a custom application
- to vibrate the phone.
+ to vibrate the phone.
<p>Related: <a href="#intent">Intent</a>.</p>
</dd>
@@ -41,8 +41,8 @@
<dt id="adb">adb</dt>
<dd>Android Debug Bridge, a command-line debugging application included with the
SDK. It provides tools to browse the device, copy tools on the device, and
- forward ports for debugging. If you are developing in Android Studio,
- adb is integrated into your development environment. See
+ forward ports for debugging. If you are developing in Android Studio,
+ adb is integrated into your development environment. See
<a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a>
for more information. </dd>
@@ -90,7 +90,7 @@
<dt id="ddms">DDMS</dt>
<dd>Dalvik Debug Monitor Service, a GUI debugging application included
with the SDK. It provides screen capture, log dump, and process
- examination capabilities. If you are developing in Android Studio,
+ examination capabilities. If you are developing in Android Studio,
DDMS is integrated into your development environment. See <a
href="{@docRoot}tools/debugging/ddms.html">Using DDMS</a> to learn more about the program.</dd>
@@ -100,7 +100,7 @@
is not intended to persist in the history stack, contain complex layout,
or perform complex actions. Android provides a default simple dialog for
you with optional buttons, though you can define your own dialog layout.
- The base class for dialogs is {@link android.app.Dialog Dialog}.
+ The base class for dialogs is {@link android.app.Dialog Dialog}.
<p>Related: <a href="#activity">Activity</a>.</p></dd>
<dt id="drawable">Drawable</dt>
@@ -113,7 +113,7 @@
— xml or bitmap files that describe the image. Drawable resources
are compiled into subclasses of {@link android.graphics.drawable}. For
more information about drawables and other resources, see <a
- href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources</a>.
+ href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources</a>.
<p>Related: <a href="#resources">Resources</a>, <a href="#canvas">Canvas
</a></p></dd>
@@ -133,7 +133,7 @@
based on the criteria supplied in the Intent and the Intent Filters
defined by other applications. For more information, see <a
href="{@docRoot}guide/components/intents-filters.html">Intents and
- Intent Filters</a>.
+ Intent Filters</a>.
<p>Related: <a href="#intentfilter">Intent Filter</a>, <a
href="#broadcastreceiver">Broadcast Receiver</a>.</p></dd>
@@ -147,7 +147,7 @@
application/activity that best matches the Intent and criteria. For more
information, see <a
href="{@docRoot}guide/components/intents-filters.html">Intents and
- Intent Filters</a>.
+ Intent Filters</a>.
<p>Related: <a href="#intent">Intent</a>, <a
href="#broadcastreceiver">Broadcast Receiver</a>.</p></dd>
@@ -155,12 +155,12 @@
<dd>An application class that listens for Intents that are broadcast,
rather than being sent to a single target application/activity. The system
delivers a broadcast Intent to all interested broadcast receivers, which
- handle the Intent sequentially.
- <p>Related: <a href="#intent">Intent</a>, <a href="#intentfilter">Intent
+ handle the Intent sequentially.
+ <p>Related: <a href="#intent">Intent</a>, <a href="#intentfilter">Intent
Filter</a>.</p> </dd>
-
+
<dt id="layoutresource">Layout Resource</dt>
- <dd>An XML file that describes the layout of an Activity screen.
+ <dd>An XML file that describes the layout of an Activity screen.
<p>Related: <a href="#resources">Resources</a></p></dd>
<dt id="manifest">Manifest File</dt>
@@ -175,15 +175,15 @@
<dd>A resizeable bitmap resource that can be used for backgrounds or other
images on the device. See <a
href="{@docRoot}guide/topics/resources/available-resources.html#ninepatch">
- Nine-Patch Stretchable Image</a> for more information.
+ Nine-Patch Stretchable Image</a> for more information.
<p>Related: <a href="#resources">Resources</a>.</p></dd>
<dt id="opengles">OpenGL ES</dt>
<dd> Android provides OpenGL ES libraries that you can use for fast,
complex 3D images. It is harder to use than a Canvas object, but
- better for 3D objects. The {@link android.opengl} and
- {@link javax.microedition.khronos.opengles} packages expose
- OpenGL ES functionality.
+ better for 3D objects. The {@link android.opengl} and
+ {@link javax.microedition.khronos.opengles} packages expose
+ OpenGL ES functionality.
<p>Related: <a href="#canvas">Canvas</a>, <a href="#surface">Surface</a></p></dd>
<dt id="resources">Resources</dt>
@@ -205,15 +205,15 @@
<dt id="service">Service</dt>
<dd>An object of class {@link android.app.Service} that runs in the
background (without any UI presence) to perform various persistent
- actions, such as playing music or monitoring network activity.
+ actions, such as playing music or monitoring network activity.
<p>Related: <a href="#activity">Activity</a></p></dd>
<dt id="surface">Surface</dt>
<dd>An object of type {@link android.view.Surface} representing a block of
memory that gets composited to the screen. A Surface holds a Canvas object
for drawing, and provides various helper methods to draw layers and resize
- the surface. You should not use this class directly; use
- {@link android.view.SurfaceView} instead.
+ the surface. You should not use this class directly; use
+ {@link android.view.SurfaceView} instead.
<p>Related: <a href="#canvas">Canvas</a></p></dd>
<dt id="surfaceview">SurfaceView</dt>
@@ -249,7 +249,7 @@
windows, and so on). It receives calls from its parent object (see
viewgroup, below)to draw itself, and informs its parent object about where
and how big it would like to be (which may or may not be respected by the
- parent). For more information, see {@link android.view.View}.
+ parent). For more information, see {@link android.view.View}.
<p>Related: <a href="#viewgroup">Viewgroup</a>, <a href="#widget">Widget
</a></p></dd>
@@ -259,18 +259,18 @@
they can be, as well as for calling each to draw itself when appropriate.
Some viewgroups are invisible and are for layout only, while others have
an intrinsic UI (for instance, a scrolling list box). Viewgroups are all
- in the {@link android.widget widget} package, but extend
- {@link android.view.ViewGroup ViewGroup}.
+ in the {@link android.widget widget} package, but extend
+ {@link android.view.ViewGroup ViewGroup}.
<p>Related: <a href="#view">View</a></p></dd>
<dt id="widget">Widget</dt>
<dd>One of a set of fully implemented View subclasses that render form
elements and other UI components, such as a text box or popup menu.
Because a widget is fully implemented, it handles measuring and drawing
- itself and responding to screen events. Widgets are all in the
+ itself and responding to screen events. Widgets are all in the
{@link android.widget} package. </dd>
- <!--
+ <!--
<dt id="panel">Panel</dt>
<dd> A panel is a concept not backed by a specific class. It is a View of
some sort that is tied in closely to a parent window, but can handle
diff --git a/docs/html/guide/components/activities.jd b/docs/html/guide/components/activities.jd
index 070154d..e757288 100644
--- a/docs/html/guide/components/activities.jd
+++ b/docs/html/guide/components/activities.jd
@@ -622,7 +622,7 @@
<p>The system calls {@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}
before making the activity vulnerable to destruction. The system passes this method
-a {@link android.os.Bundle} in which you can save
+a {@link android.os.Bundle} in which you can save
state information about the activity as name-value pairs, using methods such as {@link
android.os.Bundle#putString putString()} and {@link
android.os.Bundle#putInt putInt()}. Then, if the system kills your application
diff --git a/docs/html/guide/components/fragments.jd b/docs/html/guide/components/fragments.jd
index f9c2a26..951d042 100644
--- a/docs/html/guide/components/fragments.jd
+++ b/docs/html/guide/components/fragments.jd
@@ -36,7 +36,7 @@
<li>{@link android.app.FragmentManager}</li>
<li>{@link android.app.FragmentTransaction}</li>
</ol>
-
+
<h2>See also</h2>
<ol>
<li><a href="{@docRoot}training/basics/fragments/index.html">Building a Dynamic UI with Fragments</a></li>
@@ -306,7 +306,7 @@
<ul>
<li>Supply the {@code android:id} attribute with a unique ID.</li>
<li>Supply the {@code android:tag} attribute with a unique string.</li>
- <li>If you provide neither of the previous two, the system uses the ID of the container
+ <li>If you provide neither of the previous two, the system uses the ID of the container
view.</li>
</ul>
</div>
@@ -365,7 +365,7 @@
<p>For an example activity that uses a fragment as a background worker, without a UI, see the {@code
FragmentRetainInstance.java} sample, which is included in the SDK samples (available through the
-Android SDK Manager) and located on your system as
+Android SDK Manager) and located on your system as
<code><sdk_root>/APIDemos/app/src/main/java/com/example/android/apis/app/FragmentRetainInstance.java</code>.</p>
@@ -381,7 +381,7 @@
<li>Get fragments that exist in the activity, with {@link
android.app.FragmentManager#findFragmentById findFragmentById()} (for fragments that provide a UI in
the activity layout) or {@link android.app.FragmentManager#findFragmentByTag
-findFragmentByTag()} (for fragments that do or don't provide a UI).</li>
+findFragmentByTag()} (for fragments that do or don't provide a UI).</li>
<li>Pop fragments off the back stack, with {@link
android.app.FragmentManager#popBackStack()} (simulating a <em>Back</em> command by the user).</li>
<li>Register a listener for changes to the back stack, with {@link
@@ -568,7 +568,7 @@
<p>If the activity has not implemented the interface, then the fragment throws a
{@link java.lang.ClassCastException}.
-On success, the {@code mListener} member holds a reference to activity's implementation of
+On success, the {@code mListener} member holds a reference to activity's implementation of
{@code OnArticleSelectedListener}, so that fragment A can share events with the activity by calling
methods defined by the {@code OnArticleSelectedListener} interface. For example, if fragment A is an
extension of {@link android.app.ListFragment}, each time
@@ -798,7 +798,7 @@
<p>The second fragment, {@code DetailsFragment} shows the play summary for the item selected from
the list from {@code TitlesFragment}:</p>
-
+
{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java details}
<p>Recall from the {@code TitlesFragment} class, that, if the user clicks a list item and the
@@ -811,7 +811,7 @@
{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java
details_activity}
-
+
<p>Notice that this activity finishes itself if the configuration is landscape, so that the main
activity can take over and display the {@code DetailsFragment} alongside the {@code TitlesFragment}.
This can happen if the user begins the {@code DetailsActivity} while in portrait orientation, but
diff --git a/docs/html/guide/components/index.jd b/docs/html/guide/components/index.jd
index 811d015..d596b3b 100644
--- a/docs/html/guide/components/index.jd
+++ b/docs/html/guide/components/index.jd
@@ -1,7 +1,7 @@
page.title=App Components
page.landing=true
-page.landing.intro=Android's application framework lets you create rich and innovative apps using a set of reusable components. This section explains how you can build the components that define the building blocks of your app and how to connect them together using intents.
-page.metaDescription=Android's application framework lets you create rich and innovative apps using a set of reusable components. This section explains how you can build the components that define the building blocks of your app and how to connect them together using intents.
+page.landing.intro=Android's application framework lets you create rich and innovative apps using a set of reusable components. This section explains how you can build the components that define the building blocks of your app and how to connect them together using intents.
+page.metaDescription=Android's application framework lets you create rich and innovative apps using a set of reusable components. This section explains how you can build the components that define the building blocks of your app and how to connect them together using intents.
page.landing.image=images/develop/app_components.png
page.image=images/develop/app_components.png
@@ -11,7 +11,7 @@
<div class="col-6">
<h3>Blog Articles</h3>
-
+
<a href="http://android-developers.blogspot.com/2012/05/using-dialogfragments.html">
<h4>Using DialogFragments</h4>
<p>In this post, I’ll show how to use DialogFragments with the v4 support library (for backward compatibility on pre-Honeycomb devices) to show a simple edit dialog and return a result to the calling Activity using an interface.</p>
@@ -21,7 +21,7 @@
<h4>Fragments For All</h4>
<p>Today we’ve released a static library that exposes the same Fragments API (as well as the new LoaderManager and a few other classes) so that applications compatible with Android 1.6 or later can use fragments to create tablet-compatible user interfaces. </p>
</a>
-
+
<a
href="http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html">
<h4>Multithreading for Performance</h4>
@@ -33,7 +33,7 @@
<div class="col-6">
<h3>Training</h3>
-
+
<a href="http://developer.android.com/training/basics/activity-lifecycle/index.html">
<h4>Managing the Activity Lifecycle</h4>
<p>This class explains important lifecycle callback methods that each Activity
diff --git a/docs/html/guide/components/loaders.jd b/docs/html/guide/components/loaders.jd
index ddd513b..7c4baa8 100644
--- a/docs/html/guide/components/loaders.jd
+++ b/docs/html/guide/components/loaders.jd
@@ -21,14 +21,14 @@
</ol>
</li>
</ol>
-
+
<h2>Key classes</h2>
<ol>
<li>{@link android.app.LoaderManager}</li>
<li>{@link android.content.Loader}</li>
- </ol>
-
+ </ol>
+
<h2>Related samples</h2>
<ol>
<li> <a
@@ -53,7 +53,7 @@
recreated after a configuration change. Thus, they don't need to re-query their
data.</li>
</ul>
-
+
<h2 id="summary">Loader API Summary</h2>
<p>There are multiple classes and interfaces that may be involved in using
@@ -131,10 +131,10 @@
load data from some other source.</li>
<li>An implementation for {@link android.app.LoaderManager.LoaderCallbacks}.
This is where you create new loaders and manage your references to existing
-loaders.</li>
+loaders.</li>
<li>A way of displaying the loader's data, such as a {@link
android.widget.SimpleCursorAdapter}.</li>
- <li>A data source, such as a {@link android.content.ContentProvider}, when using a
+ <li>A data source, such as a {@link android.content.ContentProvider}, when using a
{@link android.content.CursorLoader}.</li>
</ul>
<h3 id="starting">Starting a Loader</h3>
@@ -142,7 +142,7 @@
<p>The {@link android.app.LoaderManager} manages one or more {@link
android.content.Loader} instances within an {@link android.app.Activity} or
{@link android.app.Fragment}. There is only one {@link
-android.app.LoaderManager} per activity or fragment.</p>
+android.app.LoaderManager} per activity or fragment.</p>
<p>You typically
initialize a {@link android.content.Loader} within the activity's {@link
@@ -159,13 +159,13 @@
<ul>
<li>A unique ID that identifies the loader. In this example, the ID is 0.</li>
<li>Optional arguments to supply to the loader at
-construction (<code>null</code> in this example).</li>
+construction (<code>null</code> in this example).</li>
<li>A {@link android.app.LoaderManager.LoaderCallbacks} implementation, which
the {@link android.app.LoaderManager} calls to report loader events. In this
example, the local class implements the {@link
android.app.LoaderManager.LoaderCallbacks} interface, so it passes a reference
-to itself, {@code this}.</li>
+to itself, {@code this}.</li>
</ul>
<p>The {@link android.app.LoaderManager#initLoader initLoader()} call ensures that a loader
is initialized and active. It has two possible outcomes:</p>
@@ -196,7 +196,7 @@
starts and stops loading when necessary, and maintains the state of the loader
and its associated content. As this implies, you rarely interact with loaders
directly (though for an example of using loader methods to fine-tune a loader's
-behavior, see the <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderThrottle.html"> LoaderThrottle</a> sample).
+behavior, see the <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderThrottle.html"> LoaderThrottle</a> sample).
You most commonly use the {@link
android.app.LoaderManager.LoaderCallbacks} methods to intervene in the loading
process when particular events occur. For more discussion of this topic, see <a
@@ -249,7 +249,7 @@
— Called when a previously created loader has finished its load.
</li></ul>
<ul>
- <li>{@link android.app.LoaderManager.LoaderCallbacks#onLoaderReset onLoaderReset()}
+ <li>{@link android.app.LoaderManager.LoaderCallbacks#onLoaderReset onLoaderReset()}
— Called when a previously created loader is being reset, thus making its
data unavailable.
</li>
@@ -344,11 +344,11 @@
<h4 id="onLoaderReset">onLoaderReset</h4>
-<p>This method is called when a previously created loader is being reset, thus
+<p>This method is called when a previously created loader is being reset, thus
making its data unavailable. This callback lets you find out when the data is
about to be released so you can remove your reference to it. </p>
-<p>This implementation calls
-{@link android.widget.SimpleCursorAdapter#swapCursor swapCursor()}
+<p>This implementation calls
+{@link android.widget.SimpleCursorAdapter#swapCursor swapCursor()}
with a value of <code>null</code>:</p>
<pre>
@@ -370,7 +370,7 @@
android.app.Fragment} that displays a {@link android.widget.ListView} containing
the results of a query against the contacts content provider. It uses a {@link
android.content.CursorLoader} to manage the query on the provider.</p>
-
+
<p>For an application to access a user's contacts, as shown in this example, its
manifest must include the permission
{@link android.Manifest.permission#READ_CONTACTS READ_CONTACTS}.</p>
diff --git a/docs/html/guide/components/processes-and-threads.jd b/docs/html/guide/components/processes-and-threads.jd
index 7bb3c65..2507998 100644
--- a/docs/html/guide/components/processes-and-threads.jd
+++ b/docs/html/guide/components/processes-and-threads.jd
@@ -121,7 +121,7 @@
<ul>
<li>It hosts an {@link android.app.Activity} that is not in the foreground, but is still
-visible to the user (its {@link android.app.Activity#onPause onPause()} method has been called).
+visible to the user (its {@link android.app.Activity#onPause onPause()} method has been called).
This might occur, for example, if the foreground activity started a dialog, which allows the
previous activity to be seen behind it.</li>
diff --git a/docs/html/guide/practices/index.jd b/docs/html/guide/practices/index.jd
index b61272b..f34a6ba 100644
--- a/docs/html/guide/practices/index.jd
+++ b/docs/html/guide/practices/index.jd
@@ -1,7 +1,7 @@
page.title=Best Practices
excludeFromSuggestions=true
page.landing=true
-page.landing.intro=Design and build apps the right way. Learn how to create apps that look great and perform well on as many devices as possible, from phones to tablets and more.
+page.landing.intro=Design and build apps the right way. Learn how to create apps that look great and perform well on as many devices as possible, from phones to tablets and more.
page.landing.image=
@jd:body
@@ -10,20 +10,20 @@
<div class="col-12">
<h3>Blog Articles</h3>
-
+
<a href="http://android-developers.blogspot.com/2010/10/improving-app-quality.html">
<h4>Improving App Quality</h4>
<p>One way of improving your app’s visibility in the ecosystem is by deploying well-targeted
mobile advertising campaigns and cross-app promotions. However, there’s another time-tested method
of fueling the impression-install-ranking cycle: improve the product!</p>
</a>
-
+
<a href="http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html">
<h4>Say Goodbye to the Menu Button</h4>
<p>As Ice Cream Sandwich rolls out to more devices, it's important that you begin to migrate
your designs to the action bar in order to promote a consistent Android user experience.</p>
</a>
-
+
<a href="http://android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html">
<h4>New Tools For Managing Screen Sizes</h4>
<p>Android 3.2 includes new tools for supporting devices with a wide range of screen sizes.
@@ -31,14 +31,14 @@
tablet. This release also offers several new APIs to simplify developers’ work in adjusting to
different screen sizes.</p>
</a>
-
+
<a href="http://android-developers.blogspot.com/2011/03/identifying-app-installations.html">
<h4>Identifying App Installations</h4>
<p>It is very common, and perfectly reasonable, for a developer to want to track individual
installations of their apps. It sounds plausible just to call TelephonyManager.getDeviceId() and use
that value to identify the installation. There are problems with this</p>
</a>
-
+
<a
href="http://android-developers.blogspot.com/2011/11/making-android-games-that-play-nice.html">
<h4>Making Android Games that Play Nice</h4>
@@ -46,7 +46,7 @@
often multi-core, multi-purpose system like Android is trickier. Even the best developers frequently
make mistakes in the way they interact with the Android system and with other applications</p>
</a>
-
+
</div>
diff --git a/docs/html/guide/practices/optimizing-for-3.0.jd b/docs/html/guide/practices/optimizing-for-3.0.jd
index 8d07eb9..db45e19 100644
--- a/docs/html/guide/practices/optimizing-for-3.0.jd
+++ b/docs/html/guide/practices/optimizing-for-3.0.jd
@@ -4,7 +4,7 @@
<div id="deprecatedSticker">
- <a href="#"
+ <a href="#"
onclick="$('#naMessage').show();$('#deprecatedSticker').hide();return false">
<strong>This doc is deprecated</strong></a>
</div>
@@ -181,7 +181,7 @@
<li>Perform your usual tests to be sure everything works and looks as expected.</li>
</ol>
</li>
-
+
<li><b>Apply the new "holographic" theme to your application</b>
<ol>
<li>Open your manifest file and update the <a
@@ -191,7 +191,7 @@
android:targetSdkVersion}</a> to {@code "11"}. For example:
<pre>
<manifest ... >
- <uses-sdk android:minSdkVersion="4"
+ <uses-sdk android:minSdkVersion="4"
android:targetSdkVersion="11" />
<application ... >
...
@@ -446,7 +446,7 @@
GridView.</li>
<li><a
href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderThrottle.html">
-Content Loaders</a>: An example using new Loader APIs to asynchronously load data.</li>
+Content Loaders</a>: An example using new Loader APIs to asynchronously load data.</li>
<li><a
href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html">
Property Animation</a>: Several samples using the new animation APIs to animate object
@@ -624,7 +624,7 @@
application can function in landscape. Even if you want to avoid rotating the screen while your
application is running, you should not assume that portrait is the device's default orientation. You
should either ensure that your layout is usable in both portrait and landscape orientations or
-provide an <a href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources"
+provide an <a href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources"
>alternative layout resource</a> for landscape orientation.</p>
<p>If you believe your application or game provides its best experience when the screen is tall,
diff --git a/docs/html/guide/practices/screen-compat-mode.jd b/docs/html/guide/practices/screen-compat-mode.jd
index 34580ba..18a089e 100644
--- a/docs/html/guide/practices/screen-compat-mode.jd
+++ b/docs/html/guide/practices/screen-compat-mode.jd
@@ -75,7 +75,7 @@
href="{@docRoot}guide/topics/manifest/supports-screens-element.html#resizeable">{@code
android:resizeable}</a> to {@code "true"}.</p>
</dd>
-
+
<dt>Version 2 (Android 3.2 and greater)</dt>
<dd>The system draws the application's layout the same as
it would on a normal size handset (approximately emulating a 320dp x 480dp screen), then scales it
@@ -151,9 +151,9 @@
system will always resize your layout to fit the screen. This works regardless of what values
you've set in the <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a>
-attributes.</p>
+attributes.</p>
</li>
-
+
<li><strong>Easy but has other effects:</strong>
<p>In your manifest's <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a>
diff --git a/docs/html/guide/practices/screens_support.jd b/docs/html/guide/practices/screens_support.jd
index 2223dbf..ea9f988 100644
--- a/docs/html/guide/practices/screens_support.jd
+++ b/docs/html/guide/practices/screens_support.jd
@@ -139,7 +139,7 @@
<p>The density-independent pixel is equivalent to one physical pixel on a 160 dpi screen, which is
the baseline density assumed by the system for a "medium" density screen. At runtime, the system
transparently handles any scaling of the dp units, as necessary, based on the actual density of the
-screen in use. The conversion of dp units to screen pixels is simple:
+screen in use. The conversion of dp units to screen pixels is simple:
<nobr><code>px = dp * (dpi / 160)</code></nobr>.
For example, on a 240 dpi screen, 1 dp equals 1.5 physical pixels. You should always use dp units
when defining your application's UI, to ensure proper display of your UI on screens with different
@@ -214,7 +214,7 @@
</ul>
<p class="note"><strong>Note:</strong> These minimum screen sizes were not as well defined prior to
-Android 3.0, so you may encounter some devices that are mis-classified between normal and large.
+Android 3.0, so you may encounter some devices that are mis-classified between normal and large.
These are also based on the physical resolution of the screen, so may vary across devices—for
example a 1024x720 tablet with a system bar actually has a bit less space available to the
application due to it being used by the system bar.</p>
@@ -904,7 +904,7 @@
manifest element:</p>
<dl>
-
+
<dt><a
href="{@docRoot}guide/topics/manifest/supports-screens-element.html#requiresSmallest">
{@code android:requiresSmallestWidthDp}</a></dt>
diff --git a/docs/html/guide/practices/tablets-and-handsets.jd b/docs/html/guide/practices/tablets-and-handsets.jd
index 85327b6..a1bafd3 100644
--- a/docs/html/guide/practices/tablets-and-handsets.jd
+++ b/docs/html/guide/practices/tablets-and-handsets.jd
@@ -89,7 +89,7 @@
</li>
- <li><strong>Use the action bar</strong>, but follow best practices and ensure your design
+ <li><strong>Use the action bar</strong>, but follow best practices and ensure your design
is flexible enough for the system to adjust the action bar layout based on the screen size.
<p>The {@link android.app.ActionBar} is a UI component for activities that replaces the traditional
diff --git a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
index f6669e4..b66fdd4 100644
--- a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
@@ -8,7 +8,7 @@
<div id="deprecatedSticker">
- <a href="#"
+ <a href="#"
onclick="$('#naMessage').show();$('#deprecatedSticker').hide();return false">
<strong>This doc is deprecated</strong></a>
</div>
@@ -105,7 +105,7 @@
<p>
It illustrates activities and tasks with examples, and describes some
of their underlying principles and mechanisms, such as navigation,
- multitasking, activity re-use, intents, and the activity stack.
+ multitasking, activity re-use, intents, and the activity stack.
The document also highlights design decisions that are available to you
and what control they give you over the UI of your application.
</p>
@@ -146,7 +146,7 @@
<p>
An Android <em>application</em> typically consists of one or more
- related, loosely bound activities <!--(and possibly
+ related, loosely bound activities <!--(and possibly
<a href=#services_broadcast_receivers title="other components">other
components</a>)--> for the user to interact with, typically bundled up
in a single file (with an .apk suffix). Android ships with a rich set
@@ -186,10 +186,10 @@
seamless, activity after activity, <a href="#tasks">task</a> after
task.
</p>
-
+
<p>
An activity handles a particular type of content (data) and accepts a
- set of related user actions. Each activity has a
+ set of related user actions. Each activity has a
<a href="{@docRoot}guide/components/activities.html#Lifecycle">lifecycle</a> that is
independent of the other
activities in its application or task — each activity is
@@ -283,7 +283,7 @@
to the activity stack, so that pressing <em>Back</em> displays the previous
activity on the stack. However, the user cannot use the <em>Back</em> button to go
back further than the last visit to Home. The adding of an activity to
- the current stack happens whether or not that activity begins a new
+ the current stack happens whether or not that activity begins a new
<a href=#tasks title=task>task</a> (as long as that task was started
without going Home), so going back can let the user go back to
activities in previous tasks. The user can get to tasks earlier than
@@ -297,7 +297,7 @@
designing the navigation, if you have screen A and you want the user
to be able go to a subsequent screen B and then use the <em>Back</em> button to go
back to screen A, then the screen A needs to be implemented as an
- activity. The one exception to this rule is if your application
+ activity. The one exception to this rule is if your application
<a href="#taking_over_back_key">takes control of the <em>Back</em> button</a> and manages the
navigation
itself.
@@ -340,7 +340,7 @@
Send a text message with an attachment
</li>
<li>
- View a YouTube video and share it by email with someone else
+ View a YouTube video and share it by email with someone else
</li>
</ul>
@@ -666,7 +666,7 @@
mailto:info@example.com link, they are actually initiating an Intent
object, or just an <em>intent</em>, which then gets resolved to a
particular component (we consider only activity components here).
- So, the result of a user touching a mailto: link is an Intent object
+ So, the result of a user touching a mailto: link is an Intent object
that the system tries to match to an activity. If that Intent object was
written explicitly naming an activity (an <em>explicit intent</em>),
then the system immediately launches that activity in response to the user
@@ -925,7 +925,7 @@
For instance, you could disable the user control that initiates
the Intent object, or display a message to the user that lets them go
to a location, such as Google Play, to download its application.
- In this way, your code can start the activity (using either startActivity()
+ In this way, your code can start the activity (using either startActivity()
or startActivityForResult()) only if the intent has tested to resolve
to an activity that is actually present.
</p>
@@ -947,7 +947,7 @@
launcher</em> (typically implemented as a sliding drawer on the
Home screen), or from a shortcut icon on the Home screen, or
from the task switcher. (The mechanism for this is for the
- activity to have an
+ activity to have an
<a href={@docRoot}guide/components/intents-filters.html>intent filter</a> with action
MAIN and
category LAUNCHER.)
@@ -1103,7 +1103,7 @@
activity to be run.
</p>
-
+
<h3 id="notifications_get_back_tip">Notifications and App Widgets should provide consistent back behavior</h3>
<p>
Notifications and app widgets are two common ways that a user can launch
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design.jd b/docs/html/guide/practices/ui_guidelines/icon_design.jd
index 0726660..6b546c9 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design.jd
@@ -58,7 +58,7 @@
<div class="note design">
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>Check out the new documents for designers at <strong><a
href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
@@ -72,13 +72,13 @@
<p>This document provides information to help you create icons for various parts
of your application’s user interface that match the general styles used by the
-Android 2.x framework. Following these guidelines will help you to create a
+Android 2.x framework. Following these guidelines will help you to create a
polished and unified experience for the user.</p>
<p>The following documents discuss detailed guidelines for the common types of
icons used throughout Android applications:</p>
-<dl>
+<dl>
<dt><strong><a href="icon_design_launcher.html">Launcher Icons</a></strong></dt>
<dd>A Launcher icon is a graphic that represents your application on the
device's Home screen and in the Launcher window.</dd>
@@ -103,7 +103,7 @@
graphically represent list items. An example is the Settings application.</dd>
</dl>
-<p>To get started creating your icons more quickly, you can download
+<p>To get started creating your icons more quickly, you can download
the Android Icon Templates Pack.</p>
@@ -142,7 +142,7 @@
<p>Android is designed to run on a variety of devices that offer a range of
screen sizes and resolutions. When you design the icons for your application,
it's important keep in mind that your application may be installed on any of
-those devices. As described in the <a
+those devices. As described in the <a
href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
Screens</a> document, the Android platform makes it straightforward for you to
provide icons in such a way that they will be displayed properly on any device,
@@ -158,7 +158,7 @@
href="{@docRoot}guide/practices/screens_support.html#qualifiers">Resource
directory qualifiers for screen size and density</a>. </p>
-<p>For tips on how to create and manage icon sets for multiple densities, see
+<p>For tips on how to create and manage icon sets for multiple densities, see
<a href="#design-tips">Tips for Designers</a>.</p>
@@ -290,7 +290,7 @@
cleaner to tweak the icons when you scale the artboard down to the target
sizes for final asset creation.</p>
-
+
<h3>When scaling, redraw bitmap layers as needed</h3>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd b/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd
index 831de45..37657f4 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_action_bar.jd
@@ -31,7 +31,7 @@
</div>
<div class="note design">
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>Check out the new documents for designers at <strong><a
href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd b/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd
index c958ed9..a7ee73f 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_dialog.jd
@@ -29,7 +29,7 @@
</div>
<div class="note design">
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>Check out the new documents for designers at <strong><a
href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
index f47e186..3bb1a62 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
@@ -28,7 +28,7 @@
<div class="note design">
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>Check out the new documents for designers at <strong><a
href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
index 2df3a22..483e076 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
@@ -95,7 +95,7 @@
share with others on the device. Figure 1, at right, provides examples. </p>
<div class="figure">
- <img src="{@docRoot}images/icon_design/IconGraphic_Icons_i.png"
+ <img src="{@docRoot}images/icon_design/IconGraphic_Icons_i.png"
width="340">
<p class="img-caption">
<strong>Figure 1.</strong> Example launcher icons for Android 2.0 and
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_list.jd b/docs/html/guide/practices/ui_guidelines/icon_design_list.jd
index 29e1a93..fa350bc 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_list.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_list.jd
@@ -30,7 +30,7 @@
<div class="note design">
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>Check out the new documents for designers at <strong><a
href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd b/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd
index a5b3597..25b23d0 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_menu.jd
@@ -34,7 +34,7 @@
<div class="note design">
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>Check out the new documents for designers at <strong><a
href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
@@ -267,7 +267,7 @@
appropriate. For example, in Figure 3 the logical place for rounded corners is
the roof and not the rest of the building.</span></li>
-<li>All dimensions specified on this page are based on a 48x48 pixel artboard
+<li>All dimensions specified on this page are based on a 48x48 pixel artboard
size with a 6 pixel safeframe.</li>
<li>The menu icon effect (the outer glow) described in <a
@@ -277,7 +277,7 @@
<li><strong>Final art must be exported as a transparent PNG file.</strong></li>
-<li>Templates for creating menu icons in Adobe Photoshop are available in the
+<li>Templates for creating menu icons in Adobe Photoshop are available in the
Icon Templates Pack.</li>
</ul>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd b/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd
index 4993adb..27df450 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_status_bar.jd
@@ -42,7 +42,7 @@
<div class="note design">
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>Check out the new documents for designers at <strong><a
href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd b/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd
index cbe6706..308e6d0 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_tab.jd
@@ -34,7 +34,7 @@
<div class="note design">
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>Check out the new documents for designers at <strong><a
href="{@docRoot}design/index.html">Android Design</a></strong>, including more guidelines
for <a href="{@docRoot}design/style/iconography.html">Iconography</a>.</p>
@@ -291,10 +291,10 @@
the Android platform.</p>
<p class="warning"><strong>Warning:</strong>
-Because these resources can change between platform versions, you
+Because these resources can change between platform versions, you
should not reference the system's copy of the resources. If you want to
use any icons or other internal drawable resources, you should store a
-local copy of those icons or drawables in your application resources,
+local copy of those icons or drawables in your application resources,
then reference the local copy from your application code. In that way, you can
maintain control over the appearance of your icons, even if the system's
copy changes. Note that the grid below is not intended to be complete.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/index.jd b/docs/html/guide/practices/ui_guidelines/index.jd
index 91a0725..713109c 100644
--- a/docs/html/guide/practices/ui_guidelines/index.jd
+++ b/docs/html/guide/practices/ui_guidelines/index.jd
@@ -7,7 +7,7 @@
<div class="note design" style="background:none;overflow:auto;padding:10px 5px">
<a href="{@docRoot}design/index.html"><img src="{@docRoot}images/home/android-design.png" alt=""
style="float:left;margin:0 1em 0 0;"/></a>
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>The Android UX team has put together a set of guidelines for the interaction and
visual design of Android applications. The new collection provides an overview of
Android styles, design patterns, building blocks for exceptional Android designs, and more.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/menu_design.jd b/docs/html/guide/practices/ui_guidelines/menu_design.jd
index bf87bdd..9497525 100644
--- a/docs/html/guide/practices/ui_guidelines/menu_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/menu_design.jd
@@ -8,7 +8,7 @@
<div id="deprecatedSticker">
- <a href="#"
+ <a href="#"
onclick="$('#naMessage').show();$('#deprecatedSticker').hide();return false">
<strong>This doc is deprecated</strong></a>
</div>
@@ -16,7 +16,7 @@
<div id="naMessage" style="display:block">
<div><p><strong>This document has been deprecated.</strong></p>
- <p>For design guidelines about adding user actions and other options, read the design guidelines
+ <p>For design guidelines about adding user actions and other options, read the design guidelines
for <a href="{@docRoot}design/patterns/actionbar.html">Action Bar</a> or the developer guide about
<a href="{@docRoot}guide/topics/ui/menus.html">Menus</a>.</p>
@@ -25,7 +25,7 @@
onclick="$('#naMessage').hide();$('#deprecatedSticker').show()" />
</div>
</div>
-
+
@@ -37,7 +37,7 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>Quickview</h2>
<ul>
@@ -85,15 +85,15 @@
</ol>
</div>
-</div>
+</div>
<p>
A menu holds a set of commands (user actions) that are normally hidden, and
are accessible by a button, key, or gesture. Menu commands provide a means
- for performing operations and for navigating to other parts of your
+ for performing operations and for navigating to other parts of your
application or other applications. Menus are useful for freeing screen space,
as an alternative to placing functionality and navigation, in buttons or other
- user controls in the content area of your application.
+ user controls in the content area of your application.
</p>
<p>
@@ -102,7 +102,7 @@
the functionality and navigation for your application. Briefly:
<ul>
<li>The <em>Options menu</em> contains primary functionality that applies
- globally to the current activity or starts a related activity.
+ globally to the current activity or starts a related activity.
It is typically invoked by a user pressing a hard button, often labeled <em>Menu</em>.</li>
<li>The <em>Context menu</em> contains secondary functionality for the currently
selected item. It is typically invoked by a user's touch & hold
@@ -113,11 +113,11 @@
<p>
All but the simplest applications have menus. The system automatically
- lays the menus out and provides standard ways for users to access them.
+ lays the menus out and provides standard ways for users to access them.
In this sense, they are familiar and dependable ways for users to access
functionality across all applications. All menus are panels that "float"
on top of the activity screen and are smaller than full screen, so that the
- application is still visible around its edges. This is a visual reminder
+ application is still visible around its edges. This is a visual reminder
that a menu is an intermediary operation that disappears once it's used.
</p>
@@ -127,8 +127,8 @@
<h2 id="tour_of_the_menus">Tour of the Menus</h2>
-<p class="note"><strong>Note:</strong> Your menus and screens might not look
-like those shown in this document; they may vary from one version of Android
+<p class="note"><strong>Note:</strong> Your menus and screens might not look
+like those shown in this document; they may vary from one version of Android
or device to another.
</p>
@@ -137,13 +137,13 @@
<p>
The Options menu contains commands that apply globally across the current
activity, or can start another activity. They do not apply to a selected
- item in the content (a <a href="#context_menu">Context menu</a> does that).
+ item in the content (a <a href="#context_menu">Context menu</a> does that).
</p>
<p>
- On most devices, a user presses the <em>Menu</em> button to access the Options menu,
- as shown in the screenshot below. To close the menu, the user presses
- <em>Menu</em> again, or presses the <em>Back</em> button.
+ On most devices, a user presses the <em>Menu</em> button to access the Options menu,
+ as shown in the screenshot below. To close the menu, the user presses
+ <em>Menu</em> again, or presses the <em>Back</em> button.
In fact, to cancel out of any menu, press the <em>Back</em> button. (Pressing the <em>Menu</em>
button or touching outside the menu also works.) Note that how to invoke this
menu may be different on different devices.
@@ -153,15 +153,15 @@
Each
<a href="{@docRoot}guide/practices/ui_guidelines/activity_task_design.html#activities">activity</a>
activity has its own set of operations and therefore its own Options menu.
- An application with multiple activities would have a different Options menu
- for each activity.
+ An application with multiple activities would have a different Options menu
+ for each activity.
</p>
<p>
For example, in the message list view of an email program, the Options menu
- might let you search the messages, compose a new message, refresh the list,
- or change the email settings. The compose view of an email program would
- have a different Options menu, such as adding a CC field, attaching a file,
+ might let you search the messages, compose a new message, refresh the list,
+ or change the email settings. The compose view of an email program would
+ have a different Options menu, such as adding a CC field, attaching a file,
or discarding the message.
</p>
@@ -179,7 +179,7 @@
<li>
<b>Options expanded menu</b> - If the activity has more menu items than will
fit on the icon menu, then the last icon is labeled "More" — selecting it
- displays a list that can contain any number of menu items and will scroll
+ displays a list that can contain any number of menu items and will scroll
as necessary.
</li>
</ul>
@@ -202,18 +202,18 @@
<p>
A user can touch & hold on content on the screen to
- access a Context menu (if one exists), as shown in the screenshot below.
+ access a Context menu (if one exists), as shown in the screenshot below.
A Context menu is a list of menu items (commands) that can operate
on the selected content. The command can either be part of the current
- activity, or the system can pass the selected content along to
- an operation in another activity (by way of an
+ activity, or the system can pass the selected content along to
+ an operation in another activity (by way of an
<a href="{@docRoot}guide/practices/ui_guidelines/activity_task_design.html#intents">intent</a>).
</p>
<p>
For example, in an email message list, a user can touch & hold on
an email message to open a Context menu containing commands to read,
- archive, or delete the message.
+ archive, or delete the message.
</p>
<p id="location">
@@ -231,7 +231,7 @@
In the above example, if the user performs touch & hold on the contact
"Obi Wan Kenobi", a Context menu opens. The commands provided in
this Context menu are the complete set of actions that can be performed
- on this contact.
+ on this contact.
</p>
<p>
@@ -246,7 +246,7 @@
<p>
Also note, as shown in the following screenshot, the Context menu and the
next screen both hold the same complete set of commands that can be performed
- on this contact. The Context menu displays the commands in a list,
+ on this contact. The Context menu displays the commands in a list,
while the "View contact" activity splits them into various items in the
Options menu, icon buttons and list items.
</p>
@@ -268,10 +268,10 @@
<h4>Text Commands in Context Menu</h4>
<p>
- Text links and text fields in the content both have system-provided operations
+ Text links and text fields in the content both have system-provided operations
that are common across all applications: operations such as "Select all", "Select text",
- "Copy all", and "Add to dictionary". If the text field is editable, it also
- has other operations, such as "Cut all" and "Input Method", and if text
+ "Copy all", and "Add to dictionary". If the text field is editable, it also
+ has other operations, such as "Cut all" and "Input Method", and if text
is also on the clipboard, it has "Paste". The system automatically inserts
the appropriate menu items into the Context menu of text links and text
fields, as shown in the following screenshot.
@@ -342,7 +342,7 @@
An example of a selection-specific Context menu is when a user performs a
touch & hold on a person's name in a list view of a contacts application.
The Context menu would typically contain commands "View contact", "Call contact",
- and "Edit contact".
+ and "Edit contact".
</p>
<h3 id="most_frequently_used">Place the most frequently used operations first</h3>
@@ -365,7 +365,7 @@
<h3 id="dont_put_commands">Don't put commands <em>only</em> in a Context menu</h3>
<p>
- If a user can fully access your application without using Context menus,
+ If a user can fully access your application without using Context menus,
then it's designed properly! In general, if part of your application is inaccessible
without using Context menus, then you need to duplicate those commands elsewhere.
</p>
@@ -373,8 +373,8 @@
<p>
Before opening a Context menu, it has no visual representation that identifies
its presence (whereas the Options menu has the <em>Menu</em> button), and so is not
- particularly discoverable.
- Therefore, in general, a Context menu should <em>duplicate</em> commands
+ particularly discoverable.
+ Therefore, in general, a Context menu should <em>duplicate</em> commands
found in the corresponding activity screen. For example, while it's useful to
let the user call a phone number from a Context menu invoked by touch
& hold on a name in a list of contacts, that operation should <em>also</em>
@@ -388,7 +388,7 @@
As described under <a href="#context_menu_shortcut">shortcut</a>,
touching on an item in the content should activate the same command as touching
the first item in the Context menu. Both cases should be the most intuitive
- operation for that item.
+ operation for that item.
</p>
<h3 id="selecting_content_item">Selecting an item in the content should perform the most intuitive operation</h3>
@@ -427,13 +427,13 @@
<h3 id="context_menu_should_identify">A Context menu should identify the selected item</h3>
<p>
- When a user does touch & hold on an item, the Context menu should
- contain the name of the selected item. Therefore,
+ When a user does touch & hold on an item, the Context menu should
+ contain the name of the selected item. Therefore,
when creating a Context menu, be sure to include a title and the name of the
- selected item so that it's clear to the user what the context is.
+ selected item so that it's clear to the user what the context is.
For example, if a user selects a contact "Joan of Arc", put that name in the
title of the Context menu (using
- {@link android.view.ContextMenu#setHeaderTitle(java.lang.CharSequence) setHeaderTitle}).
+ {@link android.view.ContextMenu#setHeaderTitle(java.lang.CharSequence) setHeaderTitle}).
Likewise, a command to edit the contact should be called "Edit contact",
not just "Edit".
</p>
@@ -442,7 +442,7 @@
<h3 id="most_important_commands">Put only the most important commands fixed on the screen</h3>
<p>
- By putting commands in menus, you free up the screen to hold more content.
+ By putting commands in menus, you free up the screen to hold more content.
On the other hand, fixing commands in the content area of an activity
makes them more prominent and easy to use.
</p>
@@ -456,7 +456,7 @@
To give a command the highest prominence, ensuring the command is obvious and won't be overlooked.<br>
Example: A "Buy" button in a store application.
</li>
- <li>
+ <li>
When quick access to the command is important and going to the menu would be
tedious or slow.<br>
Example: Next/Previous buttons or Zoom In/Out buttons in an image viewing application.
@@ -494,7 +494,7 @@
When a dialog is displayed, pressing the <em>Menu</em> button should do nothing. This also holds
true
for activities that look like dialogs. A dialog box is recognizable by being
- smaller than full-screen, having zero to three buttons, is non-scrollable, and
+ smaller than full-screen, having zero to three buttons, is non-scrollable, and
possibly a list of selectable items that can include checkboxes or radio buttons.
<!--For examples of dialogs, see Text Guidelines.-->
</p>
@@ -520,12 +520,12 @@
<p>
Sometimes a menu item's action cannot be performed — for example,
- the "Forward" button in a browser cannot work until after the "Back"
+ the "Forward" button in a browser cannot work until after the "Back"
button has been pressed. We recommend:
</p>
<ul>
- <li>
+ <li>
<b>In Options menu</b> - disable the menu item, which dims the text and icon,
turning it gray. This applies to menu items in both the icon menu and the
"More" menu. It would be disorienting for the icon menu to change from 6
diff --git a/docs/html/guide/practices/ui_guidelines/widget_design.jd b/docs/html/guide/practices/ui_guidelines/widget_design.jd
index cf2cd64..95c594d 100644
--- a/docs/html/guide/practices/ui_guidelines/widget_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/widget_design.jd
@@ -46,7 +46,7 @@
<div class="note design">
-<p><strong>New Guides for App Designers!</strong></p>
+<p><strong>New Guides for App Designers!</strong></p>
<p>Check out the new documents for designers at <strong><a
href="{@docRoot}design/index.html">Android Design</a></strong>.</p>
</div>
diff --git a/docs/html/guide/topics/admin/device-admin.jd b/docs/html/guide/topics/admin/device-admin.jd
index e2fef04..2a8583a 100644
--- a/docs/html/guide/topics/admin/device-admin.jd
+++ b/docs/html/guide/topics/admin/device-admin.jd
@@ -135,60 +135,60 @@
combination of letters and numbers. They may include symbolic characters.
</td>
</tr>
-
+
<tr>
<td>Complex password required</td>
<td>Requires that passwords must contain at least a letter, a numerical digit, and a special symbol. Introduced in Android 3.0.
</td>
</tr>
-
-<tr>
+
+<tr>
<td>Minimum letters required in password</td> <td>The minimum number of
-letters required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
+letters required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
</tr>
-
-
- <tr>
- <td>Minimum lowercase letters required in password</td>
- <td>The minimum number of lowercase
-letters required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
+
+
+ <tr>
+ <td>Minimum lowercase letters required in password</td>
+ <td>The minimum number of lowercase
+letters required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
</tr>
-
- <tr>
- <td>Minimum non-letter characters required in password</td>
+
+ <tr>
+ <td>Minimum non-letter characters required in password</td>
<td>The minimum number of
-non-letter characters required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
-</tr>
-
-<tr>
- <td>Minimum numerical digits required in password</td>
- <td>The minimum number of numerical digits required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
+non-letter characters required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
</tr>
-<tr>
- <td>Minimum symbols required in password</td>
- <td>The minimum number of symbols required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
+<tr>
+ <td>Minimum numerical digits required in password</td>
+ <td>The minimum number of numerical digits required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
</tr>
-<tr>
- <td>Minimum uppercase letters required in password</td>
- <td>The minimum number of uppercase letters required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
+<tr>
+ <td>Minimum symbols required in password</td>
+ <td>The minimum number of symbols required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
</tr>
-<tr>
- <td>Password expiration timeout</td>
- <td>When the password will expire, expressed as a delta in milliseconds from when a device admin sets the expiration timeout. Introduced in Android 3.0.</td>
+<tr>
+ <td>Minimum uppercase letters required in password</td>
+ <td>The minimum number of uppercase letters required in the password for all admins or a particular one. Introduced in Android 3.0.</td>
</tr>
-<tr>
- <td>Password history restriction</td>
+<tr>
+ <td>Password expiration timeout</td>
+ <td>When the password will expire, expressed as a delta in milliseconds from when a device admin sets the expiration timeout. Introduced in Android 3.0.</td>
+</tr>
+
+<tr>
+ <td>Password history restriction</td>
<td>This policy prevents users from reusing the last <em>n</em> unique passwords.
This policy is typically used in conjunction with
{@link android.app.admin.DevicePolicyManager#setPasswordExpirationTimeout(android.content.ComponentName,long) setPasswordExpirationTimeout()}, which forces
users to update their passwords after a specified amount of time has elapsed.
-Introduced in Android 3.0.</td>
+Introduced in Android 3.0.</td>
</tr>
-
+
<tr>
<td>Maximum failed password attempts </td>
<td>Specifies how many times a user can enter the wrong password before the
@@ -203,18 +203,18 @@
need to enter their PIN or passwords again before they can use their devices and
access data. The value can be between 1 and 60 minutes.</td> </tr>
-<tr>
-<td>Require storage encryption</td>
-<td>Specifies that the storage area should be encrypted, if the device supports it.
+<tr>
+<td>Require storage encryption</td>
+<td>Specifies that the storage area should be encrypted, if the device supports it.
Introduced in Android 3.0.</td> </tr>
<tr>
<td>Disable camera</td>
-
+
<td>Specifies that the camera should be disabled. Note that this doesn't have
to be a permanent disabling. The camera can be enabled/disabled dynamically
based on context, time, and so on. Introduced in Android 4.0.</td>
-
+
</tr>
@@ -234,7 +234,7 @@
<p>The examples used in this document are based on the Device Administration API
sample, which is included in the SDK samples (available through the
-Android SDK Manager) and located on your system as
+Android SDK Manager) and located on your system as
<code><sdk_root>/ApiDemos/app/src/main/java/com/example/android/apis/app/DeviceAdminSample.java</code>.</p>
<p>The sample application offers a demo of device admin features. It presents users
@@ -250,8 +250,8 @@
<li>Set how many failed password attempts can occur before the device is wiped
(that is, restored to factory settings).</li>
<li>Set how long from now the password will expire.</li>
-<li>Set the password history length (<em>length</em> refers to number of old passwords stored in the history).
-This prevents users from reusing
+<li>Set the password history length (<em>length</em> refers to number of old passwords stored in the history).
+This prevents users from reusing
one of the last <em>n</em> passwords they previously used.</li>
<li>Specify that the storage area should be encrypted, if the device supports it.</li>
<li>Set the maximum amount of inactive time that can elapse before the device
@@ -259,7 +259,7 @@
<li>Make the device lock immediately.</li>
<li>Wipe the device's data (that is, restore factory settings).</li>
<li>Disable the camera.</li>
-
+
</ul>
@@ -454,8 +454,8 @@
<img src="{@docRoot}images/admin/device-admin-activate-prompt.png"/>
<p class="img-caption"><strong>Figure 2.</strong> Sample Application: Activating the Application</p>
-<p>Below is the code that gets executed when the user clicks the <strong>Enable Admin</strong> checkbox. This has the effect of triggering the
-{@link android.preference.Preference.OnPreferenceChangeListener#onPreferenceChange(android.preference.Preference, java.lang.Object) onPreferenceChange()}
+<p>Below is the code that gets executed when the user clicks the <strong>Enable Admin</strong> checkbox. This has the effect of triggering the
+{@link android.preference.Preference.OnPreferenceChangeListener#onPreferenceChange(android.preference.Preference, java.lang.Object) onPreferenceChange()}
callback. This callback is invoked when the value of this {@link android.preference.Preference} has been changed by the user and is about to be set and/or persisted. If the user is enabling the application, the display
changes to prompt the user to activate the device admin application, as shown in figure
2. Otherwise, the device admin application is disabled. </p>
@@ -556,7 +556,7 @@
<dt>{@link
android.app.admin.DevicePolicyManager#PASSWORD_QUALITY_COMPLEX}</dt><dd>The user
must have entered a password containing at least a letter, a numerical digit and
-a special symbol.</dd>
+a special symbol.</dd>
<dt>{@link
android.app.admin.DevicePolicyManager#PASSWORD_QUALITY_SOMETHING}</dt><dd>The
policy requires some kind
@@ -581,7 +581,7 @@
contents:</p>
<ul>
-<li>{@link android.app.admin.DevicePolicyManager#setPasswordMinimumLetters(android.content.ComponentName,int) setPasswordMinimumLetters()}</li>
+<li>{@link android.app.admin.DevicePolicyManager#setPasswordMinimumLetters(android.content.ComponentName,int) setPasswordMinimumLetters()}</li>
<li>{@link android.app.admin.DevicePolicyManager#setPasswordMinimumLowerCase(android.content.ComponentName,int) setPasswordMinimumLowerCase()}</li>
@@ -622,8 +622,8 @@
mDPM.setMaximumFailedPasswordsForWipe(mDeviceAdminSample, maxFailedPw);</pre>
<h5 id="expiration">Set password expiration timeout</h5>
-<p>Beginning with Android 3.0, you can use the
-{@link android.app.admin.DevicePolicyManager#setPasswordExpirationTimeout(android.content.ComponentName,long) setPasswordExpirationTimeout()}
+<p>Beginning with Android 3.0, you can use the
+{@link android.app.admin.DevicePolicyManager#setPasswordExpirationTimeout(android.content.ComponentName,long) setPasswordExpirationTimeout()}
method to set when a password will expire, expressed as a delta in milliseconds from when a device admin sets the expiration timeout. For example:</p>
<pre>DevicePolicyManager mDPM;
@@ -632,18 +632,18 @@
...
mDPM.setPasswordExpirationTimeout(mDeviceAdminSample, pwExpiration);
</pre>
-
+
<h5 id="history">Restrict password based on history</h5>
-<p>Beginning with Android 3.0, you can use the
-{@link android.app.admin.DevicePolicyManager#setPasswordHistoryLength(android.content.ComponentName,int) setPasswordHistoryLength()}
+<p>Beginning with Android 3.0, you can use the
+{@link android.app.admin.DevicePolicyManager#setPasswordHistoryLength(android.content.ComponentName,int) setPasswordHistoryLength()}
method to limit users'
ability to reuse old passwords. This method takes a <em>length</em>
parameter, which specifies how many old
passwords are stored. When this policy is active, users cannot enter a new
password that matches the last <em>n</em> passwords. This prevents
users from using the same password over and over. This policy is typically used
-in conjunction with
+in conjunction with
{@link android.app.admin.DevicePolicyManager#setPasswordExpirationTimeout(android.content.ComponentName,long) setPasswordExpirationTimeout()},
which forces users
to update their passwords after a specified amount of time has elapsed. </p>
@@ -705,7 +705,7 @@
<h4 id="storage">Storage encryption</h4>
<p>Beginning with Android 3.0, you can use the
-{@link android.app.admin.DevicePolicyManager#setStorageEncryption(android.content.ComponentName,boolean) setStorageEncryption()}
+{@link android.app.admin.DevicePolicyManager#setStorageEncryption(android.content.ComponentName,boolean) setStorageEncryption()}
method to set a policy requiring encryption of the storage area, where supported.</p>
<p>For example:</p>
diff --git a/docs/html/guide/topics/appwidgets/host.jd b/docs/html/guide/topics/appwidgets/host.jd
index 169e388..7b00019 100644
--- a/docs/html/guide/topics/appwidgets/host.jd
+++ b/docs/html/guide/topics/appwidgets/host.jd
@@ -4,7 +4,7 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>In this document</h2>
<ol>
<li><a href="#host-binding">Binding App Widgets</a>
@@ -32,58 +32,58 @@
access to content. If you're building a Home replacement or a similar app,
you can also allow the user to embed app widgets by implementing an
{@link android.appwidget.AppWidgetHost}.
-This is not something that most apps will ever need to do, but if you are
-creating your own host, it's important to understand the contractual obligations
+This is not something that most apps will ever need to do, but if you are
+creating your own host, it's important to understand the contractual obligations
a host implicitly agrees to.</p>
-<p>This document focuses on the responsibilities involved in implementing a custom
-{@link android.appwidget.AppWidgetHost}. For an example of how to implement an
+<p>This document focuses on the responsibilities involved in implementing a custom
+{@link android.appwidget.AppWidgetHost}. For an example of how to implement an
{@link android.appwidget.AppWidgetHost}, see the source code for the
-Android Home screen
+Android Home screen
<a href="https://android.googlesource.com/platform/packages/apps/Launcher2/+/master/src/com/android/launcher2/Launcher.java">
-Launcher</a>.
+Launcher</a>.
-<p>Here is an overview of key classes and concepts involved in implementing a custom
+<p>Here is an overview of key classes and concepts involved in implementing a custom
{@link android.appwidget.AppWidgetHost}:</p>
<ul>
- <li><strong>App Widget Host</strong>—
- The {@link android.appwidget.AppWidgetHost} provides the interaction
-with the AppWidget service for apps, like the home screen, that want to embed
-app widgets in their UI. An {@link android.appwidget.AppWidgetHost} must have
-an ID that is unique within the host's own package. This ID remains persistent
+ <li><strong>App Widget Host</strong>—
+ The {@link android.appwidget.AppWidgetHost} provides the interaction
+with the AppWidget service for apps, like the home screen, that want to embed
+app widgets in their UI. An {@link android.appwidget.AppWidgetHost} must have
+an ID that is unique within the host's own package. This ID remains persistent
across all uses of the host. The ID is typically a hard-coded value that you assign
in your application.</li>
-
+
<li><strong>App Widget ID</strong>—
- Each app widget instance is assigned a unique ID at the time of binding
-(see {@link android.appwidget.AppWidgetManager#bindAppWidgetIdIfAllowed bindAppWidgetIdIfAllowed()},
-discussed in more detail in <a href="#binding">Binding app widgets</a>).
-The unique ID is obtained by the host using {@link android.appwidget.AppWidgetHost#allocateAppWidgetId() allocateAppWidgetId()}. This ID is persistent across the lifetime of the widget,
-that is, until it is deleted from the host. Any host-specific state (such as the
-size and location of the widget) should be persisted by the hosting package and
+ Each app widget instance is assigned a unique ID at the time of binding
+(see {@link android.appwidget.AppWidgetManager#bindAppWidgetIdIfAllowed bindAppWidgetIdIfAllowed()},
+discussed in more detail in <a href="#binding">Binding app widgets</a>).
+The unique ID is obtained by the host using {@link android.appwidget.AppWidgetHost#allocateAppWidgetId() allocateAppWidgetId()}. This ID is persistent across the lifetime of the widget,
+that is, until it is deleted from the host. Any host-specific state (such as the
+size and location of the widget) should be persisted by the hosting package and
associated with the app widget ID.
</li>
-
- <li><strong>App Widget Host View</strong>—
- {@link android.appwidget.AppWidgetHostView} can be thought of as a frame
-that the widget is wrapped in whenever it needs to be displayed. An app widget
-is assigned to an {@link android.appwidget.AppWidgetHostView} every time the
+
+ <li><strong>App Widget Host View</strong>—
+ {@link android.appwidget.AppWidgetHostView} can be thought of as a frame
+that the widget is wrapped in whenever it needs to be displayed. An app widget
+is assigned to an {@link android.appwidget.AppWidgetHostView} every time the
widget is inflated by the host. </li>
<li><strong>Options Bundle</strong>—
-The {@link android.appwidget.AppWidgetHost} uses the options bundle to communicate
-information to the {@link android.appwidget.AppWidgetProvider} about how the
-widget is being displayed (for example, size range, and whether the widget is on
-a lockscreen or the home screen). This information allows the
-{@link android.appwidget.AppWidgetProvider} to tailor the widget's contents
+The {@link android.appwidget.AppWidgetHost} uses the options bundle to communicate
+information to the {@link android.appwidget.AppWidgetProvider} about how the
+widget is being displayed (for example, size range, and whether the widget is on
+a lockscreen or the home screen). This information allows the
+{@link android.appwidget.AppWidgetProvider} to tailor the widget's contents
and appearance based on how and where it is displayed.
-You use
+You use
{@link android.appwidget.AppWidgetHostView#updateAppWidgetOptions(android.os.Bundle) updateAppWidgetOptions()}
-and
+and
{@link android.appwidget.AppWidgetHostView#updateAppWidgetSize updateAppWidgetSize()}
-to modify an app widget's
-bundle. Both of these methods trigger a callback to the
+to modify an app widget's
+bundle. Both of these methods trigger a callback to the
{@link android.appwidget.AppWidgetProvider}.</p></li>
</ul>
@@ -98,15 +98,15 @@
<h3 id="binding-pre">Binding app widgets on Android 4.0 and lower</h3>
-<p>On devices running Android version 4.0 and lower, users add app widgets
-via a system activity that allows users to select a widget. This implicitly
-does a permission check—that is, by adding the app widget, the user is
-implicitly granting permission to your app to add app widgets to the host.
-Here is an example that illustrates
-this approach, taken from the original
-<a href="https://android.googlesource.com/platform/packages/apps/Launcher/+/master/src/com/android/launcher/Launcher.java">Launcher</a>. In this snippet, an event handler invokes
-{@link android.app.Activity#startActivityForResult(android.content.Intent,int) startActivityForResult()}
-with the request code {@code REQUEST_PICK_APPWIDGET} in response to a
+<p>On devices running Android version 4.0 and lower, users add app widgets
+via a system activity that allows users to select a widget. This implicitly
+does a permission check—that is, by adding the app widget, the user is
+implicitly granting permission to your app to add app widgets to the host.
+Here is an example that illustrates
+this approach, taken from the original
+<a href="https://android.googlesource.com/platform/packages/apps/Launcher/+/master/src/com/android/launcher/Launcher.java">Launcher</a>. In this snippet, an event handler invokes
+{@link android.app.Activity#startActivityForResult(android.content.Intent,int) startActivityForResult()}
+with the request code {@code REQUEST_PICK_APPWIDGET} in response to a
user action:</p>
<pre>
@@ -118,9 +118,9 @@
...
case AddAdapter.ITEM_APPWIDGET: {
...
- int appWidgetId =
+ int appWidgetId =
Launcher.this.mAppWidgetHost.allocateAppWidgetId();
- Intent pickIntent =
+ Intent pickIntent =
new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
pickIntent.putExtra
(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
@@ -135,7 +135,7 @@
app widget to your activity. In the following example, the activity responds
by calling {@code addAppWidget()} to add the app widget:</p>
-<pre>public final class Launcher extends Activity
+<pre>public final class Launcher extends Activity
implements View.OnClickListener, OnLongClickListener {
...
@Override
@@ -152,7 +152,7 @@
completeAddAppWidget(data, mAddItemCellInfo, !mDesktopLocked);
break;
}
- }
+ }
...
}
}</pre>
@@ -164,7 +164,7 @@
int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
String customWidget = data.getStringExtra(EXTRA_CUSTOM_WIDGET);
- AppWidgetProviderInfo appWidget =
+ AppWidgetProviderInfo appWidget =
mAppWidgetManager.getAppWidgetInfo(appWidgetId);
if (appWidget.configure != null) {
@@ -183,7 +183,7 @@
App Widget Configuration Activity</a>.</p>
<p>Once the app widget is ready, the next step is to do the
-actual work of adding it to the workspace. The
+actual work of adding it to the workspace. The
<a href="https://android.googlesource.com/platform/packages/apps/Launcher/+/master/src/com/android/launcher/Launcher.java">original Launcher</a> uses a method called {@code completeAddAppWidget()}
to do this.</p>
@@ -201,12 +201,12 @@
<p>But this is just the first step. At runtime the user must
explicitly grant permission to your app to allow it to add app widgets
to the host. To test whether your app has permission to add the widget,
-you use the
-{@link android.appwidget.AppWidgetManager#bindAppWidgetIdIfAllowed bindAppWidgetIdIfAllowed()}
-method.
+you use the
+{@link android.appwidget.AppWidgetManager#bindAppWidgetIdIfAllowed bindAppWidgetIdIfAllowed()}
+method.
If {@link android.appwidget.AppWidgetManager#bindAppWidgetIdIfAllowed bindAppWidgetIdIfAllowed()}
returns {@code false}, your app must display a dialog prompting the
-user to grant permission
+user to grant permission
("allow" or "always allow," to cover all future app widget additions).
This snippet gives an example of how to display the dialog:</p>
@@ -218,9 +218,9 @@
startActivityForResult(intent, REQUEST_BIND_APPWIDGET);
</pre>
-<p>The host also has to check whether the user added
+<p>The host also has to check whether the user added
an app widget that needs configuration. For more discussion of this topic,
-see
+see
<a href="{@docRoot}guide/topics/appwidgets/index.html#Configuring">Creating
an App Widget Configuration Activity</a>.</p>
@@ -229,23 +229,23 @@
<div class="sidebox-wrapper">
<div class="sidebox">
<h2>What Version are You Targeting?</h2>
- <p>The approach you use in implementing your host should depend on what Android version
-you're targeting. Many of the features described in this section were introduced
+ <p>The approach you use in implementing your host should depend on what Android version
+you're targeting. Many of the features described in this section were introduced
in 3.0 or later. For example:</p>
<ul>
<li>Android 3.0 (API Level 11) introduces auto-advance behavior for widgets.</li>
<li>Android 3.1 (API Level 12) introduces the ability to resize widgets.</li>
<li>Android 4.0 (API Level 15) introduces a change in padding policy that
-puts the responsibility on the
+puts the responsibility on the
host to manage padding.</li>
<li>Android 4.1 (API Level 16) adds an API that allows the widget provider
to get more detailed information about the environment in which its
widget instances are being hosted.</li>
-<li>Android 4.2 (API Level 17) introduces the options bundle and the
-{@link android.appwidget.AppWidgetManager#bindAppWidgetIdIfAllowed(int,android.content.ComponentName,android.os.Bundle) bindAppWidgetIdIfAllowed()}
+<li>Android 4.2 (API Level 17) introduces the options bundle and the
+{@link android.appwidget.AppWidgetManager#bindAppWidgetIdIfAllowed(int,android.content.ComponentName,android.os.Bundle) bindAppWidgetIdIfAllowed()}
method. It also introduces lockscreen widgets.</li>
</ul>
-<p>If you are targeting earlier devices, refer to the original
+<p>If you are targeting earlier devices, refer to the original
<a href="https://android.googlesource.com/platform/packages/apps/Launcher/+/master/src/com/android/launcher/Launcher.java">Launcher</a> as an example.
</div>
</div>
@@ -273,7 +273,7 @@
they can be properly displayed.</li>
<li>Every app widget specifies a minimum width and height in dps, as defined in the {@link android.appwidget.AppWidgetProviderInfo} metadata
-(using {@link android.appwidget.AppWidgetProviderInfo#minWidth android:minWidth} and
+(using {@link android.appwidget.AppWidgetProviderInfo#minWidth android:minWidth} and
{@link android.appwidget.AppWidgetProviderInfo#minHeight android:minHeight}).
Make sure that the widget is laid out with at least this many dps.
For example, many hosts align icons and widgets in a grid. In this scenario,
@@ -379,7 +379,7 @@
for your app—for example, if your host is a home screen, ensure
that the
{@link android.appwidget.AppWidgetProviderInfo#widgetCategory android:widgetCategory}
-attribute in the
+attribute in the
{@link android.appwidget.AppWidgetProviderInfo} metadata includes
the flag {@link android.appwidget.AppWidgetProviderInfo#WIDGET_CATEGORY_HOME_SCREEN}.
Similarly, for the lockscreen, ensure that field includes the flag {@link android.appwidget.AppWidgetProviderInfo#WIDGET_CATEGORY_KEYGUARD}. For more
diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd
index c9575e0..7d555ed 100644
--- a/docs/html/guide/topics/appwidgets/index.jd
+++ b/docs/html/guide/topics/appwidgets/index.jd
@@ -4,7 +4,7 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>In this document</h2>
<ol>
<li><a href="#Basics">The Basics</a></li>
@@ -21,7 +21,7 @@
Activity</a>
<ol>
<li><a href="#UpdatingFromTheConfiguration">Updating the App Widget
-from
+from
the Configuration Activity</a></li>
</ol>
</li>
@@ -33,7 +33,7 @@
collections
</a></li>
<li><a href="#fresh">Keeping Collection Data Fresh</a></li>
- </ol>
+ </ol>
</li>
</ol>
@@ -50,10 +50,10 @@
<p>App Widgets are miniature application views that can be embedded in other
applications
(such as the Home screen) and receive periodic updates. These views are
-referred
+referred
to as Widgets in the user interface,
and you can publish one with an App Widget provider. An application component
-that is
+that is
able to hold other App Widgets is called an App Widget host. The screenshot
below shows
the Music App Widget.</p>
@@ -85,14 +85,14 @@
<dd>Defines the basic methods that allow you to programmatically interface
with the App Widget,
based on broadcast events. Through it, you will receive broadcasts when the
-App Widget is updated,
+App Widget is updated,
enabled, disabled and deleted.</dd>
<dt>View layout</dt>
<dd>Defines the initial layout for the App Widget, defined in XML.</dd>
</dl>
<p>Additionally, you can implement an App Widget configuration Activity. This is
-an optional
+an optional
{@link android.app.Activity} that launches when the user adds your App Widget
and allows him or her
to modify App Widget settings at create-time.</p>
@@ -117,7 +117,7 @@
</pre>
<p>The <code><receiver></code> element requires the
-<code>android:name</code>
+<code>android:name</code>
attribute, which specifies the {@link android.appwidget.AppWidgetProvider} used
by the App Widget.</p>
@@ -133,7 +133,7 @@
necessary.</p>
<p>The <code><meta-data></code> element specifies the
-{@link android.appwidget.AppWidgetProviderInfo} resource and requires the
+{@link android.appwidget.AppWidgetProviderInfo} resource and requires the
following attributes:</p>
<ul>
<li><code>android:name</code> - Specifies the metadata name. Use
@@ -141,21 +141,21 @@
to identify the data as the {@link android.appwidget.AppWidgetProviderInfo}
descriptor.</li>
<li><code>android:resource</code> - Specifies the {@link
-android.appwidget.AppWidgetProviderInfo}
+android.appwidget.AppWidgetProviderInfo}
resource location.</li>
</ul>
<h2 id="MetaData">Adding the AppWidgetProviderInfo Metadata</h2>
-<p>The {@link android.appwidget.AppWidgetProviderInfo} defines the essential
+<p>The {@link android.appwidget.AppWidgetProviderInfo} defines the essential
qualities of an App Widget, such as its minimum layout dimensions, its initial
layout resource,
how often to update the App Widget, and (optionally) a configuration Activity to
launch at create-time.
Define the AppWidgetProviderInfo object in an XML resource using a single
<code><appwidget-provider></code> element and save it in the project's
-<code>res/xml/</code>
+<code>res/xml/</code>
folder.</p>
<p>For example:</p>
@@ -167,7 +167,7 @@
android:updatePeriodMillis="86400000"
android:previewImage="@drawable/preview"
android:initialLayout="@layout/example_appwidget"
- android:configure="com.example.android.ExampleAppWidgetConfigure"
+ android:configure="com.example.android.ExampleAppWidgetConfigure"
android:resizeMode="horizontal|vertical"
android:widgetCategory="home_screen">
</appwidget-provider>
@@ -206,33 +206,33 @@
<li>The <code>updatePeriodMillis</code> attribute defines how often the App
Widget framework should request an update from the {@link
-android.appwidget.AppWidgetProvider} by calling the
-{@link android.appwidget.AppWidgetProvider#onUpdate(android.content.Context,android.appwidget.AppWidgetManager,int[]) onUpdate()}
+android.appwidget.AppWidgetProvider} by calling the
+{@link android.appwidget.AppWidgetProvider#onUpdate(android.content.Context,android.appwidget.AppWidgetManager,int[]) onUpdate()}
callback method. The actual update
is not guaranteed to occur exactly on time with this value and we suggest
updating as infrequently as possible—perhaps no more than once an hour to
conserve the battery. You might also allow the user to adjust the frequency in a
configuration—some people might want a stock ticker to update every 15
-minutes, or maybe only four times a day.
+minutes, or maybe only four times a day.
<p class="note"><strong>Note:</strong> If the device is asleep when it
-is time for an update
+is time for an update
(as defined by <code>updatePeriodMillis</code>), then the device will
-wake up in order
+wake up in order
to perform the update. If you don't update more than once per hour, this
-probably won't
+probably won't
cause significant problems for the battery life. If, however, you need
-to update more
+to update more
frequently and/or you do not need to update while the device is asleep,
-then you can instead
+then you can instead
perform updates based on an alarm that will not wake the device. To do
-so, set an alarm with
+so, set an alarm with
an Intent that your AppWidgetProvider receives, using the {@link
-android.app.AlarmManager}.
+android.app.AlarmManager}.
Set the alarm type to either {@link
-android.app.AlarmManager#ELAPSED_REALTIME} or
+android.app.AlarmManager#ELAPSED_REALTIME} or
{@link android.app.AlarmManager#RTC}, which will only
deliver the alarm when the device is awake. Then set
-<code>updatePeriodMillis</code> to
+<code>updatePeriodMillis</code> to
zero (<code>"0"</code>).</p>
</li>
<li>The <code>initialLayout</code> attribute points to the layout resource
@@ -244,7 +244,7 @@
Widget properties. This is optional
(read <a href="#Configuring">Creating an App Widget Configuration
Activity</a> below).</li>
-
+
<li>The <code>previewImage</code> attribute specifies a preview of what the
app widget will look like after it's configured, which the user sees when
selecting the app widget. If not supplied, the user instead sees your
@@ -255,7 +255,7 @@
Image</a>. Introduced in Android 3.0.</li>
<li>The <code>autoAdvanceViewId</code> attribute specifies the view ID of the
-app widget subview that should be auto-advanced by the widget's host. Introduced in Android 3.0.</li>
+app widget subview that should be auto-advanced by the widget's host. Introduced in Android 3.0.</li>
<li>The <code>resizeMode</code> attribute specifies the rules by which a widget
can be resized. You use this attribute to make homescreen widgets
@@ -264,7 +264,7 @@
handles to change the size on the layout grid. Values for the
<code>resizeMode</code> attribute include "horizontal", "vertical", and "none".
To declare a widget as resizeable horizontally and vertically, supply the value
-"horizontal|vertical". Introduced in Android 3.1.</li>
+"horizontal|vertical". Introduced in Android 3.1.</li>
<li>The <code>minResizeHeight</code> attribute specifies the minimum height (in dps) to which
the widget can be resized. This field has no effect if it is greater than {@code minHeight} or if
@@ -296,7 +296,7 @@
below, but before you begin designing your App Widget, please read and
understand the
<a href="{@docRoot}guide/practices/ui_guidelines/widget_design.html">App Widget
-Design
+Design
Guidelines</a>.</p>
<p>Creating the App Widget layout is simple if you're
@@ -306,7 +306,7 @@
android.widget.RemoteViews},
which do not support every kind of layout or view widget.</p>
-<p>A RemoteViews object (and, consequently, an App Widget) can support the
+<p>A RemoteViews object (and, consequently, an App Widget) can support the
following layout classes:</p>
<ul class="nolist">
@@ -334,7 +334,7 @@
<p>Descendants of these classes are not supported.</p>
-<p>RemoteViews also supports {@link android.view.ViewStub}, which is an invisible, zero-sized View you can use
+<p>RemoteViews also supports {@link android.view.ViewStub}, which is an invisible, zero-sized View you can use
to lazily inflate layout resources at runtime.</p>
@@ -386,7 +386,7 @@
<div class="sidebox-wrapper">
<div class="sidebox">
<p>You must declare your AppWidgetProvider class implementation as a
-broadcast receiver
+broadcast receiver
using the <code><receiver></code> element in the AndroidManifest (see
<a href="#Manifest">Declaring an App Widget in the Manifest</a> above).</p>
</div>
@@ -403,11 +403,11 @@
<dl>
<dt>
- {@link android.appwidget.AppWidgetProvider#onUpdate(android.content.Context,android.appwidget.AppWidgetManager,int[]) onUpdate()}
+ {@link android.appwidget.AppWidgetProvider#onUpdate(android.content.Context,android.appwidget.AppWidgetManager,int[]) onUpdate()}
</dt>
<dd>This is called to update the App Widget at intervals defined by the
<code>updatePeriodMillis</code>
- attribute in the AppWidgetProviderInfo (see <a href="#MetaData">Adding the
+ attribute in the AppWidgetProviderInfo (see <a href="#MetaData">Adding the
AppWidgetProviderInfo Metadata</a> above). This method is also called
when the user adds the App Widget, so it should perform the essential setup,
such as define event handlers for Views and start a temporary
@@ -415,25 +415,25 @@
configuration
Activity, <strong>this method is not called</strong> when the user adds the
App Widget,
- but is called for the subsequent updates. It is the responsibility of the
+ but is called for the subsequent updates. It is the responsibility of the
configuration Activity to perform the first update when configuration is
done.
(See <a href="#Configuring">Creating an App Widget Configuration
-Activity</a> below.)</dd>
+Activity</a> below.)</dd>
<dt>
- {@link android.appwidget.AppWidgetProvider#onAppWidgetOptionsChanged onAppWidgetOptionsChanged()}
+ {@link android.appwidget.AppWidgetProvider#onAppWidgetOptionsChanged onAppWidgetOptionsChanged()}
</dt>
<dd>
This is called when the widget is first placed and any time the widget is resized. You can use this callback to show or hide content based on the widget's size ranges. You get the size ranges by calling {@link android.appwidget.AppWidgetManager#getAppWidgetOptions getAppWidgetOptions()}, which returns a {@link android.os.Bundle} that includes the following:<br /><br />
<ul>
- <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_WIDTH}—Contains
+ <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_WIDTH}—Contains
the lower bound on the current width, in dp units, of a widget instance.</li>
- <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_HEIGHT}—Contains
+ <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_HEIGHT}—Contains
the lower bound on the current height, in dp units, of a widget instance.</li>
<li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MAX_WIDTH}—Contains
the upper bound on the current width, in dp units, of a widget instance.</li>
- <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MAX_HEIGHT}—Contains
+ <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MAX_HEIGHT}—Contains
the upper bound on the current width, in dp units, of a widget instance.</li>
</ul>
@@ -444,34 +444,34 @@
host.</dd>
<dt>{@link android.appwidget.AppWidgetProvider#onEnabled(Context)}</dt>
<dd>This is called when an instance the App Widget is created for the first
-time. For example, if the user
+time. For example, if the user
adds two instances of your App Widget, this is only called the first time.
If you need to open a new database or perform other setup that only needs to
-occur once
- for all App Widget instances, then this is a good place to do it.</dd>
+occur once
+ for all App Widget instances, then this is a good place to do it.</dd>
<dt>{@link android.appwidget.AppWidgetProvider#onDisabled(Context)}</dt>
<dd>This is called when the last instance of your App Widget is deleted from
-the App Widget host.
- This is where you should clean up any work done in
- {@link android.appwidget.AppWidgetProvider#onEnabled(Context)},
- such as delete a temporary database.</dd>
+the App Widget host.
+ This is where you should clean up any work done in
+ {@link android.appwidget.AppWidgetProvider#onEnabled(Context)},
+ such as delete a temporary database.</dd>
<dt>{@link android.appwidget.AppWidgetProvider#onReceive(Context,Intent)}</dt>
<dd>This is called for every broadcast and before each of the above callback
methods.
You normally don't need to implement this method because the default
-AppWidgetProvider
- implementation filters all App Widget broadcasts and calls the above
- methods as appropriate.</dd>
+AppWidgetProvider
+ implementation filters all App Widget broadcasts and calls the above
+ methods as appropriate.</dd>
</dl>
-<p>The most important AppWidgetProvider callback is
-{@link android.appwidget.AppWidgetProvider#onUpdate(android.content.Context, android.appwidget.AppWidgetManager, int[]) onUpdate()}
+<p>The most important AppWidgetProvider callback is
+{@link android.appwidget.AppWidgetProvider#onUpdate(android.content.Context, android.appwidget.AppWidgetManager, int[]) onUpdate()}
because it is called when
each App Widget is added to a host (unless you use a configuration Activity). If
your App Widget accepts any user interaction events, then you need to register
the event handlers in this callback. If your App Widget doesn't create temporary
-files or databases, or perform other work that requires clean-up, then
-{@link android.appwidget.AppWidgetProvider#onUpdate(android.content.Context, android.appwidget.AppWidgetManager, int[]) onUpdate()}
+files or databases, or perform other work that requires clean-up, then
+{@link android.appwidget.AppWidgetProvider#onUpdate(android.content.Context, android.appwidget.AppWidgetManager, int[]) onUpdate()}
may be the only callback
method you need to define. For example, if you want an App Widget with a button
that launches an Activity when clicked, you could use the following
@@ -503,9 +503,9 @@
}
</pre>
-<p>This AppWidgetProvider defines only the
+<p>This AppWidgetProvider defines only the
{@link
-android.appwidget.AppWidgetProvider#onUpdate(android.content.Context, android.appwidget.AppWidgetManager, int[]) onUpdate()}
+android.appwidget.AppWidgetProvider#onUpdate(android.content.Context, android.appwidget.AppWidgetManager, int[]) onUpdate()}
method for the purpose of
defining a {@link android.app.PendingIntent} that launches an {@link
android.app.Activity} and attaching it to the App Widget's button with {@link
@@ -528,8 +528,8 @@
android.content.BroadcastReceiver} for information about the broadcast
lifecycle). If your App Widget setup process can take several seconds (perhaps
while performing web requests) and you require that your process continues,
-consider starting a {@link android.app.Service} in the
-{@link android.appwidget.AppWidgetProvider#onUpdate(Context,AppWidgetManager,int[]) onUpdate()}
+consider starting a {@link android.app.Service} in the
+{@link android.appwidget.AppWidgetProvider#onUpdate(Context,AppWidgetManager,int[]) onUpdate()}
method. From within the Service, you can perform your own updates
to the App Widget without worrying about the AppWidgetProvider closing down due
to an <a href="{@docRoot}guide/practices/responsiveness.html">Application
@@ -537,7 +537,7 @@
href="http://code.google.com/p/wiktionary-android/source/browse/trunk/Wiktionary/src/com/example/android/wiktionary/WordWidget.java">Wiktionary sample's AppWidgetProvider</a> for an example of an App Widget running a {@link
android.app.Service}.</p>
-<p>Also see the <a
+<p>Also see the <a
href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/appwidget/ExampleAppWidgetProvider.html">ExampleAppWidgetProvider.java</a>
sample class.</p>
@@ -546,9 +546,9 @@
<p>{@link android.appwidget.AppWidgetProvider} is just a convenience class. If
you would like
-to receive the App Widget broadcasts directly, you can implement your own
-{@link android.content.BroadcastReceiver} or override the
-{@link android.appwidget.AppWidgetProvider#onReceive(Context,Intent)} callback.
+to receive the App Widget broadcasts directly, you can implement your own
+{@link android.content.BroadcastReceiver} or override the
+{@link android.appwidget.AppWidgetProvider#onReceive(Context,Intent)} callback.
The Intents you need to care about are as follows:</p>
<ul>
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_UPDATE}</li>
@@ -565,11 +565,11 @@
<p>If you would like the user to configure settings when he or she adds a new
App Widget,
you can create an App Widget configuration Activity. This {@link
-android.app.Activity}
+android.app.Activity}
will be automatically launched by the App Widget host and allows the user to
configure
available settings for the App Widget at create-time, such as the App Widget
-color, size,
+color, size,
update period or other functionality settings.</p>
<p>The configuration Activity should be declared as a normal Activity in the
@@ -588,8 +588,8 @@
</pre>
<p>Also, the Activity must be declared in the AppWidgetProviderInfo XML file,
-with the
-<code>android:configure</code> attribute (see <a href="#MetaData">Adding
+with the
+<code>android:configure</code> attribute (see <a href="#MetaData">Adding
the AppWidgetProviderInfo Metadata</a> above). For example, the configuration
Activity
can be declared like this:</p>
@@ -597,13 +597,13 @@
<pre>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
...
- android:configure="com.example.android.ExampleAppWidgetConfigure"
+ android:configure="com.example.android.ExampleAppWidgetConfigure"
... >
</appwidget-provider>
</pre>
<p>Notice that the Activity is declared with a fully-qualified namespace,
-because
+because
it will be referenced from outside your package scope.</p>
<p>That's all you need to get started with a configuration Activity. Now all you
@@ -612,21 +612,21 @@
implement the Activity:</p>
<ul>
<li>The App Widget host calls the configuration Activity and the configuration
-Activity should always
+Activity should always
return a result. The result should include the App Widget ID
passed by the Intent that launched the Activity (saved in the Intent extras
as
{@link android.appwidget.AppWidgetManager#EXTRA_APPWIDGET_ID}).</li>
- <li>The
- {@link android.appwidget.AppWidgetProvider#onUpdate(Context,AppWidgetManager,int[]) onUpdate()}
+ <li>The
+ {@link android.appwidget.AppWidgetProvider#onUpdate(Context,AppWidgetManager,int[]) onUpdate()}
method <strong>will not be called</strong> when the App Widget
is created
(the system will not send the ACTION_APPWIDGET_UPDATE broadcast when a
configuration Activity
is launched). It is the responsibility of the configuration Activity to
-request an update from the
- AppWidgetManager when the App Widget is first created. However,
-{@link android.appwidget.AppWidgetProvider#onUpdate(Context,AppWidgetManager,int[]) onUpdate()}
+request an update from the
+ AppWidgetManager when the App Widget is first created. However,
+{@link android.appwidget.AppWidgetProvider#onUpdate(Context,AppWidgetManager,int[]) onUpdate()}
will be called for subsequent updates—it is only skipped
the first time.</li>
</ul>
@@ -641,8 +641,8 @@
<p>When an App Widget uses a configuration Activity, it is the responsibility of
the Activity
-to update the App Widget when configuration is complete.
-You can do so by requesting an update directly from the
+to update the App Widget when configuration is complete.
+You can do so by requesting an update directly from the
{@link android.appwidget.AppWidgetManager}.</p>
<p>Here's a summary of the procedure to properly update the App Widget and close
@@ -655,7 +655,7 @@
Bundle extras = intent.getExtras();
if (extras != null) {
mAppWidgetId = extras.getInt(
- AppWidgetManager.EXTRA_APPWIDGET_ID,
+ AppWidgetManager.EXTRA_APPWIDGET_ID,
AppWidgetManager.INVALID_APPWIDGET_ID);
}
</pre>
@@ -696,7 +696,7 @@
cancelled and the
App Widget will not be added.</p>
-<p>See the <a
+<p>See the <a
href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/appwidget/ExampleAppWidgetConfigure.html">ExampleAppWidgetConfigure.java</a>
sample class in ApiDemos for an example.</p>
@@ -708,7 +708,7 @@
android.appwidget.AppWidgetProviderInfo#previewImage} field, which specifies a
preview of what the app widget looks like. This preview is shown to the user from the
widget picker. If this field is not supplied, the app widget's icon is used for
-the preview.</p>
+the preview.</p>
<p>This is how you specify this setting in XML:</p>
@@ -742,12 +742,12 @@
<dt>{@link android.widget.GridView}</dt>
<dd>A view that shows items in
two-dimensional scrolling grid. For an example, see the Bookmarks app
-widget.</dd>
+widget.</dd>
<dt>{@link android.widget.StackView}</dt>
<dd>A
stacked card view (kind of like a rolodex), where the user can flick the front
card up/down to see the previous/next card, respectively. Examples include
-the YouTube and Books app widgets. </dd>
+the YouTube and Books app widgets. </dd>
<dt>{@link android.widget.AdapterViewFlipper}</dt>
<dd>An adapter-backed simple
{@link
@@ -764,7 +764,7 @@
context of an app widget, the {@link android.widget.Adapter} is replaced by a
{@link android.widget.RemoteViewsService.RemoteViewsFactory RemoteViewsFactory},
which is simply a thin wrapper around the {@link android.widget.Adapter}
-interface.
+interface.
When
requested for a specific item in the collection, the {@link
android.widget.RemoteViewsService.RemoteViewsFactory RemoteViewsFactory} creates
@@ -782,7 +782,7 @@
android.widget.ListView}, {@link android.widget.GridView}, and so on) and the
underlying data for that view. From the <a
href="{@docRoot}resources/samples/StackWidget/index.html">StackView Widget
-sample</a>, here is an example of the boilerplate code you use to implement
+sample</a>, here is an example of the boilerplate code you use to implement
this service and interface:
</p>
@@ -813,13 +813,13 @@
<p>This sample consists of a stack of 10 views, which display the values
<code>"0!"</code> through <code>"9!"</code> The sample
-app widget has these primary behaviors:</p>
+app widget has these primary behaviors:</p>
<ul>
<li>The user can vertically fling the top view in the
app widget to display the next or previous view. This is a built-in StackView
-behavior.</li>
+behavior.</li>
<li>Without any user interaction, the app widget automatically advances
through
@@ -828,17 +828,17 @@
<code>res/xml/stackwidgetinfo.xml</code> file. This setting applies to the view
ID,
which in this case is the view ID of the stack view.</li>
-
+
<li>If the user touches the top view, the app widget displays the {@link
android.widget.Toast} message "Touched view <em>n</em>," where
<em>n</em> is the index (position) of the touched view. For more discussion of
-how this is implemented, see
+how this is implemented, see
<a href="#behavior">Adding behavior to individual items</a>.</li>
</ul>
<h3 id="implementing_collections">Implementing app widgets with collections</h3>
-<p>To implement an app widget with collections, you follow the same basic steps
+<p>To implement an app widget with collections, you follow the same basic steps
you would use to implement any app widget. The following sections describe the
additional steps you need to perform to implement an app widget with
collections.</p>
@@ -940,7 +940,7 @@
int[] appWidgetIds) {
// update each of the app widgets with the remote adapter
for (int i = 0; i < appWidgetIds.length; ++i) {
-
+
// Set up the intent that starts the StackViewService, which will
// provide the views for this collection.
Intent intent = new Intent(context, StackWidgetService.class);
@@ -949,13 +949,13 @@
intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
// Instantiate the RemoteViews object for the app widget layout.
RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.widget_layout);
- // Set up the RemoteViews object to use a RemoteViews adapter.
+ // Set up the RemoteViews object to use a RemoteViews adapter.
// This adapter connects
// to a RemoteViewsService through the specified intent.
// This is how you populate the data.
rv.setRemoteAdapter(appWidgetIds[i], R.id.stack_view, intent);
-
- // The empty view is displayed when the collection has no items.
+
+ // The empty view is displayed when the collection has no items.
// It should be in the same layout used to instantiate the RemoteViews
// object above.
rv.setEmptyView(R.id.stack_view, R.id.empty_view);
@@ -963,12 +963,12 @@
//
// Do additional processing specific to this app widget...
//
-
- appWidgetManager.updateAppWidget(appWidgetIds[i], rv);
+
+ appWidgetManager.updateAppWidget(appWidgetIds[i], rv);
}
super.onUpdate(context, appWidgetManager, appWidgetIds);
}</pre>
-
+
<h4>RemoteViewsService class</h4>
<div class="sidebox-wrapper">
@@ -984,7 +984,7 @@
<p>As described above, your {@link android.widget.RemoteViewsService} subclass
provides the {@link android.widget.RemoteViewsService.RemoteViewsFactory
-RemoteViewsFactory} used to populate the remote collection view.</p>
+RemoteViewsFactory} used to populate the remote collection view.</p>
<p>Specifically, you need to
perform these steps:</p>
@@ -993,7 +993,7 @@
<li>Subclass {@link android.widget.RemoteViewsService}. {@link
android.widget.RemoteViewsService} is the service through which
a remote adapter can request {@link android.widget.RemoteViews}. </li>
-
+
<li>In your {@link android.widget.RemoteViewsService} subclass, include a
class that implements the {@link
android.widget.RemoteViewsService.RemoteViewsFactory RemoteViewsFactory}
@@ -1027,12 +1027,12 @@
<p>The two most important methods you need to implement for your
{@link android.widget.RemoteViewsService.RemoteViewsFactory RemoteViewsFactory}
-subclass are
+subclass are
{@link android.widget.RemoteViewsService.RemoteViewsFactory#onCreate()
onCreate()} and
{@link android.widget.RemoteViewsService.RemoteViewsFactory#getViewAt(int)
getViewAt()}
-.</p>
+.</p>
<p>The system calls {@link
android.widget.RemoteViewsService.RemoteViewsFactory#onCreate() onCreate()} when
@@ -1047,7 +1047,7 @@
<p>Here is an excerpt from the <a
href="{@docRoot}resources/samples/StackWidget/index.html">StackView Widget</a>
-sample's
+sample's
{@link android.widget.RemoteViewsService.RemoteViewsFactory
RemoteViewsFactory} implementation that shows portions of the {@link
android.widget.RemoteViewsService.RemoteViewsFactory#onCreate() onCreate()}
@@ -1081,7 +1081,7 @@
RemoteViewsFactory} method {@link
android.widget.RemoteViewsService.RemoteViewsFactory#getViewAt(int) getViewAt()}
returns a {@link android.widget.RemoteViews} object corresponding to the data at
-the specified <code>position</code> in the data set. Here is an excerpt from
+the specified <code>position</code> in the data set. Here is an excerpt from
the <a
href="http://developer.android.com/resources/samples/StackWidget/index.html">
StackView Widget</a> sample's {@link
@@ -1089,8 +1089,8 @@
implementation:</p>
<pre>public RemoteViews getViewAt(int position) {
-
- // Construct a remote views item based on the app widget item XML file,
+
+ // Construct a remote views item based on the app widget item XML file,
// and set the text based on the position.
RemoteViews rv = new RemoteViews(mContext.getPackageName(), R.layout.widget_item);
rv.setTextViewText(R.id.widget_item, mWidgetItems.get(position).text);
@@ -1104,7 +1104,7 @@
<p>The above sections show you how to bind your data to your app widget
collection. But what if you want to add dynamic behavior to the individual items
-in your collection view?</p>
+in your collection view?</p>
<p> As described in <a href="#AppWidgetProvider">Using the AppWidgetProvider
Class</a>, you normally use {@link
@@ -1122,7 +1122,7 @@
setOnClickFillInIntent()}. This entails setting up up a pending intent template
for your collection view, and then setting a fill-in intent on each item in the
collection via your {@link android.widget.RemoteViewsService.RemoteViewsFactory
-RemoteViewsFactory}.</p>
+RemoteViewsFactory}.</p>
<p>This section uses the <a
href="{@docRoot}resources/samples/StackWidget/index.html">StackView Widget
sample</a> to describe how to add behavior to individual items. In the <a
@@ -1138,7 +1138,7 @@
a custom action called <code>TOAST_ACTION</code>.</li>
<li>When the user touches a view, the intent is fired and it broadcasts
<code>TOAST_ACTION</code>.</li>
-
+
<li>This broadcast is intercepted by the <code>StackWidgetProvider</code>'s
{@link android.appwidget.AppWidgetProvider#onReceive(android.content.Context,
android.content.Intent) onReceive()} method, and the app widget displays the
@@ -1154,7 +1154,7 @@
sample</a> uses a broadcast, but typically an app widget would simply launch an
activity in a scenario like this one.</p>
-<h5>Setting up the pending intent template</h5>
+<h5>Setting up the pending intent template</h5>
<p>The <code>StackWidgetProvider</code> ({@link
android.appwidget.AppWidgetProvider} subclass) sets up a pending intent.
@@ -1162,7 +1162,7 @@
Instead, the collection as a whole sets up a pending intent template, and the
individual items set a fill-in intent to create unique behavior on an
item-by-item
-basis.</p>
+basis.</p>
<p>This class also receives the broadcast that is sent when the user touches a
view. It processes this event in its {@link
@@ -1179,7 +1179,7 @@
...
// Called when the BroadcastReceiver receives an Intent broadcast.
- // Checks to see whether the intent's action is TOAST_ACTION. If it is, the app widget
+ // Checks to see whether the intent's action is TOAST_ACTION. If it is, the app widget
// displays a Toast message for the current item.
@Override
public void onReceive(Context context, Intent intent) {
@@ -1192,12 +1192,12 @@
}
super.onReceive(context, intent);
}
-
+
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
// update each of the app widgets with the remote adapter
for (int i = 0; i < appWidgetIds.length; ++i) {
-
+
// Sets up the intent that points to the StackViewService that will
// provide the views for this collection.
Intent intent = new Intent(context, StackWidgetService.class);
@@ -1207,7 +1207,7 @@
intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.widget_layout);
rv.setRemoteAdapter(appWidgetIds[i], R.id.stack_view, intent);
-
+
// The empty view is displayed when the collection has no items. It should be a sibling
// of the collection view.
rv.setEmptyView(R.id.stack_view, R.id.empty_view);
@@ -1227,13 +1227,13 @@
PendingIntent toastPendingIntent = PendingIntent.getBroadcast(context, 0, toastIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
rv.setPendingIntentTemplate(R.id.stack_view, toastPendingIntent);
-
+
appWidgetManager.updateAppWidget(appWidgetIds[i], rv);
}
super.onUpdate(context, appWidgetManager, appWidgetIds);
}
}</pre>
-
+
<h5><strong>Setting the fill-in Intent</strong></h5>
<p>Your {@link android.widget.RemoteViewsService.RemoteViewsFactory
@@ -1274,17 +1274,17 @@
...
}
...
-
- // Given the position (index) of a WidgetItem in the array, use the item's text value in
+
+ // Given the position (index) of a WidgetItem in the array, use the item's text value in
// combination with the app widget item XML file to construct a RemoteViews object.
public RemoteViews getViewAt(int position) {
// position will always range from 0 to getCount() - 1.
-
+
// Construct a RemoteViews item based on the app widget item XML file, and set the
// text based on the position.
RemoteViews rv = new RemoteViews(mContext.getPackageName(), R.layout.widget_item);
rv.setTextViewText(R.id.widget_item, mWidgetItems.get(position).text);
-
+
// Next, set a fill-intent, which will be used to fill in the pending intent template
// that is set on the collection view in StackWidgetProvider.
Bundle extras = new Bundle();
@@ -1294,9 +1294,9 @@
// Make it possible to distinguish the individual on-click
// action of a given item
rv.setOnClickFillInIntent(R.id.widget_item, fillInIntent);
-
+
...
-
+
// Return the RemoteViews object.
return rv;
}
diff --git a/docs/html/guide/topics/connectivity/bluetooth-le.jd b/docs/html/guide/topics/connectivity/bluetooth-le.jd
index 3d60686..ba742ee 100644
--- a/docs/html/guide/topics/connectivity/bluetooth-le.jd
+++ b/docs/html/guide/topics/connectivity/bluetooth-le.jd
@@ -171,7 +171,7 @@
</pre>
<p>However, if you want to make your app available to devices that don't support BLE,
-you should still include this element in your app's manifest, but set {@code required="false"}.
+you should still include this element in your app's manifest, but set {@code required="false"}.
Then at run-time you can determine BLE availability by using
{@link android.content.pm.PackageManager#hasSystemFeature PackageManager.hasSystemFeature()}:
diff --git a/docs/html/guide/topics/connectivity/bluetooth.jd b/docs/html/guide/topics/connectivity/bluetooth.jd
index 96008c5..07fcd09 100644
--- a/docs/html/guide/topics/connectivity/bluetooth.jd
+++ b/docs/html/guide/topics/connectivity/bluetooth.jd
@@ -4,55 +4,55 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>In this document</h2>
- <ol>
+ <ol>
<li><a href="#TheBasics">The Basics</a></li>
<li><a href="#Permissions">Bluetooth Permissions</a></li>
- <li><a href="#SettingUp">Setting Up Bluetooth</a></li>
- <li><a href="#FindingDevices">Finding Devices</a>
- <ol>
- <li><a href="#QueryingPairedDevices">Querying paired devices</a></li>
- <li><a href="#DiscoveringDevices">Discovering devices</a></li>
- </ol></li>
- <li><a href="#ConnectingDevices">Connecting Devices</a>
- <ol>
- <li><a href="#ConnectingAsAServer">Connecting as a server</a></li>
- <li><a href="#ConnectingAsAClient">Connecting as a client</a></li>
- </ol></li>
+ <li><a href="#SettingUp">Setting Up Bluetooth</a></li>
+ <li><a href="#FindingDevices">Finding Devices</a>
+ <ol>
+ <li><a href="#QueryingPairedDevices">Querying paired devices</a></li>
+ <li><a href="#DiscoveringDevices">Discovering devices</a></li>
+ </ol></li>
+ <li><a href="#ConnectingDevices">Connecting Devices</a>
+ <ol>
+ <li><a href="#ConnectingAsAServer">Connecting as a server</a></li>
+ <li><a href="#ConnectingAsAClient">Connecting as a client</a></li>
+ </ol></li>
<li><a href="#ManagingAConnection">Managing a Connection</a></li>
- <li><a href="#Profiles">Working with Profiles</a>
+ <li><a href="#Profiles">Working with Profiles</a>
<ol>
<li><a href="#AT-Commands">Vendor-specific AT commands</a>
<li><a href="#HDP">Health Device Profile</a>
</ol></li>
- </ol>
-
- <h2>Key classes</h2>
- <ol>
- <li>{@link android.bluetooth.BluetoothAdapter}</li>
- <li>{@link android.bluetooth.BluetoothDevice}</li>
- <li>{@link android.bluetooth.BluetoothSocket}</li>
- <li>{@link android.bluetooth.BluetoothServerSocket}</li>
- </ol>
-
- <h2>Related samples</h2>
- <ol>
- <li><a href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat</a></li>
+ </ol>
+
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.bluetooth.BluetoothAdapter}</li>
+ <li>{@link android.bluetooth.BluetoothDevice}</li>
+ <li>{@link android.bluetooth.BluetoothSocket}</li>
+ <li>{@link android.bluetooth.BluetoothServerSocket}</li>
+ </ol>
+
+ <h2>Related samples</h2>
+ <ol>
+ <li><a href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat</a></li>
<li><a href="{@docRoot}resources/samples/BluetoothHDP/index.html">Bluetooth HDP (Health Device Profile)</a></li>
- </ol>
-
-</div>
-</div>
-
-
+ </ol>
+
+</div>
+</div>
+
+
<p>The Android platform includes support for the Bluetooth network stack,
which allows a device to wirelessly exchange data with other Bluetooth devices.
The application framework provides access to the Bluetooth functionality through
the Android Bluetooth APIs. These APIs let applications wirelessly
connect to other Bluetooth devices, enabling point-to-point and multipoint
-wireless features.</p>
-
+wireless features.</p>
+
<p>Using the Bluetooth APIs, an Android application can perform the
following:</p>
<ul>
@@ -75,14 +75,14 @@
<p>This document describes how to use the Android Bluetooth APIs to accomplish
the four major tasks necessary to communicate using Bluetooth: setting up
Bluetooth, finding devices that are either paired or available in the local
-area, connecting devices, and transferring data between devices.</p>
-
+area, connecting devices, and transferring data between devices.</p>
+
<p>All of the Bluetooth APIs are available in the {@link android.bluetooth}
package. Here's a summary of the classes and interfaces you will need to create Bluetooth
-connections:</p>
-
-<dl>
-<dt>{@link android.bluetooth.BluetoothAdapter}</dt>
+connections:</p>
+
+<dl>
+<dt>{@link android.bluetooth.BluetoothAdapter}</dt>
<dd>Represents the local Bluetooth adapter (Bluetooth radio). The
{@link android.bluetooth.BluetoothAdapter} is the entry-point for all Bluetooth
interaction. Using this,
@@ -90,49 +90,49 @@
devices, instantiate a {@link android.bluetooth.BluetoothDevice} using a known
MAC address, and create a {@link android.bluetooth.BluetoothServerSocket} to
listen for communications
-from other devices.</dd>
-
-<dt>{@link android.bluetooth.BluetoothDevice}</dt>
+from other devices.</dd>
+
+<dt>{@link android.bluetooth.BluetoothDevice}</dt>
<dd>Represents a remote Bluetooth device. Use this to request a connection
with a remote device through a {@link android.bluetooth.BluetoothSocket} or
query information about the
-device such as its name, address, class, and bonding state.</dd>
-
-<dt>{@link android.bluetooth.BluetoothSocket}</dt>
+device such as its name, address, class, and bonding state.</dd>
+
+<dt>{@link android.bluetooth.BluetoothSocket}</dt>
<dd>Represents the interface for a Bluetooth socket (similar to a TCP
{@link java.net.Socket}). This is the connection point that allows
an application to exchange data with another Bluetooth device via InputStream
-and OutputStream.</dd>
-
-<dt>{@link android.bluetooth.BluetoothServerSocket}</dt>
+and OutputStream.</dd>
+
+<dt>{@link android.bluetooth.BluetoothServerSocket}</dt>
<dd>Represents an open server socket that listens for incoming requests
(similar to a TCP {@link java.net.ServerSocket}). In order to connect two
Android devices, one device must open a server socket with this class. When a
remote Bluetooth device makes a connection request to the this device, the
{@link android.bluetooth.BluetoothServerSocket} will return a connected {@link
android.bluetooth.BluetoothSocket} when the
-connection is accepted.</dd>
-
-<dt>{@link android.bluetooth.BluetoothClass}</dt>
+connection is accepted.</dd>
+
+<dt>{@link android.bluetooth.BluetoothClass}</dt>
<dd>Describes the general characteristics and capabilities of a Bluetooth
device. This is a read-only set of properties that define the device's major and
minor device classes and its services. However, this does not reliably describe
all Bluetooth profiles and services supported by the device, but is useful as a
-hint to the device type.</dd>
-
+hint to the device type.</dd>
+
<dt>{@link android.bluetooth.BluetoothProfile}</dt> <dd>An interface that
represents a Bluetooth profile. A <em>Bluetooth profile</em> is a wireless
interface specification for Bluetooth-based communication between devices. An
example is the Hands-Free profile. For more discussion of profiles, see <a
-href="#Profiles">Working with Profiles</a></dd>
+href="#Profiles">Working with Profiles</a></dd>
<dt>{@link android.bluetooth.BluetoothHeadset}</dt> <dd>Provides support for
Bluetooth headsets to be used with mobile phones. This includes both Bluetooth
-Headset and Hands-Free (v1.5) profiles.</dd>
+Headset and Hands-Free (v1.5) profiles.</dd>
<dt>{@link android.bluetooth.BluetoothA2dp}</dt> <dd> Defines how high quality
audio can be streamed from one device to another over a Bluetooth connection.
-"A2DP" stands for Advanced Audio Distribution Profile.</dd>
+"A2DP" stands for Advanced Audio Distribution Profile.</dd>
<dt>{@link android.bluetooth.BluetoothHealth}</dt>
<dd> Represents a Health Device Profile proxy that controls the Bluetooth service.</dd>
@@ -146,23 +146,23 @@
<dt>{@link android.bluetooth.BluetoothHealthAppConfiguration}</dt>
-<dd>Represents an application configuration that the Bluetooth Health third-party
+<dd>Represents an application configuration that the Bluetooth Health third-party
application registers to communicate with a remote Bluetooth health
-device.</dd>
+device.</dd>
<dt>{@link android.bluetooth.BluetoothProfile.ServiceListener}</dt>
<dd>An interface that notifies {@link android.bluetooth.BluetoothProfile} IPC
clients when they have been connected to or disconnected from the service (that
is, the internal service that runs a particular profile). </dd>
-
-</dl>
-
-
-
-
-<h2 id="Permissions">Bluetooth Permissions</h2>
-
+
+</dl>
+
+
+
+
+<h2 id="Permissions">Bluetooth Permissions</h2>
+
<p>In order to use Bluetooth features in your application, you must declare
the Bluetooth permission {@link android.Manifest.permission#BLUETOOTH}.
You need this permission to perform any Bluetooth communication,
@@ -175,40 +175,40 @@
permission should not be used, unless the application is a "power manager" that
will modify Bluetooth settings upon user request. <strong>Note:</strong> If you
use {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission, then you must
-also have the {@link android.Manifest.permission#BLUETOOTH} permission.</p>
-
+also have the {@link android.Manifest.permission#BLUETOOTH} permission.</p>
+
<p>Declare the Bluetooth permission(s) in your application manifest file. For
-example:</p>
-
-<pre>
+example:</p>
+
+<pre>
<manifest ... >
<uses-permission android:name="android.permission.BLUETOOTH" />
...
</manifest>
-</pre>
-
+</pre>
+
<p>See the <a
-href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a>
-reference for more information about declaring application permissions.</p>
-
-
-<h2 id="SettingUp">Setting Up Bluetooth</h2>
-
-<div class="figure" style="width:200px">
-<img src="{@docRoot}images/bt_enable_request.png" />
+href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a>
+reference for more information about declaring application permissions.</p>
+
+
+<h2 id="SettingUp">Setting Up Bluetooth</h2>
+
+<div class="figure" style="width:200px">
+<img src="{@docRoot}images/bt_enable_request.png" />
<strong>Figure 1:</strong> The enabling Bluetooth dialog.
-</div>
-
+</div>
+
<p>Before your application can communicate over Bluetooth, you need to verify
-that Bluetooth is supported on the device, and if so, ensure that it is enabled.</p>
-
+that Bluetooth is supported on the device, and if so, ensure that it is enabled.</p>
+
<p>If Bluetooth is not supported, then you should gracefully disable any
Bluetooth features. If Bluetooth is supported, but disabled, then you can request that the
user enable Bluetooth without leaving your application. This setup is
-accomplished in two steps, using the {@link android.bluetooth.BluetoothAdapter}.</p>
-
-
-<ol>
+accomplished in two steps, using the {@link android.bluetooth.BluetoothAdapter}.</p>
+
+
+<ol>
<li>Get the {@link android.bluetooth.BluetoothAdapter}
<p>The {@link android.bluetooth.BluetoothAdapter} is required for any and all Bluetooth
activity. To get the {@link android.bluetooth.BluetoothAdapter}, call the static {@link
@@ -217,15 +217,15 @@
Bluetooth adapter (the Bluetooth radio). There's one Bluetooth adapter for the
entire system, and your application can interact with it using this object. If
{@link android.bluetooth.BluetoothAdapter#getDefaultAdapter()} returns null,
-then the device does not support Bluetooth and your story ends here. For example:</p>
-<pre>
+then the device does not support Bluetooth and your story ends here. For example:</p>
+<pre>
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter == null) {
// Device does not support Bluetooth
}
-</pre>
-</li>
-
+</pre>
+</li>
+
<li>Enable Bluetooth
<p>Next, you need to ensure that Bluetooth is enabled. Call {@link
android.bluetooth.BluetoothAdapter#isEnabled()} to check whether Bluetooth is
@@ -234,17 +234,17 @@
android.app.Activity#startActivityForResult(Intent,int) startActivityForResult()}
with the {@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_ENABLE} action Intent.
This will issue a request to enable Bluetooth through the system settings (without
-stopping your application). For example:</p>
-<pre>
+stopping your application). For example:</p>
+<pre>
if (!mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}
-</pre>
-
+</pre>
+
<p>A dialog will appear requesting user permission to enable Bluetooth, as shown
in Figure 1. If the user responds "Yes," the system will begin to enable Bluetooth
-and focus will return to your application once the process completes (or fails).</p>
+and focus will return to your application once the process completes (or fails).</p>
<p>The {@code REQUEST_ENABLE_BT} constant passed to {@link
android.app.Activity#startActivityForResult(Intent,int) startActivityForResult()} is a locally
@@ -259,9 +259,9 @@
callback. If Bluetooth was not enabled
due to an error (or the user responded "No") then the result code is {@link
android.app.Activity#RESULT_CANCELED}.</p>
-</li>
-</ol>
-
+</li>
+</ol>
+
<p>Optionally, your application can also listen for the
{@link android.bluetooth.BluetoothAdapter#ACTION_STATE_CHANGED} broadcast Intent, which
the system will broadcast whenever the Bluetooth state has changed. This broadcast contains
@@ -273,21 +273,21 @@
android.bluetooth.BluetoothAdapter#STATE_TURNING_OFF}, and {@link
android.bluetooth.BluetoothAdapter#STATE_OFF}. Listening for this
broadcast can be useful to detect changes made to the Bluetooth state while your
-app is running.</p>
-
+app is running.</p>
+
<p class="note"><strong>Tip:</strong> Enabling discoverability will automatically
enable Bluetooth. If you plan to consistently enable device discoverability before
performing Bluetooth activity, you can skip
step 2 above. Read about <a href="#EnablingDiscoverability">enabling discoverability</a>,
-below.</p>
-
-
-<h2 id="FindingDevices">Finding Devices</h2>
-
+below.</p>
+
+
+<h2 id="FindingDevices">Finding Devices</h2>
+
<p>Using the {@link android.bluetooth.BluetoothAdapter}, you can find remote Bluetooth
devices either through device discovery or by querying the list of paired (bonded)
-devices.</p>
-
+devices.</p>
+
<p>Device discovery is a scanning procedure that searches the local area for
Bluetooth enabled devices and then requesting some information about each one
(this is sometimes referred to as "discovering," "inquiring" or "scanning").
@@ -296,15 +296,15 @@
discoverable, it will respond to the discovery request by sharing some
information, such as the device name, class, and its unique MAC address. Using
this information, the device performing discovery can then choose to initiate a
-connection to the discovered device.</p>
-
+connection to the discovered device.</p>
+
<p>Once a connection is made with a remote device for the first time, a pairing
request is automatically presented to the user. When a device is
paired, the basic information about that device (such as the device name, class,
and MAC address) is saved and can be read using the Bluetooth APIs. Using the
known MAC address for a remote device, a connection can be initiated with it at
-any time without performing discovery (assuming the device is within range).</p>
-
+any time without performing discovery (assuming the device is within range).</p>
+
<p>Remember there is a difference between being paired and being connected. To
be paired means that two devices are aware of each other's existence, have a
shared link-key that can be used for authentication, and are capable of
@@ -312,28 +312,28 @@
the devices currently share an RFCOMM channel and are able to transmit data with
each other. The current Android Bluetooth API's require devices to be paired
before an RFCOMM connection can be established. (Pairing is automatically performed
-when you initiate an encrypted connection with the Bluetooth APIs.)</p>
-
+when you initiate an encrypted connection with the Bluetooth APIs.)</p>
+
<p>The following sections describe how to find devices that have been paired, or
-discover new devices using device discovery.</p>
-
+discover new devices using device discovery.</p>
+
<p class="note"><strong>Note:</strong> Android-powered devices are not
discoverable by default. A user can make
the device discoverable for a limited time through the system settings, or an
application can request that the user enable discoverability without leaving the
-application. How to <a href="#EnablingDiscoverability">enable discoverability</a>
-is discussed below.</p>
-
-
-<h3 id="QueryingPairedDevices">Querying paired devices</h3>
-
+application. How to <a href="#EnablingDiscoverability">enable discoverability</a>
+is discussed below.</p>
+
+
+<h3 id="QueryingPairedDevices">Querying paired devices</h3>
+
<p>Before performing device discovery, its worth querying the set
of paired devices to see if the desired device is already known. To do so,
call {@link android.bluetooth.BluetoothAdapter#getBondedDevices()}. This
will return a Set of {@link android.bluetooth.BluetoothDevice}s representing
paired devices. For example, you can query all paired devices and then
-show the name of each device to the user, using an ArrayAdapter:</p>
-<pre>
+show the name of each device to the user, using an ArrayAdapter:</p>
+<pre>
Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
// If there are paired devices
if (pairedDevices.size() > 0) {
@@ -343,24 +343,24 @@
mArrayAdapter.add(device.getName() + "\n" + device.getAddress());
}
}
-</pre>
-
+</pre>
+
<p>All that's needed from the {@link android.bluetooth.BluetoothDevice} object
in order to initiate a connection is the MAC address. In this example, it's saved
as a part of an ArrayAdapter that's shown to the user. The MAC address can later
be extracted in order to initiate the connection. You can learn more about creating
-a connection in the section about <a href="#ConnectingDevices">Connecting Devices</a>.</p>
-
-
-<h3 id="DiscoveringDevices">Discovering devices</h3>
-
+a connection in the section about <a href="#ConnectingDevices">Connecting Devices</a>.</p>
+
+
+<h3 id="DiscoveringDevices">Discovering devices</h3>
+
<p>To start discovering devices, simply call {@link
android.bluetooth.BluetoothAdapter#startDiscovery()}. The
process is asynchronous and the method will immediately return with a boolean
indicating whether discovery has successfully started. The discovery process
usually involves an inquiry scan of about 12 seconds, followed by a page scan of
-each found device to retrieve its Bluetooth name.</p>
-
+each found device to retrieve its Bluetooth name.</p>
+
<p>Your application must register a BroadcastReceiver for the
{@link android.bluetooth.BluetoothDevice#ACTION_FOUND} Intent in
order to receive information about each
@@ -371,8 +371,8 @@
{@link android.bluetooth.BluetoothDevice#EXTRA_CLASS}, containing a
{@link android.bluetooth.BluetoothDevice} and a {@link
android.bluetooth.BluetoothClass}, respectively. For example, here's how you can
-register to handle the broadcast when devices are discovered:</p>
-<pre>
+register to handle the broadcast when devices are discovered:</p>
+<pre>
// Create a BroadcastReceiver for ACTION_FOUND
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
@@ -389,15 +389,15 @@
// Register the BroadcastReceiver
IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
registerReceiver(mReceiver, filter); // Don't forget to unregister during onDestroy
-</pre>
-
+</pre>
+
<p>All that's needed from the {@link android.bluetooth.BluetoothDevice} object
in order to initiate a
connection is the MAC address. In this example, it's saved as a part of an
ArrayAdapter that's shown to the user. The MAC address can later be extracted in
order to initiate the connection. You can learn more about creating a connection
-in the section about <a href="#ConnectingDevices">Connecting Devices</a>.</p>
-
+in the section about <a href="#ConnectingDevices">Connecting Devices</a>.</p>
+
<p class="caution"><strong>Caution:</strong> Performing device discovery is
a heavy procedure for the Bluetooth
adapter and will consume a lot of its resources. Once you have found a device to
@@ -406,10 +406,10 @@
attempting a connection. Also, if you
already hold a connection with a device, then performing discovery can
significantly reduce the bandwidth available for the connection, so you should
-not perform discovery while connected.</p>
-
-<h4 id="EnablingDiscoverability">Enabling discoverability</h4>
-
+not perform discovery while connected.</p>
+
+<h4 id="EnablingDiscoverability">Enabling discoverability</h4>
+
<p>If you would like to make the local device discoverable to other devices,
call {@link android.app.Activity#startActivityForResult(Intent,int)} with the
{@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_DISCOVERABLE} action
@@ -420,30 +420,30 @@
extra. The maximum duration an app can set is 3600 seconds, and a value of 0
means the device is always discoverable. Any value below 0 or above 3600 is
automatically set to 120 secs). For example, this snippet sets the duration to
-300:</p>
+300:</p>
<pre>Intent discoverableIntent = new
Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
startActivity(discoverableIntent);
-</pre>
-
-<div class="figure" style="width:200px">
-<img src="{@docRoot}images/bt_enable_discoverable.png" />
+</pre>
+
+<div class="figure" style="width:200px">
+<img src="{@docRoot}images/bt_enable_discoverable.png" />
<strong>Figure 2:</strong> The enabling discoverability dialog.
-</div>
-
+</div>
+
<p>A dialog will be displayed, requesting user permission to make the device
discoverable, as shown in Figure 2. If the user responds "Yes," then the device
will become discoverable for the specified amount of time. Your activity will
then receive a call to the {@link android.app.Activity#onActivityResult(int,int,Intent)
onActivityResult())} callback, with the result code equal to the duration that the device
is discoverable. If the user responded "No" or if an error occurred, the result code will
-be {@link android.app.Activity#RESULT_CANCELED}.</p>
-
+be {@link android.app.Activity#RESULT_CANCELED}.</p>
+
<p class="note"><strong>Note:</strong> If Bluetooth has not been enabled on the device,
-then enabling device discoverability will automatically enable Bluetooth.</p>
-
+then enabling device discoverability will automatically enable Bluetooth.</p>
+
<p>The device will silently remain in discoverable mode for the allotted time.
If you would like to be notified when the discoverable mode has changed, you can
register a BroadcastReceiver for the {@link
@@ -457,18 +457,18 @@
android.bluetooth.BluetoothAdapter#SCAN_MODE_NONE},
which indicate that the device is either in discoverable mode, not in
discoverable mode but still able to receive connections, or not in discoverable
-mode and unable to receive connections, respectively.</p>
-
+mode and unable to receive connections, respectively.</p>
+
<p>You do not need to enable device discoverability if you will be initiating
the connection to a remote device. Enabling discoverability is only necessary when
you want your application to host a server socket that will accept incoming
connections, because the remote devices must be able to discover the device
-before it can initiate the connection.</p>
-
-
-
-<h2 id="ConnectingDevices">Connecting Devices</h2>
-
+before it can initiate the connection.</p>
+
+
+
+<h2 id="ConnectingDevices">Connecting Devices</h2>
+
<p>In order to create a connection between your application on two devices, you
must implement both the server-side and client-side mechanisms, because one
device must open a server socket and the other one must initiate the connection
@@ -478,36 +478,36 @@
point, each device can obtain input and output streams and data transfer can
begin, which is discussed in the section about <a
href="#ManagingAConnection">Managing a Connection</a>. This section describes how
-to initiate the connection between two devices.</p>
-
+to initiate the connection between two devices.</p>
+
<p>The server device and the client device each obtain the required {@link
android.bluetooth.BluetoothSocket} in different ways. The server will receive it
when an incoming connection is accepted. The client will receive it when it
-opens an RFCOMM channel to the server.</p>
-
-<div class="figure" style="width:200px">
-<img src="{@docRoot}images/bt_pairing_request.png" />
+opens an RFCOMM channel to the server.</p>
+
+<div class="figure" style="width:200px">
+<img src="{@docRoot}images/bt_pairing_request.png" />
<strong>Figure 3:</strong> The Bluetooth pairing dialog.
-</div>
-
+</div>
+
<p>One implementation technique is to automatically prepare each device as a
server, so that each one has a server socket open and listening for connections.
Then either device can initiate a connection with the other and become the
client. Alternatively, one device can explicitly "host" the connection and open
a server socket on demand and the other device can simply initiate the
-connection.</p>
-
+connection.</p>
+
<p class="note"><strong>Note:</strong> If the two devices have not been previously paired,
then the Android framework will automatically show a pairing request notification or
dialog to the user during the connection procedure, as shown in Figure 3. So
when attempting to connect devices,
your application does not need to be concerned about whether or not the devices are
paired. Your RFCOMM connection attempt will block until the user has successfully paired,
-or will fail if the user rejects pairing, or if pairing fails or times out. </p>
-
-
-<h3 id="ConnectingAsAServer">Connecting as a server</h3>
-
+or will fail if the user rejects pairing, or if pairing fails or times out. </p>
+
+
+<h3 id="ConnectingAsAServer">Connecting as a server</h3>
+
<p>When you want to connect two devices, one must act as a server by holding an
open {@link android.bluetooth.BluetoothServerSocket}. The purpose of the server
socket is to listen for incoming connection requests and when one is accepted,
@@ -515,26 +515,26 @@
android.bluetooth.BluetoothSocket} is acquired from the {@link
android.bluetooth.BluetoothServerSocket},
the {@link android.bluetooth.BluetoothServerSocket} can (and should) be
-discarded, unless you want to accept more connections.</p>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>About UUID</h2>
-
+discarded, unless you want to accept more connections.</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>About UUID</h2>
+
<p>A Universally Unique Identifier (UUID) is a standardized 128-bit format for a string
ID used to uniquely identify information. The point of a UUID is that it's big
enough that you can select any random and it won't clash. In this case, it's
used to uniquely identify your application's Bluetooth service. To get a UUID to
use with your application, you can use one of the many random UUID generators on
the web, then initialize a {@link java.util.UUID} with {@link
-java.util.UUID#fromString(String)}.</p>
-</div>
-</div>
-
+java.util.UUID#fromString(String)}.</p>
+</div>
+</div>
+
<p>Here's the basic procedure to set up a server socket and accept a
-connection:</p>
-
-<ol>
+connection:</p>
+
+<ol>
<li>Get a {@link android.bluetooth.BluetoothServerSocket} by calling the
{@link
android.bluetooth.BluetoothAdapter#listenUsingRfcommWithServiceRecord(String,
@@ -546,9 +546,9 @@
agreement with the client device. That is, when the client attempts to connect
with this device, it will carry a UUID that uniquely identifies the service with
which it wants to connect. These UUIDs must match in order for the connection to
-be accepted (in the next step).</p>
-</li>
-
+be accepted (in the next step).</p>
+</li>
+
<li>Start listening for connection requests by calling
{@link android.bluetooth.BluetoothServerSocket#accept()}.
<p>This is a blocking call. It will return when either a connection has been
@@ -556,9 +556,9 @@
remote device has sent a connection request with a UUID matching the one
registered with this listening server socket. When successful, {@link
android.bluetooth.BluetoothServerSocket#accept()} will
-return a connected {@link android.bluetooth.BluetoothSocket}.</p>
-</li>
-
+return a connected {@link android.bluetooth.BluetoothSocket}.</p>
+</li>
+
<li>Unless you want to accept additional connections, call
{@link android.bluetooth.BluetoothServerSocket#close()}.
<p>This releases the server socket and all its resources, but does <em>not</em> close the
@@ -567,10 +567,10 @@
connected client per channel at a time, so in most cases it makes sense to call {@link
android.bluetooth.BluetoothServerSocket#close()} on the {@link
android.bluetooth.BluetoothServerSocket} immediately after accepting a connected
-socket.</p>
-</li>
-</ol>
-
+socket.</p>
+</li>
+</ol>
+
<p>The {@link android.bluetooth.BluetoothServerSocket#accept()} call should not
be executed in the main activity UI thread because it is a blocking call and
will prevent any other interaction with the application. It usually makes
@@ -583,16 +583,16 @@
android.bluetooth.BluetoothSocket}) from another thread and the blocked call will
immediately return. Note that all methods on a {@link
android.bluetooth.BluetoothServerSocket} or {@link android.bluetooth.BluetoothSocket}
-are thread-safe.</p>
-
-<h4>Example</h4>
-
+are thread-safe.</p>
+
+<h4>Example</h4>
+
<p>Here's a simplified thread for the server component that accepts incoming
-connections:</p>
-<pre>
+connections:</p>
+<pre>
private class AcceptThread extends Thread {
private final BluetoothServerSocket mmServerSocket;
-
+
public AcceptThread() {
// Use a temporary object that is later assigned to mmServerSocket,
// because mmServerSocket is final
@@ -603,7 +603,7 @@
} catch (IOException e) { }
mmServerSocket = tmp;
}
-
+
public void run() {
BluetoothSocket socket = null;
// Keep listening until exception occurs or a socket is returned
@@ -622,7 +622,7 @@
}
}
}
-
+
/** Will cancel the listening socket, and cause the thread to finish */
public void cancel() {
try {
@@ -630,37 +630,37 @@
} catch (IOException e) { }
}
}
-</pre>
-
+</pre>
+
<p>In this example, only one incoming connection is desired, so as soon as a
connection is accepted and the {@link android.bluetooth.BluetoothSocket} is
acquired, the application
sends the acquired {@link android.bluetooth.BluetoothSocket} to a separate
thread, closes the
-{@link android.bluetooth.BluetoothServerSocket} and breaks the loop.</p>
-
+{@link android.bluetooth.BluetoothServerSocket} and breaks the loop.</p>
+
<p>Note that when {@link android.bluetooth.BluetoothServerSocket#accept()}
returns the {@link android.bluetooth.BluetoothSocket}, the socket is already
connected, so you should <em>not</em> call {@link
android.bluetooth.BluetoothSocket#connect()} (as you do from the
-client-side).</p>
-
+client-side).</p>
+
<p><code>manageConnectedSocket()</code> is a fictional method in the application
that will
initiate the thread for transferring data, which is discussed in the section
-about <a href="#ManagingAConnection">Managing a Connection</a>.</p>
-
+about <a href="#ManagingAConnection">Managing a Connection</a>.</p>
+
<p>You should usually close your {@link android.bluetooth.BluetoothServerSocket}
as soon as you are done listening for incoming connections. In this example, {@link
android.bluetooth.BluetoothServerSocket#close()} is called as soon
as the {@link android.bluetooth.BluetoothSocket} is acquired. You may also want
to provide a public method in your thread that can close the private {@link
android.bluetooth.BluetoothSocket} in the event that you need to stop listening on the
-server socket.</p>
-
-
-<h3 id="ConnectingAsAClient">Connecting as a client</h3>
-
+server socket.</p>
+
+
+<h3 id="ConnectingAsAClient">Connecting as a client</h3>
+
<p>In order to initiate a connection with a remote device (a device holding an
open
server socket), you must first obtain a {@link
@@ -669,11 +669,11 @@
section about <a
href="#FindingDevices">Finding Devices</a>.) You must then use the
{@link android.bluetooth.BluetoothDevice} to acquire a {@link
-android.bluetooth.BluetoothSocket} and initiate the connection.</p>
-
-<p>Here's the basic procedure:</p>
-
-<ol>
+android.bluetooth.BluetoothSocket} and initiate the connection.</p>
+
+<p>Here's the basic procedure:</p>
+
+<ol>
<li>Using the {@link android.bluetooth.BluetoothDevice}, get a {@link
android.bluetooth.BluetoothSocket} by calling {@link
android.bluetooth.BluetoothDevice#createRfcommSocketToServiceRecord(UUID)}.
@@ -684,9 +684,9 @@
android.bluetooth.BluetoothAdapter#listenUsingRfcommWithServiceRecord(String,
UUID)}). Using the same UUID is simply a matter of hard-coding the UUID string
into your application and then referencing it from both the server and client
-code.</p>
-</li>
-
+code.</p>
+</li>
+
<li>Initiate the connection by calling {@link
android.bluetooth.BluetoothSocket#connect()}.
<p>Upon this call, the system will perform an SDP lookup on the remote device in
@@ -697,34 +697,34 @@
blocking call. If, for
any reason, the connection fails or the {@link
android.bluetooth.BluetoothSocket#connect()} method times out (after about
-12 seconds), then it will throw an exception.</p>
+12 seconds), then it will throw an exception.</p>
<p>Because {@link
android.bluetooth.BluetoothSocket#connect()} is a blocking call, this connection
procedure should always be performed in a thread separate from the main activity
-thread.</p>
+thread.</p>
<p class="note">Note: You should always ensure that the device is not performing
device discovery when you call {@link
android.bluetooth.BluetoothSocket#connect()}. If discovery is in progress, then
the
-connection attempt will be significantly slowed and is more likely to fail.</p>
-</li>
-</ol>
-
-<h4>Example</h4>
-
+connection attempt will be significantly slowed and is more likely to fail.</p>
+</li>
+</ol>
+
+<h4>Example</h4>
+
<p>Here is a basic example of a thread that initiates a Bluetooth
-connection:</p>
-<pre>
+connection:</p>
+<pre>
private class ConnectThread extends Thread {
private final BluetoothSocket mmSocket;
private final BluetoothDevice mmDevice;
-
+
public ConnectThread(BluetoothDevice device) {
// Use a temporary object that is later assigned to mmSocket,
// because mmSocket is final
BluetoothSocket tmp = null;
mmDevice = device;
-
+
// Get a BluetoothSocket to connect with the given BluetoothDevice
try {
// MY_UUID is the app's UUID string, also used by the server code
@@ -732,11 +732,11 @@
} catch (IOException e) { }
mmSocket = tmp;
}
-
+
public void run() {
// Cancel discovery because it will slow down the connection
mBluetoothAdapter.cancelDiscovery();
-
+
try {
// Connect the device through the socket. This will block
// until it succeeds or throws an exception
@@ -748,11 +748,11 @@
} catch (IOException closeException) { }
return;
}
-
+
// Do work to manage the connection (in a separate thread)
manageConnectedSocket(mmSocket);
}
-
+
/** Will cancel an in-progress connection, and close the socket */
public void cancel() {
try {
@@ -760,42 +760,42 @@
} catch (IOException e) { }
}
}
-</pre>
-
+</pre>
+
<p>Notice that {@link android.bluetooth.BluetoothAdapter#cancelDiscovery()} is called
before the connection is made. You should always do this before connecting and it is safe
to call without actually checking whether it is running or not (but if you do want to
-check, call {@link android.bluetooth.BluetoothAdapter#isDiscovering()}).</p>
-
+check, call {@link android.bluetooth.BluetoothAdapter#isDiscovering()}).</p>
+
<p><code>manageConnectedSocket()</code> is a fictional method in the application
that will initiate the thread for transferring data, which is discussed in the section
-about <a href="#ManagingAConnection">Managing a Connection</a>.</p>
-
+about <a href="#ManagingAConnection">Managing a Connection</a>.</p>
+
<p>When you're done with your {@link android.bluetooth.BluetoothSocket}, always
call {@link android.bluetooth.BluetoothSocket#close()} to clean up.
Doing so will immediately close the connected socket and clean up all internal
-resources.</p>
-
-
-<h2 id="ManagingAConnection">Managing a Connection</h2>
-
+resources.</p>
+
+
+<h2 id="ManagingAConnection">Managing a Connection</h2>
+
<p>When you have successfully connected two (or more) devices, each one will
have a connected {@link android.bluetooth.BluetoothSocket}. This is where the fun
begins because you can share data between devices. Using the {@link
android.bluetooth.BluetoothSocket}, the general procedure to transfer arbitrary data is
-simple:</p>
-<ol>
+simple:</p>
+<ol>
<li>Get the {@link java.io.InputStream} and {@link java.io.OutputStream} that
handle transmissions through the socket, via {@link
android.bluetooth.BluetoothSocket#getInputStream()} and
-{@link android.bluetooth.BluetoothSocket#getOutputStream}, respectively.</li>
-
+{@link android.bluetooth.BluetoothSocket#getOutputStream}, respectively.</li>
+
<li>Read and write data to the streams with {@link
-java.io.InputStream#read(byte[])} and {@link java.io.OutputStream#write(byte[])}.</li>
-</ol>
-
-<p>That's it.</p>
-
+java.io.InputStream#read(byte[])} and {@link java.io.OutputStream#write(byte[])}.</li>
+</ol>
+
+<p>That's it.</p>
+
<p>There are, of course, implementation details to consider. First and foremost,
you should use a dedicated thread for all stream reading and writing. This is
important because both {@link java.io.InputStream#read(byte[])} and {@link
@@ -806,37 +806,37 @@
java.io.InputStream#read(byte[])} quickly enough and the intermediate buffers are full.
So, your main loop in the thread should be dedicated to reading from the {@link
java.io.InputStream}. A separate public method in the thread can be used to initiate
-writes to the {@link java.io.OutputStream}.</p>
-
-<h4>Example</h4>
-
-<p>Here's an example of how this might look:</p>
-<pre>
+writes to the {@link java.io.OutputStream}.</p>
+
+<h4>Example</h4>
+
+<p>Here's an example of how this might look:</p>
+<pre>
private class ConnectedThread extends Thread {
private final BluetoothSocket mmSocket;
private final InputStream mmInStream;
private final OutputStream mmOutStream;
-
+
public ConnectedThread(BluetoothSocket socket) {
mmSocket = socket;
InputStream tmpIn = null;
OutputStream tmpOut = null;
-
+
// Get the input and output streams, using temp objects because
// member streams are final
try {
tmpIn = socket.getInputStream();
tmpOut = socket.getOutputStream();
} catch (IOException e) { }
-
+
mmInStream = tmpIn;
mmOutStream = tmpOut;
}
-
+
public void run() {
byte[] buffer = new byte[1024]; // buffer store for the stream
int bytes; // bytes returned from read()
-
+
// Keep listening to the InputStream until an exception occurs
while (true) {
try {
@@ -850,14 +850,14 @@
}
}
}
-
+
/* Call this from the main activity to send data to the remote device */
public void write(byte[] bytes) {
try {
mmOutStream.write(bytes);
} catch (IOException e) { }
}
-
+
/* Call this from the main activity to shutdown the connection */
public void cancel() {
try {
@@ -865,44 +865,44 @@
} catch (IOException e) { }
}
}
-</pre>
-
+</pre>
+
<p>The constructor acquires the necessary streams and once executed, the thread
will wait for data to come through the InputStream. When {@link
java.io.InputStream#read(byte[])} returns with
bytes from the stream, the data is sent to the main activity using a member
Handler from the parent class. Then it goes back and waits for more bytes from
-the stream.</p>
-
+the stream.</p>
+
<p>Sending outgoing data is as simple as calling the thread's
<code>write()</code> method from the main activity and passing in the bytes to
be sent. This method then simply calls {@link
-java.io.OutputStream#write(byte[])} to send the data to the remote device.</p>
-
+java.io.OutputStream#write(byte[])} to send the data to the remote device.</p>
+
<p>The thread's <code>cancel()</code> method is important so that the connection
can be
terminated at any time by closing the {@link android.bluetooth.BluetoothSocket}.
This should always be called when you're done using the Bluetooth
-connection.</p>
-
-<div class="special">
-<p>For a demonstration of using the Bluetooth APIs, see the <a
-href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat sample app</a>.</p>
-</div>
+connection.</p>
-<h2 id="Profiles">Working with Profiles</h2>
+<div class="special">
+<p>For a demonstration of using the Bluetooth APIs, see the <a
+href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat sample app</a>.</p>
+</div>
+
+<h2 id="Profiles">Working with Profiles</h2>
<p>Starting in Android 3.0, the Bluetooth API includes support for working with
Bluetooth profiles. A <em>Bluetooth profile</em> is a wireless interface
specification for Bluetooth-based communication between devices. An example
is the Hands-Free profile. For a mobile phone to connect to a wireless headset,
-both devices must support the Hands-Free profile. </p>
+both devices must support the Hands-Free profile. </p>
<p>You can implement the interface {@link android.bluetooth.BluetoothProfile} to write
your own classes to support a particular Bluetooth profile. The Android
Bluetooth API provides implementations for the following Bluetooth
-profiles:</p>
-<ul>
+profiles:</p>
+<ul>
<li><strong>Headset</strong>. The Headset profile provides support for
Bluetooth headsets to be used with mobile phones. Android provides the {@link
@@ -917,7 +917,7 @@
profile defines how high quality audio can be streamed from one device to
another over a Bluetooth connection. Android provides the {@link
android.bluetooth.BluetoothA2dp} class, which is a proxy for controlling
-the Bluetooth A2DP Service via IPC.</li>
+the Bluetooth A2DP Service via IPC.</li>
<li><strong>Health Device</strong>. Android 4.0 (API level 14) introduces
support for the Bluetooth Health Device Profile (HDP). This lets you create
@@ -928,50 +928,50 @@
href="http://www.bluetooth.org">www.bluetooth.org</a>. Note that these values
are also referenced in the ISO/IEEE 11073-20601 [7] specification as
MDC_DEV_SPEC_PROFILE_* in the Nomenclature Codes Annex. For more discussion of
-HDP, see <a href="#HDP">Health Device Profile</a>.</li>
+HDP, see <a href="#HDP">Health Device Profile</a>.</li>
-</ul>
+</ul>
-<p>Here are the basic steps for working with a profile:</p>
-<ol>
+<p>Here are the basic steps for working with a profile:</p>
+<ol>
<li>Get the default adapter, as described in
<a href="{@docRoot}guide/topics/connectivity/bluetooth.html#SettingUp">Setting Up
- Bluetooth</a>.</li>
+ Bluetooth</a>.</li>
<li>Use {@link
android.bluetooth.BluetoothAdapter#getProfileProxy(android.content.Context,
android.bluetooth.BluetoothProfile.ServiceListener, int) getProfileProxy()} to
establish a connection to the profile proxy object associated with the profile.
In the example below, the profile proxy object is an instance of {@link
-android.bluetooth.BluetoothHeadset}. </li>
+android.bluetooth.BluetoothHeadset}. </li>
<li>Set up a {@link android.bluetooth.BluetoothProfile.ServiceListener}. This
listener notifies {@link android.bluetooth.BluetoothProfile} IPC clients when
-they have been connected to or disconnected from the service.</li>
+they have been connected to or disconnected from the service.</li>
<li>In {@link
android.bluetooth.BluetoothProfile.ServiceListener#onServiceConnected(int,
android.bluetooth.BluetoothProfile) onServiceConnected()}, get a handle
-to the profile proxy object.</li>
+to the profile proxy object.</li>
<li>Once you have the profile proxy object, you can use it to monitor the
state of the connection and perform other operations that are relevant to that
-profile.</li>
-</ol>
+profile.</li>
+</ol>
<p> For example, this code snippet shows how to connect to a {@link
android.bluetooth.BluetoothHeadset} proxy object so that you can control the
-Headset profile:</p>
+Headset profile:</p>
<pre>BluetoothHeadset mBluetoothHeadset;
-
+
// Get the default adapter
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
-
+
// Establish connection to the proxy.
mBluetoothAdapter.getProfileProxy(context, mProfileListener, BluetoothProfile.HEADSET);
-
+
private BluetoothProfile.ServiceListener mProfileListener = new BluetoothProfile.ServiceListener() {
public void onServiceConnected(int profile, BluetoothProfile proxy) {
if (profile == BluetoothProfile.HEADSET) {
@@ -984,16 +984,16 @@
}
}
};
-
+
// ... call functions on mBluetoothHeadset
-
+
// Close proxy connection after use.
mBluetoothAdapter.closeProfileProxy(mBluetoothHeadset);
-</pre>
+</pre>
-<h3 id="AT-Commands">Vendor-specific AT commands</h3>
+<h3 id="AT-Commands">Vendor-specific AT commands</h3>
<p>Starting in Android 3.0, applications can register to receive system
broadcasts of pre-defined vendor-specific AT commands sent by headsets (such as
@@ -1060,7 +1060,7 @@
establish a connection with the profile proxy object.</p> </li>
<li>Create a {@link android.bluetooth.BluetoothHealthCallback} and register an
-application configuration
+application configuration
({@link android.bluetooth.BluetoothHealthAppConfiguration})
that acts as a health
sink.</li>
diff --git a/docs/html/guide/topics/connectivity/nfc/index.jd b/docs/html/guide/topics/connectivity/nfc/index.jd
index f12facf..bc4f075 100644
--- a/docs/html/guide/topics/connectivity/nfc/index.jd
+++ b/docs/html/guide/topics/connectivity/nfc/index.jd
@@ -17,12 +17,12 @@
<p>Android-powered devices with NFC simultaneously support three main modes of operation:</p>
<ol>
-<li><strong>Reader/writer mode</strong>, allowing the NFC device to read and/or write
+<li><strong>Reader/writer mode</strong>, allowing the NFC device to read and/or write
passive NFC tags and stickers.</li>
-<li><strong>P2P mode</strong>, allowing the NFC device to exchange data with other NFC
+<li><strong>P2P mode</strong>, allowing the NFC device to exchange data with other NFC
peers; this operation mode is used by Android Beam.</li>
-<li><strong>Card emulation mode</strong>, allowing the NFC device itself to act as an NFC
-card. The emulated NFC card can then be accessed by an external NFC reader,
+<li><strong>Card emulation mode</strong>, allowing the NFC device itself to act as an NFC
+card. The emulated NFC card can then be accessed by an external NFC reader,
such as an NFC point-of-sale terminal.</li>
</ol>
diff --git a/docs/html/guide/topics/connectivity/sip.jd b/docs/html/guide/topics/connectivity/sip.jd
index d754894..d8d6d27 100755
--- a/docs/html/guide/topics/connectivity/sip.jd
+++ b/docs/html/guide/topics/connectivity/sip.jd
@@ -12,10 +12,10 @@
<li><a href="#manager">Creating a SIP Manager</a></li>
<li><a href="#profiles">Registering with a SIP Server</a></li>
<li><a href="#audio">Making an Audio Call</a></li>
- <li><a href="#receiving">Receiving Calls</a></li>
+ <li><a href="#receiving">Receiving Calls</a></li>
<li><a href="#testing">Testing SIP Applications</a></li>
</ol>
-
+
<h2>Key classes</h2>
<ol>
<li>{@link android.net.sip.SipManager}</li>
@@ -23,7 +23,7 @@
<li>{@link android.net.sip.SipAudioCall}</li>
</ol>
-
+
<h2>Related samples</h2>
<ol>
<li> <a href="{@docRoot}resources/samples/SipDemo/index.html"> SipDemo</a></li>
@@ -46,9 +46,9 @@
<h2 id="requirements">Requirements and Limitations</h2>
<p>Here are the requirements for developing a SIP application:</p>
<ul>
-
+
<li>You must have a mobile device that is running Android 2.3 or higher. </li>
-
+
<li>SIP runs over a wireless data connection, so your device must have a data
connection (with a mobile data service or Wi-Fi)</span>. This means that you
can't test on AVD—you can only test on a physical device. For details, see
@@ -139,7 +139,7 @@
manifest:</p>
<ul>
- <li><code><uses-sdk android:minSdkVersion="9" /></code>. This
+ <li><code><uses-sdk android:minSdkVersion="9" /></code>. This
indicates that your application requires Android 2.3 or higher. For more
information, see <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API
Levels</a> and the documentation for the <a
@@ -162,7 +162,7 @@
see the documentation for the <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-
feature></a> element.</li>
-
+
</ul>
<p>If your application is designed to receive calls, you must also define a receiver ({@link android.content.BroadcastReceiver} subclass) in the application's manifest: </p>
@@ -261,7 +261,7 @@
public void onRegistrationDone(String localProfileUri, long expiryTime) {
updateStatus("Ready");
}
-
+
public void onRegistrationFailed(String localProfileUri, int errorCode,
String errorMessage) {
updateStatus("Registration failed. Please check settings.");
@@ -291,8 +291,8 @@
<li>A {@link android.net.sip.SipProfile} that is making the call (the
"local profile"), and a valid SIP address to receive the call (the
-"peer profile").
-
+"peer profile").
+
<li>A {@link android.net.sip.SipManager} object. </li>
</ul>
@@ -304,7 +304,7 @@
<pre>
SipAudioCall.Listener listener = new SipAudioCall.Listener() {
-
+
@Override
public void onCallEstablished(SipAudioCall call) {
call.startAudio();
@@ -312,7 +312,7 @@
call.toggleMute();
...
}
-
+
@Override
public void onCallEnded(SipAudioCall call) {
// Do something.
@@ -326,12 +326,12 @@
<ul>
<li>A local SIP profile (the caller).</li>
<li>A peer SIP profile (the user being called).</li>
-
+
<li>A {@link android.net.sip.SipAudioCall.Listener} to listen to the call
events from {@link android.net.sip.SipAudioCall}. This can be <code>null</code>,
but as shown above, the listener is used to set things up once the call is
established.</li>
-
+
<li>The timeout value, in seconds.</li>
</ul>
<p>For example:</p>
@@ -349,15 +349,15 @@
<code><receiver></code>. In <strong>SipDemo</strong>, this is
<code><receiver android:name=".IncomingCallReceiver"
android:label="Call Receiver"/></code>.</li>
-
+
<li>Implement the receiver, which is a subclass of {@link
android.content.BroadcastReceiver}. In <strong>SipDemo</strong>, this is
<code>IncomingCallReceiver</code>.</li>
-
+
<li>Initialize the local profile ({@link android.net.sip.SipProfile}) with a
pending intent that fires your receiver when someone calls the local profile.
</li>
-
+
<li>Set up an intent filter that filters by the action that represents an
incoming call. In <strong>SipDemo</strong>, this action is
<code>android.SipDemo.INCOMING_CALL</code>. </li>
@@ -427,16 +427,16 @@
android.net.sip.SipProfile} object gets created with a pending intent based on
the action string <code>android.SipDemo.INCOMING_CALL</code>. The
<code>PendingIntent</code> object will perform a broadcast when the {@link
-android.net.sip.SipProfile} receives a call:</p>
+android.net.sip.SipProfile} receives a call:</p>
<pre>
public SipManager mSipManager = null;
public SipProfile mSipProfile = null;
...
-Intent intent = new Intent();
-intent.setAction("android.SipDemo.INCOMING_CALL");
-PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, Intent.FILL_IN_DATA);
+Intent intent = new Intent();
+intent.setAction("android.SipDemo.INCOMING_CALL");
+PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, Intent.FILL_IN_DATA);
mSipManager.open(mSipProfile, pendingIntent, null);</pre>
<p>The broadcast will be intercepted by the intent filter, which will then fire
@@ -485,8 +485,8 @@
href="{@docRoot}tools/device.html">Developing on a Device</a>.</li>
<li>If you are using Android Studio, you can view the application log output by
-opening the Event Log console (<strong>View > Tool Windows > Event Log</strong>).
-<li>Ensure your application is configured to launch Logcat automatically when it runs:
+opening the Event Log console (<strong>View > Tool Windows > Event Log</strong>).
+<li>Ensure your application is configured to launch Logcat automatically when it runs:
<ol TYPE=a>
<li>Select <strong>Run > Edit Configurations</strong>.
<li>Select the <strong>Miscellaneous</strong> tab in the <strong>Run/Debug Configurations</strong> window.
diff --git a/docs/html/guide/topics/connectivity/usb/accessory.jd b/docs/html/guide/topics/connectivity/usb/accessory.jd
index a217767..3942b3a 100644
--- a/docs/html/guide/topics/connectivity/usb/accessory.jd
+++ b/docs/html/guide/topics/connectivity/usb/accessory.jd
@@ -169,7 +169,7 @@
include a <code><uses-feature></code> element that declares that your application uses
the <code>android.hardware.usb.accessory</code> feature.</li>
- <li>If you are using the
+ <li>If you are using the
<a href="http://code.google.com/android/add-ons/google-apis/index.html">add-on library</a>,
add the <code><uses-library></code> element specifying
<code>com.android.future.usb.accessory</code> for the library.</li>
@@ -347,7 +347,7 @@
private static final String ACTION_USB_PERMISSION =
"com.android.example.USB_PERMISSION";
private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
-
+
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (ACTION_USB_PERMISSION.equals(action)) {
@@ -444,7 +444,7 @@
<pre>
BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
+ String action = intent.getAction();
if (UsbManager.ACTION_USB_ACCESSORY_DETACHED.equals(action)) {
UsbAccessory accessory = (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
diff --git a/docs/html/guide/topics/connectivity/usb/host.jd b/docs/html/guide/topics/connectivity/usb/host.jd
index d2194e6..856027d 100644
--- a/docs/html/guide/topics/connectivity/usb/host.jd
+++ b/docs/html/guide/topics/connectivity/usb/host.jd
@@ -263,7 +263,7 @@
obtain a device from the map.</p>
<pre>
UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
-...
+...
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
UsbDevice device = deviceList.get("deviceName");
</pre>
@@ -317,7 +317,7 @@
if(device != null){
//call method to set up device communication
}
- }
+ }
else {
Log.d(TAG, "permission denied for device " + device);
}
@@ -396,7 +396,7 @@
UsbInterface intf = device.getInterface(0);
UsbEndpoint endpoint = intf.getEndpoint(0);
-UsbDeviceConnection connection = mUsbManager.openDevice(device);
+UsbDeviceConnection connection = mUsbManager.openDevice(device);
connection.claimInterface(intf, forceClaim);
connection.bulkTransfer(endpoint, bytes, bytes.length, TIMEOUT); //do in another thread
</pre>
@@ -422,7 +422,7 @@
<pre>
BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
+ String action = intent.getAction();
if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action)) {
UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
diff --git a/docs/html/guide/topics/connectivity/wifip2p.jd b/docs/html/guide/topics/connectivity/wifip2p.jd
index d7e1269..b8eb40e 100644
--- a/docs/html/guide/topics/connectivity/wifip2p.jd
+++ b/docs/html/guide/topics/connectivity/wifip2p.jd
@@ -66,7 +66,7 @@
methods. A {@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION} intent is
also broadcast if the {@link android.net.wifi.p2p.WifiP2pManager#discoverPeers discoverPeers()}
method discovers that the peers list has changed.</p>
-
+
<h2 id="api">API Overview</h2>
<p>The {@link android.net.wifi.p2p.WifiP2pManager} class provides methods to allow you to interact with
@@ -135,7 +135,7 @@
are described in the following table:</p>
<p class="table-caption"><strong>Table 2.</strong> Wi-Fi P2P Listeners</p>
-
+
<table>
<tr>
<th>Listener interface</th>
@@ -395,7 +395,7 @@
available peers that are in range. The call to this function is asynchronous and a success or
failure is communicated to your application with {@link
android.net.wifi.p2p.WifiP2pManager.ActionListener#onSuccess onSuccess()} and {@link
- android.net.wifi.p2p.WifiP2pManager.ActionListener#onFailure onFailure()} if you created a
+ android.net.wifi.p2p.WifiP2pManager.ActionListener#onFailure onFailure()} if you created a
{@link android.net.wifi.p2p.WifiP2pManager.ActionListener}. The
{@link android.net.wifi.p2p.WifiP2pManager.ActionListener#onSuccess onSuccess()} method only notifies you
that the discovery process succeeded and does not provide any information about the actual peers
diff --git a/docs/html/guide/topics/data/index.jd b/docs/html/guide/topics/data/index.jd
index 1e082b3..169fc22 100644
--- a/docs/html/guide/topics/data/index.jd
+++ b/docs/html/guide/topics/data/index.jd
@@ -1,6 +1,6 @@
page.title=Data Storage
page.landing=true
-page.landing.intro=Store application data in databases, files, or preferences, in internal or removeable storage. You can also add a data backup service to let users store and recover application and system data.
+page.landing.intro=Store application data in databases, files, or preferences, in internal or removeable storage. You can also add a data backup service to let users store and recover application and system data.
page.landing.image=
@jd:body
@@ -10,14 +10,14 @@
<div class="col-12">
<h3>Training</h3>
-
+
<a href="http://developer.android.com/training/cloudsync/index.html">
<h4>Syncing to the Cloud</h4>
<p>This class covers different strategies for cloud enabled applications. It covers syncing
data with the cloud using your own back-end web application, and backing up data using the cloud so
that users can restore their data when installing your application on a new device.</p>
</a>
-
+
</div>
</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/graphics/index.jd b/docs/html/guide/topics/graphics/index.jd
index 17f6309..a87e404 100644
--- a/docs/html/guide/topics/graphics/index.jd
+++ b/docs/html/guide/topics/graphics/index.jd
@@ -17,7 +17,7 @@
by the UI toolkit are carried out using the GPU. You’ll be happy to hear that Android 4.0, Ice Cream
Sandwich, brings an improved version of the hardware-accelerated 2D rendering pipeline.</p>
</a>
-
+
<a
href="http://android-developers.blogspot.com/2011/05/introducing-viewpropertyanimator.html">
<h4>Introducing ViewPropertyAnimator</h4>
@@ -25,7 +25,7 @@
including the new properties added to the View class in 3.0. In the 3.1 release, we added a small
utility class that makes animating these properties even easier.</p>
</a>
-
+
<a
href="http://android-developers.blogspot.com/2011/03/android-30-hardware-acceleration.html">
<h4>Android 3.0 Hardware Acceleration</h4>
@@ -43,7 +43,7 @@
that keeps your user interface (UI) components responsive and avoids exceeding your application
memory limit.</p>
</a>
-
+
</div>
</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/graphics/overview.jd b/docs/html/guide/topics/graphics/overview.jd
index 66a675d..98d80a0 100644
--- a/docs/html/guide/topics/graphics/overview.jd
+++ b/docs/html/guide/topics/graphics/overview.jd
@@ -6,7 +6,7 @@
and help you decide with approach is best for your needs.</p>
<h3 id="animation">Animation</h3>
-
+
<p>The Android framework provides two animation systems: property animation
and view animation. Both animation systems are viable options,
but the property animation system, in general, is the preferred method to use, because it
diff --git a/docs/html/guide/topics/graphics/prop-animation.jd b/docs/html/guide/topics/graphics/prop-animation.jd
index aed533d..693799c 100755
--- a/docs/html/guide/topics/graphics/prop-animation.jd
+++ b/docs/html/guide/topics/graphics/prop-animation.jd
@@ -165,9 +165,9 @@
"{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html">API
Demos</a> sample project provides many examples on how to use the property
animation system.</p>
-
+
<h2 id="property-vs-view">How Property Animation Differs from View Animation</h2>
-
+
<p>The view animation system provides the capability to only animate {@link android.view.View}
objects, so if you wanted to animate non-{@link android.view.View} objects, you have to implement
your own code to do so. The view animation system is also constrained in the fact that it only
diff --git a/docs/html/guide/topics/location/strategies.jd b/docs/html/guide/topics/location/strategies.jd
index 32be463..2dfed2c 100755
--- a/docs/html/guide/topics/location/strategies.jd
+++ b/docs/html/guide/topics/location/strategies.jd
@@ -411,12 +411,12 @@
<h3 id="MockAVD">Using Android Studio</h3>
<p>Select <b>Tools</b> > <b>Android</b> > <b>AVD Manager</b>. In the Android Virtual
-Device Manager window, choose your AVD and launch it in the emulator by selecting the green
+Device Manager window, choose your AVD and launch it in the emulator by selecting the green
play arrow in the Actions column.</p>
<p>Then, select <b>Tools</b> > <b>Android</b> > <b>Android Device Monitor</b>.
-Select the Emulator Control tab in the Android Device Monitor window, and enter GPS coordinates
-under Location Controls as individual lat/long coordinates, with a GPX file for route playback,
+Select the Emulator Control tab in the Android Device Monitor window, and enter GPS coordinates
+under Location Controls as individual lat/long coordinates, with a GPX file for route playback,
or a KML file for multiple place marks.
</p>
diff --git a/docs/html/guide/topics/manifest/action-element.jd b/docs/html/guide/topics/manifest/action-element.jd
index fc6ce44..f3b340e 100644
--- a/docs/html/guide/topics/manifest/action-element.jd
+++ b/docs/html/guide/topics/manifest/action-element.jd
@@ -13,10 +13,10 @@
<p>
<dt>description:</dt>
<dd itemprop="description">Adds an action to an intent filter.
-An <code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element must contain
+An <code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element must contain
one or more {@code <action>} elements. If it doesn't contain any, no
-Intent objects will get through the filter. See
-<a href="{@docRoot}guide/components/intents-filters.html">Intents and
+Intent objects will get through the filter. See
+<a href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a> for details on intent filters and the role of action
specifications within a filter.
</dd>
@@ -25,16 +25,16 @@
<dd><dl class="attr">
<dt><a name="nm"></a>{@code android:name}</dt>
<dd>The name of the action. Some standard actions are defined in the
-{@link android.content.Intent#ACTION_CHOOSER Intent} class as
+{@link android.content.Intent#ACTION_CHOOSER Intent} class as
<code>ACTION_<i>string</i></code> constants. To assign one of these actions to
-this attribute, prepend "{@code android.intent.action.}" to the
+this attribute, prepend "{@code android.intent.action.}" to the
<code><i>string</i></code> that follows {@code ACTION_}.
For example, for {@code ACTION_MAIN}, use "{@code android.intent.action.MAIN}"
and for {@code ACTION_WEB_SEARCH}, use "{@code android.intent.action.WEB_SEARCH}".
<p>
For actions you define, it's best to use the package name as a prefix to
-ensure uniqueness. For example, a {@code TRANSMOGRIFY} action might be specified
+ensure uniqueness. For example, a {@code TRANSMOGRIFY} action might be specified
as follows:
</p>
diff --git a/docs/html/guide/topics/manifest/activity-alias-element.jd b/docs/html/guide/topics/manifest/activity-alias-element.jd
index 1427b55..adb9937 100644
--- a/docs/html/guide/topics/manifest/activity-alias-element.jd
+++ b/docs/html/guide/topics/manifest/activity-alias-element.jd
@@ -29,62 +29,62 @@
<p>
The alias presents the target activity as a independent entity.
-It can have its own set of intent filters, and they, rather than the
-intent filters on the target activity itself, determine which intents
+It can have its own set of intent filters, and they, rather than the
+intent filters on the target activity itself, determine which intents
can activate the target through the alias and how the system
-treats the alias. For example, the intent filters on the alias may
-specify the "<code>{@link android.content.Intent#ACTION_MAIN
-android.intent.action.MAIN}</code>"
-and "<code>{@link android.content.Intent#CATEGORY_LAUNCHER
-android.intent.category.LAUNCHER}</code>" flags, causing it to be
-represented in the application launcher, even though none of the
+treats the alias. For example, the intent filters on the alias may
+specify the "<code>{@link android.content.Intent#ACTION_MAIN
+android.intent.action.MAIN}</code>"
+and "<code>{@link android.content.Intent#CATEGORY_LAUNCHER
+android.intent.category.LAUNCHER}</code>" flags, causing it to be
+represented in the application launcher, even though none of the
filters on the target activity itself set these flags.
</p>
<p>
With the exception of {@code targetActivity}, {@code <activity-alias>}
-attributes are a subset of <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> attributes.
+attributes are a subset of <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> attributes.
For attributes in the subset, none of the values set for the target carry over
-to the alias. However, for attributes not in the subset, the values set for
+to the alias. However, for attributes not in the subset, the values set for
the target activity also apply to the alias.
</p></dd>
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="enabled"></a>{@code android:enabled}</dt>
-<dd>Whether or not the target activity can be instantiated by the system through
-this alias — "{@code true}" if it can be, and "{@code false}" if not.
+<dd>Whether or not the target activity can be instantiated by the system through
+this alias — "{@code true}" if it can be, and "{@code false}" if not.
The default value is "{@code true}".
<p>
-The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element has its own
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
-application components, including activity aliases. The
+The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element has its own
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
+application components, including activity aliases. The
<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> and {@code <activity-alias>}
-attributes must both be "{@code true}" for the system to be able to instantiate
-the target activity through the alias. If either is "{@code false}", the alias
+attributes must both be "{@code true}" for the system to be able to instantiate
+the target activity through the alias. If either is "{@code false}", the alias
does not work.
</p></dd>
<dt><a name="exported"></a>{@code android:exported}</dt>
-<dd>Whether or not components of other applications can launch the target activity
-through this alias — "{@code true}" if they can, and "{@code false}" if not.
-If "{@code false}", the target activity can be launched through the alias only by
-components of the same application as the alias or applications with the same user ID.
+<dd>Whether or not components of other applications can launch the target activity
+through this alias — "{@code true}" if they can, and "{@code false}" if not.
+If "{@code false}", the target activity can be launched through the alias only by
+components of the same application as the alias or applications with the same user ID.
<p>
-The default value depends on whether the alias contains intent filters. The
+The default value depends on whether the alias contains intent filters. The
absence of any filters means that the activity can be invoked through the alias
-only by specifying the exact name of the alias. This implies that the alias
-is intended only for application-internal use (since others would not know its name)
+only by specifying the exact name of the alias. This implies that the alias
+is intended only for application-internal use (since others would not know its name)
— so the default value is "{@code false}".
-On the other hand, the presence of at least one filter implies that the alias
+On the other hand, the presence of at least one filter implies that the alias
is intended for external use — so the default value is "{@code true}".
</p></dd>
<dt><a name="icon"></a>{@code android:icon}</dt>
-<dd>An icon for the target activity when presented to users through the alias.
-See the <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> element's
+<dd>An icon for the target activity when presented to users through the alias.
+See the <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> element's
<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#icon">icon</a></code> attribute for more information.
<dt><a name="label"></a>{@code android:label}</dt>
@@ -95,31 +95,31 @@
<dt><a name="nm">{@code android:name}</dt>
<dd>A unique name for the alias. The name should resemble a fully
-qualified class name. But, unlike the name of the target activity,
-the alias name is arbitrary; it does not refer to an actual class.
+qualified class name. But, unlike the name of the target activity,
+the alias name is arbitrary; it does not refer to an actual class.
</p></dd>
<dt><a name="prmsn"></a>{@code android:permission}</dt>
-<dd>The name of a permission that clients must have to launch the target activity
-or get it to do something via the alias. If a caller of
+<dd>The name of a permission that clients must have to launch the target activity
+or get it to do something via the alias. If a caller of
<code>{@link android.content.Context#startActivity startActivity()}</code> or
<code>{@link android.app.Activity#startActivityForResult startActivityForResult()}</code>
has not been granted the specified permission, the target activity will not be
-activated.
+activated.
<p>This attribute supplants any permission set for the target activity itself. If
it is not set, a permission is not needed to activate the target through the alias.
</p>
<p>
-For more information on permissions, see the
-<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#perms">Permissions</a>
+For more information on permissions, see the
+<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#perms">Permissions</a>
section in the introduction.
</p></dd>
<dt><a name="trgt"></a>{@code android:targetActivity}</dt>
<dd>The name of the activity that can be activated through the alias.
-This name must match the {@code name} attribute of an
+This name must match the {@code name} attribute of an
<code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> element that precedes
the alias in the manifest.
</p></dd>
diff --git a/docs/html/guide/topics/manifest/category-element.jd b/docs/html/guide/topics/manifest/category-element.jd
index 0034119..d0f0edf 100644
--- a/docs/html/guide/topics/manifest/category-element.jd
+++ b/docs/html/guide/topics/manifest/category-element.jd
@@ -12,19 +12,19 @@
<dt>description:</dt>
<dd itemprop="description">Adds a category name to an intent filter. See
-<a href="{@docRoot}guide/components/intents-filters.html">Intents and
+<a href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a> for details on intent filters and the role of category
specifications within a filter.</dd>
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="nm"></a>{@code android:name}</dt>
-<dd>The name of the category. Standard categories are defined in the
+<dd>The name of the category. Standard categories are defined in the
{@link android.content.Intent} class as <code>CATEGORY_<i>name</i></code>
-constants. The name assigned here can be derived from those constants
-by prefixing "{@code android.intent.category.}" to the
+constants. The name assigned here can be derived from those constants
+by prefixing "{@code android.intent.category.}" to the
<code><i>name</i></code> that follows {@code CATEGORY_}. For example,
-the string value for {@code CATEGORY_LAUNCHER} is
+the string value for {@code CATEGORY_LAUNCHER} is
"{@code android.intent.category.LAUNCHER}".
<p class="note"><strong>Note:</strong> In order to receive implicit intents, you must include the
@@ -39,7 +39,7 @@
Custom categories should use the package name as a prefix, to ensure
that they are unique.
</p></dd>
-</dl></dd>
+</dl></dd>
<!-- ##api level indication## -->
<dt>introduced in:</dt>
diff --git a/docs/html/guide/topics/manifest/grant-uri-permission-element.jd b/docs/html/guide/topics/manifest/grant-uri-permission-element.jd
index b2d9bb7..a464e55 100644
--- a/docs/html/guide/topics/manifest/grant-uri-permission-element.jd
+++ b/docs/html/guide/topics/manifest/grant-uri-permission-element.jd
@@ -14,24 +14,24 @@
<dt>description:</dt>
<dd itemprop="description">Specifies which data subsets of the parent content provider permission
-can be granted for. Data subsets are indicated by the path part of a
+can be granted for. Data subsets are indicated by the path part of a
{@code content:} URI. (The authority part of the URI identifies the
-content provider.)
-Granting permission is a way of enabling clients of the provider that don't
-normally have permission to access its data to overcome that restriction on
+content provider.)
+Granting permission is a way of enabling clients of the provider that don't
+normally have permission to access its data to overcome that restriction on
a one-time basis.
-<p>
-If a content provider's <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmns">grantUriPermissions</a></code>
-attribute is "{@code true}", permission can be granted for any the data under
-the provider's purview. However, if that attribute is "{@code false}", permission
-can be granted only to data subsets that are specified by this element.
+<p>
+If a content provider's <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmns">grantUriPermissions</a></code>
+attribute is "{@code true}", permission can be granted for any the data under
+the provider's purview. However, if that attribute is "{@code false}", permission
+can be granted only to data subsets that are specified by this element.
A provider can contain any number of {@code <grant-uri-permission>} elements.
Each one can specify only one path (only one of the three possible attributes).
</p>
<p>
-For information on how permission is granted, see the
+For information on how permission is granted, see the
<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element's
<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">grantUriPermissions</a></code> attribute.
</p></dd>
@@ -41,34 +41,34 @@
<dt><a name="path"></a>{@code android:path}
<br/>{@code android:pathPrefix}
<br/>{@code android:pathPattern}</dt>
-<dd>A path identifying the data subset or subsets that permission can be
-granted for. The {@code path} attribute specifies a complete path;
-permission can be granted only to the particular data subset identified
-by that path.
-The {@code pathPrefix} attribute specifies the initial part of a path;
-permission can be granted to all data subsets with paths that share that
-initial part.
-The {@code pathPattern} attribute specifies a complete path, but one
+<dd>A path identifying the data subset or subsets that permission can be
+granted for. The {@code path} attribute specifies a complete path;
+permission can be granted only to the particular data subset identified
+by that path.
+The {@code pathPrefix} attribute specifies the initial part of a path;
+permission can be granted to all data subsets with paths that share that
+initial part.
+The {@code pathPattern} attribute specifies a complete path, but one
that can contain the following wildcards:
<ul>
<li>An asterisk ('{@code *}') matches a sequence of 0 to many occurrences of
the immediately preceding character.</li>
-<li><p>A period followed by an asterisk ("{@code .*}") matches any sequence of
+<li><p>A period followed by an asterisk ("{@code .*}") matches any sequence of
0 to many characters.</p></li>
</ul>
<p>
-Because '{@code \}' is used as an escape character when the string is read
-from XML (before it is parsed as a pattern), you will need to double-escape:
-For example, a literal '{@code *}' would be written as "{@code \\*}" and a
-literal '{@code \}' would be written as "{@code \\\\}". This is basically
+Because '{@code \}' is used as an escape character when the string is read
+from XML (before it is parsed as a pattern), you will need to double-escape:
+For example, a literal '{@code *}' would be written as "{@code \\*}" and a
+literal '{@code \}' would be written as "{@code \\\\}". This is basically
the same as what you would need to write if constructing the string in Java code.
</p>
<p>
-For more information on these types of patterns, see the descriptions of
+For more information on these types of patterns, see the descriptions of
{@link android.os.PatternMatcher#PATTERN_LITERAL},
{@link android.os.PatternMatcher#PATTERN_PREFIX}, and
{@link android.os.PatternMatcher#PATTERN_SIMPLE_GLOB} in the
@@ -81,10 +81,10 @@
<dd>API Level 1</dd>
<dt>see also:</dt>
-<dd>the
+<dd>the
<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmns">grantUriPermissions</a></code>
-attribute of the
-<code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code>
+attribute of the
+<code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code>
element</dd>
diff --git a/docs/html/guide/topics/manifest/instrumentation-element.jd b/docs/html/guide/topics/manifest/instrumentation-element.jd
index 74be559..a476be3 100644
--- a/docs/html/guide/topics/manifest/instrumentation-element.jd
+++ b/docs/html/guide/topics/manifest/instrumentation-element.jd
@@ -23,15 +23,15 @@
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="ftest"></a>{@code android:functionalTest}</dt>
-<dd>Whether or not the Instrumentation class should run as a functional test
+<dd>Whether or not the Instrumentation class should run as a functional test
— "{@code true}" if it should, and "{@code false}" if not. The
default value is "{@code false}".</dd>
<dt><a name="hprof"></a>{@code android:handleProfiling}</dt>
-<dd>Whether or not the Instrumentation object will turn profiling on and
-off — "{@code true}" if it determines when profiling starts and
-stops, and "{@code false}" if profiling continues the entire time it is
-running. A value of "{@code true}" enables the object to target profiling
+<dd>Whether or not the Instrumentation object will turn profiling on and
+off — "{@code true}" if it determines when profiling starts and
+stops, and "{@code false}" if profiling continues the entire time it is
+running. A value of "{@code true}" enables the object to target profiling
at a specific set of operations. The default value is "{@code false}".</dd>
<dt><a name="icon"></a>{@code android:icon}</dt>
@@ -43,11 +43,11 @@
be set as a raw string or a reference to a string resource.</dd>
<dt><a name="nm"></a>{@code android:name}</dt>
-<dd>The name of the {@link android.app.Instrumentation} subclass.
-This should be a fully qualified class name (such as,
-"{@code com.example.project.StringInstrumentation}"). However, as a shorthand,
-if the first character of the name is a period, it is appended to the package
-name specified in the <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
+<dd>The name of the {@link android.app.Instrumentation} subclass.
+This should be a fully qualified class name (such as,
+"{@code com.example.project.StringInstrumentation}"). However, as a shorthand,
+if the first character of the name is a period, it is appended to the package
+name specified in the <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
<p>
There is no default. The name must be specified.
diff --git a/docs/html/guide/topics/manifest/intent-filter-element.jd b/docs/html/guide/topics/manifest/intent-filter-element.jd
index 14b4e03..13956c9 100644
--- a/docs/html/guide/topics/manifest/intent-filter-element.jd
+++ b/docs/html/guide/topics/manifest/intent-filter-element.jd
@@ -27,23 +27,23 @@
<dt>description:</dt>
<dd itemprop="description">Specifies the types of intents that an activity, service, or broadcast
receiver can respond to. An intent filter declares the capabilities of its
-parent component — what an activity or service can do and what types
-of broadcasts a receiver can handle. It opens the component to receiving
-intents of the advertised type, while filtering out those that are not
+parent component — what an activity or service can do and what types
+of broadcasts a receiver can handle. It opens the component to receiving
+intents of the advertised type, while filtering out those that are not
meaningful for the component.
<p>
-Most of the contents of the filter are described by its
-<code><a href="{@docRoot}guide/topics/manifest/action-element.html"><action></a></code>,
+Most of the contents of the filter are described by its
+<code><a href="{@docRoot}guide/topics/manifest/action-element.html"><action></a></code>,
<code><a href="{@docRoot}guide/topics/manifest/category-element.html"><category></a></code>, and
<code><a href="{@docRoot}guide/topics/manifest/data-element.html"><data></a></code> subelements.
</p>
<p>
-For a more detailed discussion of filters, see the separate
-<a href="{@docRoot}guide/components/intents-filters.html">Intents
-and Intent Filters</a> document, as well as the
-<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#ifs">Intents Filters</a>
+For a more detailed discussion of filters, see the separate
+<a href="{@docRoot}guide/components/intents-filters.html">Intents
+and Intent Filters</a> document, as well as the
+<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#ifs">Intents Filters</a>
section in the introduction.
</p></dd>
@@ -51,19 +51,19 @@
<dd><dl class="attr">
<dt><a name="icon"></a>{@code android:icon}</dt>
<dd>An icon that represents the parent activity, service, or broadcast
-receiver when that component is presented to the user as having the
+receiver when that component is presented to the user as having the
capability described by the filter.
<p>
-This attribute must be set as a reference to a drawable resource
-containing the image definition. The default value is the icon set
-by the parent component's {@code icon} attribute. If the parent
+This attribute must be set as a reference to a drawable resource
+containing the image definition. The default value is the icon set
+by the parent component's {@code icon} attribute. If the parent
does not specify an icon, the default is the icon set by the
<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element.
</p>
<p>
-For more on intent filter icons, see
+For more on intent filter icons, see
<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#iconlabel">Icons and Labels</a>
in the introduction.
</p></dd>
@@ -75,44 +75,44 @@
<p>
The label should be set as a reference to a string resource, so that
-it can be localized like other strings in the user interface.
-However, as a convenience while you're developing the application,
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
it can also be set as a raw string.
</p>
<p>
-The default value is the label set by the parent component. If the
+The default value is the label set by the parent component. If the
parent does not specify a label, the default is the label set by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
<code><a href="{@docRoot}guide/topics/manifest/application-element.html#label"> label</a></code> attribute.
</p>
<p>
-For more on intent filter labels, see
+For more on intent filter labels, see
<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#iconlabel">Icons and Labels</a>
in the introduction.
</p></dd>
<dt><a name="priority"></a>{@code android:priority}</dt>
<dd>The priority that should be given to the parent component with regard
-to handling intents of the type described by the filter. This attribute has
+to handling intents of the type described by the filter. This attribute has
meaning for both activities and broadcast receivers:
<ul>
-<li>It provides information about how able an activity is to respond to
+<li>It provides information about how able an activity is to respond to
an intent that matches the filter, relative to other activities that could
-also respond to the intent. When an intent could be handled by multiple
+also respond to the intent. When an intent could be handled by multiple
activities with different priorities, Android will consider only those with
higher priority values as potential targets for the intent.</li>
<li><p>It controls the order in which broadcast receivers are executed to
-receive broadcast messages. Those with higher priority
-values are called before those with lower values. (The order applies only
+receive broadcast messages. Those with higher priority
+values are called before those with lower values. (The order applies only
to synchronous messages; it's ignored for asynchronous messages.)</p></li>
</ul>
<p>
-Use this attribute only if you really need to impose a specific order in
+Use this attribute only if you really need to impose a specific order in
which the broadcasts are received, or want to force Android to prefer
one activity over others.
</p>
diff --git a/docs/html/guide/topics/manifest/meta-data-element.jd b/docs/html/guide/topics/manifest/meta-data-element.jd
index d3b41c3..2d1bdfe 100644
--- a/docs/html/guide/topics/manifest/meta-data-element.jd
+++ b/docs/html/guide/topics/manifest/meta-data-element.jd
@@ -19,18 +19,18 @@
<dt>description:</dt>
<dd itemprop="description">A name-value pair for an item of additional, arbitrary data that can
-be supplied to the parent component. A component element can contain any
+be supplied to the parent component. A component element can contain any
number of {@code <meta-data>} subelements. The values from all of
-them are collected in a single {@link android.os.Bundle} object and made
-available to the component as the
-{@link android.content.pm.PackageItemInfo#metaData
+them are collected in a single {@link android.os.Bundle} object and made
+available to the component as the
+{@link android.content.pm.PackageItemInfo#metaData
PackageItemInfo.metaData} field.
<p>
-Ordinary values are specified through the <code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html#value">value</a></code>
-attribute. However, to assign a resource ID as the value, use the
-<code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html#resource">resource</a></code> attribute instead. For example,
-the following code assigns whatever value is stored in the {@code @string/kangaroo}
+Ordinary values are specified through the <code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html#value">value</a></code>
+attribute. However, to assign a resource ID as the value, use the
+<code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html#resource">resource</a></code> attribute instead. For example,
+the following code assigns whatever value is stored in the {@code @string/kangaroo}
resource to the "{@code zoo}" name:
</p>
@@ -44,22 +44,22 @@
<pre><meta-data android:name="zoo" android:resource="@string/kangaroo" /></pre>
<p>
-It is highly recommended that you avoid supplying related data as
+It is highly recommended that you avoid supplying related data as
multiple separate {@code <meta-data>} entries. Instead, if you
-have complex data to associate with a component, store it as a resource and
+have complex data to associate with a component, store it as a resource and
use the {@code resource} attribute to inform the component of its ID.
</p></dd>
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="nm"></a>{@code android:name}</dt>
-<dd>A unique name for the item. To ensure that the name is unique, use a
-Java-style naming convention — for example,
+<dd>A unique name for the item. To ensure that the name is unique, use a
+Java-style naming convention — for example,
"{@code com.example.project.activity.fred}".</dd>
<dt><a name="rsrc"></a>{@code android:resource}</dt>
-<dd>A reference to a resource. The ID of the resource is the value assigned
-to the item. The ID can be retrieved from the meta-data Bundle by the
+<dd>A reference to a resource. The ID of the resource is the value assigned
+to the item. The ID can be retrieved from the meta-data Bundle by the
{@link android.os.Bundle#getInt Bundle.getInt()} method.</dd>
<dt><a name="val"></a>{@code android:value}</dt>
@@ -70,7 +70,7 @@
<th>Type</th>
<th>Bundle method</th>
</tr><tr>
- <td>String value, using double backslashes ({@code \\}) to escape characters
+ <td>String value, using double backslashes ({@code \\}) to escape characters
— such as "{@code \\n}" and "{@code \\uxxxxx}" for a Unicode character.</td>
<td>{@link android.os.Bundle#getString(String) getString()}</td>
</tr><tr>
@@ -80,7 +80,7 @@
<td>Boolean value, either "{@code true}" or "{@code false}"</td>
<td>{@link android.os.Bundle#getBoolean(String) getBoolean()}</td>
</tr><tr>
- <td>Color value, in the form "{@code #rgb}", "{@code #argb}",
+ <td>Color value, in the form "{@code #rgb}", "{@code #argb}",
"{@code #rrggbb}", or "{@code #aarrggbb}"</td>
<td>{@link android.os.Bundle#getInt(String) getInt()}</td>
</tr><tr>
diff --git a/docs/html/guide/topics/manifest/path-permission-element.jd b/docs/html/guide/topics/manifest/path-permission-element.jd
index cdaf82b..4774707 100644
--- a/docs/html/guide/topics/manifest/path-permission-element.jd
+++ b/docs/html/guide/topics/manifest/path-permission-element.jd
@@ -33,9 +33,9 @@
<dd><dl class="attr">
<dt><a name="path"></a>{@code android:path}</dt>
-<dd>A complete URI path for a subset of content provider data.
-Permission can be granted only to the particular data identified by this path.
-When used to provide search suggestion content, it must be appended
+<dd>A complete URI path for a subset of content provider data.
+Permission can be granted only to the particular data identified by this path.
+When used to provide search suggestion content, it must be appended
with "/search_suggest_query".
</dd>
@@ -47,24 +47,24 @@
<dt><a name="pathPattern"></a>{@code android:pathPattern}</dt>
<dd>A complete URI path for a subset of content provider data,
but one that can use the following wildcards:
-
-<ul>
+
+<ul>
<li>An asterisk ('<code class="Code prettyprint">*</code>'). This matches a sequence of 0 to many occurrences of
-the immediately preceding character.</li>
-
-<li>A period followed by an asterisk ("<code class="Code prettyprint">.*</code>"). This matches any sequence of
-0 or more characters.</li>
-</ul>
-
-<p>
-Because '<code class="Code prettyprint">\</code>' is used as an escape character when the string is read
+the immediately preceding character.</li>
+
+<li>A period followed by an asterisk ("<code class="Code prettyprint">.*</code>"). This matches any sequence of
+0 or more characters.</li>
+</ul>
+
+<p>
+Because '<code class="Code prettyprint">\</code>' is used as an escape character when the string is read
from XML (before it is parsed as a pattern), you will need to double-escape.
-For example, a literal '<code class="Code prettyprint">*</code>' would be written as "<code class="Code prettyprint">\\*</code>" and a
-literal '<code class="Code prettyprint">\</code>' would be written as "<code class="Code prettyprint">\\</code>". This is basically
+For example, a literal '<code class="Code prettyprint">*</code>' would be written as "<code class="Code prettyprint">\\*</code>" and a
+literal '<code class="Code prettyprint">\</code>' would be written as "<code class="Code prettyprint">\\</code>". This is basically
the same as what you would need to write if constructing the string in Java code.
-</p>
-<p>
-For more information on these types of patterns, see the descriptions of
+</p>
+<p>
+For more information on these types of patterns, see the descriptions of
<a href="/reference/android/os/PatternMatcher.html#PATTERN_LITERAL">PATTERN_LITERAL</a>,
<a href="/reference/android/os/PatternMatcher.html#PATTERN_PREFIX">PATTERN_PREFIX</a>, and
<a href="/reference/android/os/PatternMatcher.html#PATTERN_SIMPLE_GLOB">PATTERN_SIMPLE_GLOB</a> in the
@@ -74,20 +74,20 @@
<dt><a name="permission"></a>{@code android:permission}</dt>
<dd>The name of a permission that clients must have in order to read or write the
-content provider's data. This attribute is a convenient way of setting a
-single permission for both reading and writing. However, the
-<code>readPermission</code> and
+content provider's data. This attribute is a convenient way of setting a
+single permission for both reading and writing. However, the
+<code>readPermission</code> and
<code>writePermission</code> attributes take precedence
over this one.
-</dd>
+</dd>
<dt><a name="readPermission"></a>{@code android:readPermission}</dt>
<dd>A permission that clients must have in order to query the content provider.
-</dd>
+</dd>
<dt><a name="writePermission"></a>{@code android:writePermission}</dt>
<dd>A permission that clients must have in order to make changes to the data controlled by the content provider.
-</dd>
+</dd>
diff --git a/docs/html/guide/topics/manifest/permission-group-element.jd b/docs/html/guide/topics/manifest/permission-group-element.jd
index 3221d4b..85452b5 100644
--- a/docs/html/guide/topics/manifest/permission-group-element.jd
+++ b/docs/html/guide/topics/manifest/permission-group-element.jd
@@ -20,17 +20,17 @@
presented together in the user interface.
<p>
-Note that this element does not declare a permission itself, only a category in
-which permissions can be placed. See the
-<code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code> element for element for information
+Note that this element does not declare a permission itself, only a category in
+which permissions can be placed. See the
+<code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code> element for element for information
on declaring permissions and assigning them to groups.
</p></dd>
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="desc"></a>{@code android:description}</dt>
-<dd>User-readable text that describes the group. The text should be
-longer and more explanatory than the label. This attribute must be
+<dd>User-readable text that describes the group. The text should be
+longer and more explanatory than the label. This attribute must be
set as a reference to a string resource. Unlike the {@code label}
attribute, it cannot be a raw string.</dd>
@@ -39,10 +39,10 @@
as a reference to a drawable resource containing the image definition.</dd>
<dt><a name="label"></a>{@code android:label}</dt>
-<dd>A user-readable name for the group. As a convenience, the label can
-be directly set as a raw string while you're developing the application.
-However, when the application is ready to be published, it should be set
-as a reference to a string resource, so that it can be localized like other
+<dd>A user-readable name for the group. As a convenience, the label can
+be directly set as a raw string while you're developing the application.
+However, when the application is ready to be published, it should be set
+as a reference to a string resource, so that it can be localized like other
strings in the user interface.</dd>
<dt><a name="nm"></a>{@code android:name}</dt>
diff --git a/docs/html/guide/topics/manifest/permission-tree-element.jd b/docs/html/guide/topics/manifest/permission-tree-element.jd
index 21d7352..cbfd72cd 100644
--- a/docs/html/guide/topics/manifest/permission-tree-element.jd
+++ b/docs/html/guide/topics/manifest/permission-tree-element.jd
@@ -14,7 +14,7 @@
<dt>description:</dt>
<dd itemprop="description">Declares the base name for a tree of permissions. The application takes
-ownership of all names within the tree. It can dynamically add new permissions
+ownership of all names within the tree. It can dynamically add new permissions
to the tree by calling <code>{@link android.content.pm.PackageManager#addPermission PackageManager.addPermission()}</code>. Names within the tree are separated by
periods ('{@code .}'). For example, if the base name is
{@code com.example.project.taxes}, permissions like the following might be
@@ -25,30 +25,30 @@
<br/>{@code com.example.project.taxes.deductions.EXAGGERATE}</p>
<p>
-Note that this element does not declare a permission itself, only a
-namespace in which further permissions can be placed. See the
-<code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code>
+Note that this element does not declare a permission itself, only a
+namespace in which further permissions can be placed. See the
+<code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code>
element for information on declaring permissions.
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="icon"></a>{@code android:icon}</dt>
-<dd>An icon representing all the permissions in the tree. This attribute
-must be set as a reference to a drawable resource containing the image
+<dd>An icon representing all the permissions in the tree. This attribute
+must be set as a reference to a drawable resource containing the image
definition.</dd>
<dt><a name="label"></a>{@code android:label}</dt>
-<dd>A user-readable name for the group. As a convenience, the label can
-be directly set as a raw string for quick and dirty programming. However,
-when the application is ready to be published, it should be set as a
-reference to a string resource, so that it can be localized like other
+<dd>A user-readable name for the group. As a convenience, the label can
+be directly set as a raw string for quick and dirty programming. However,
+when the application is ready to be published, it should be set as a
+reference to a string resource, so that it can be localized like other
strings in the user interface.</dd>
<dt><a name="nm"></a>{@code android:name}</dt>
-<dd>The name that's at the base of the permission tree. It serves as
-a prefix to all permission names in the tree. Java-style scoping should
-be used to ensure that the name is unique. The name must have more than
-two period-separated segments in its path — for example,
+<dd>The name that's at the base of the permission tree. It serves as
+a prefix to all permission names in the tree. Java-style scoping should
+be used to ensure that the name is unique. The name must have more than
+two period-separated segments in its path — for example,
{@code com.example.base} is OK, but {@code com.example} is not.</dd>
</dl></dd>
diff --git a/docs/html/guide/topics/manifest/provider-element.jd b/docs/html/guide/topics/manifest/provider-element.jd
index 4b5c0c3..1947849 100644
--- a/docs/html/guide/topics/manifest/provider-element.jd
+++ b/docs/html/guide/topics/manifest/provider-element.jd
@@ -37,41 +37,41 @@
<dt>description:</dt>
<dd itemprop="description">
- Declares a content provider component. A content provider is a subclass of
- {@link android.content.ContentProvider} that supplies structured access to data managed by the
- application. All content providers in your application must be defined in a
+ Declares a content provider component. A content provider is a subclass of
+ {@link android.content.ContentProvider} that supplies structured access to data managed by the
+ application. All content providers in your application must be defined in a
{@code <provider>} element in the manifest file; otherwise, the system is unaware of them
and doesn't run them.
<p>
You only declare content providers that are part of your application. Content providers in
other applications that you use in your application should not be declared.
- </p>
+ </p>
<p>
The Android system stores references to content providers according to an <b>authority</b>
- string, part of the provider's <b>content URI</b>. For example, suppose you want to
+ string, part of the provider's <b>content URI</b>. For example, suppose you want to
access a content provider that stores information about health care professionals. To do
- this, you call the method
+ this, you call the method
{@link android.content.ContentResolver#query ContentResolver.query()}, which among other
arguments takes a URI that identifies the provider:
- </p>
+ </p>
<pre>
content://com.example.project.healthcareprovider/nurses/rn
</pre>
<p>
The <code>content:</code> <b>scheme</b> identifies the URI as a content URI pointing to
- an Android content provider. The authority
+ an Android content provider. The authority
<code>com.example.project.healthcareprovider</code> identifies the provider itself; the
- Android system looks up the authority in its list of known providers and their authorities.
- The substring <code>nurses/rn</code> is a <b>path</b>, which the content provider can use
+ Android system looks up the authority in its list of known providers and their authorities.
+ The substring <code>nurses/rn</code> is a <b>path</b>, which the content provider can use
to identify subsets of the provider data.
</p>
<p>
- Notice that when you define your provider in the <code><provider></code> element, you
+ Notice that when you define your provider in the <code><provider></code> element, you
don't include the scheme or the path in the <code>android:name</code> argument, only the
- authority.
+ authority.
</p>
<p>
- For information on using and developing content providers, see the API Guide,
+ For information on using and developing content providers, see the API Guide,
<a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.
</p>
</dd>
@@ -82,8 +82,8 @@
<dt><a name="auth"></a>{@code android:authorities}</dt>
<dd>
A list of one or more URI authorities that identify data offered by the content provider.
- Multiple authorities are listed by separating their names with a semicolon.
- To avoid conflicts, authority names should use a Java-style naming convention
+ Multiple authorities are listed by separating their names with a semicolon.
+ To avoid conflicts, authority names should use a Java-style naming convention
(such as {@code com.example.provider.cartoonprovider}). Typically, it's the name
of the {@link android.content.ContentProvider} subclass that implements the provider
<p>
@@ -92,92 +92,92 @@
</dd>
<dt><a name="enabled"></a>{@code android:enabled}</dt>
- <dd>Whether or not the content provider can be instantiated by the system —
- "{@code true}" if it can be, and "{@code false}" if not. The default value
+ <dd>Whether or not the content provider can be instantiated by the system —
+ "{@code true}" if it can be, and "{@code false}" if not. The default value
is "{@code true}".
<p>
-The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element has its own
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
-application components, including content providers. The
+The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element has its own
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
+application components, including content providers. The
<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> and {@code <provider>}
attributes must both be "{@code true}" (as they both
-are by default) for the content provider to be enabled. If either is
+are by default) for the content provider to be enabled. If either is
"{@code false}", the provider is disabled; it cannot be instantiated.
</p></dd>
<dt><a name="exported"></a>{@code android:exported}</dt>
<dd>
Whether the content provider is available for other applications to use:
- <ul>
+ <ul>
<li>
<code>true</code>: The provider is available to other applications. Any application can
use the provider's content URI to access it, subject to the permissions specified for
the provider.
</li>
<li>
- <code>false</code>: The provider is not available to other applications. Set
+ <code>false</code>: The provider is not available to other applications. Set
<code>android:exported="false"</code> to limit access to the provider to your
applications. Only applications that have the same user ID (UID) as the provider will
have access to it.
</li>
</ul>
<p>
- The default value is <code>"true"</code> for applications that set either
+ The default value is <code>"true"</code> for applications that set either
<code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">android:minSdkVersion</a></code>
- or
-<code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">android:targetSdkVersion</a></code> to
+ or
+<code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">android:targetSdkVersion</a></code> to
<code>"16"</code> or lower. For applications that
- set either of these attributes to <code>"17"</code> or higher, the default is
+ set either of these attributes to <code>"17"</code> or higher, the default is
<code>"false"</code>.
</p>
<p>
You can set <code>android:exported="false"</code> and still limit access to your
- provider by setting permissions with the
+ provider by setting permissions with the
<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission</a></code>
attribute.
</p>
-</dd>
+</dd>
<dt><a name="gprmsn"></a>{@code android:grantUriPermissions}</dt>
-<dd>Whether or not those who ordinarily would not have permission to
+<dd>Whether or not those who ordinarily would not have permission to
access the content provider's data can be granted permission to do so,
temporarily overcoming the restriction imposed by the
<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#rprmsn">readPermission</a></code>,
-<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#wprmsn">writePermission</a></code>, and
-<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission</a></code> attributes
-—
-"{@code true}" if permission can be granted, and "{@code false}" if not.
-If "{@code true}", permission can be granted to any of the content
-provider's data. If "{@code false}", permission can be granted only
-to the data subsets listed in
-<code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission></a></code> subelements,
+<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#wprmsn">writePermission</a></code>, and
+<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission</a></code> attributes
+—
+"{@code true}" if permission can be granted, and "{@code false}" if not.
+If "{@code true}", permission can be granted to any of the content
+provider's data. If "{@code false}", permission can be granted only
+to the data subsets listed in
+<code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission></a></code> subelements,
if any. The default value is "{@code false}".
<p>
-Granting permission is a way of giving an application component one-time
-access to data protected by a permission. For example, when an e-mail
-message contains an attachment, the mail application may call upon the
-appropriate viewer to open it, even though the viewer doesn't have general
-permission to look at all the content provider's data.
+Granting permission is a way of giving an application component one-time
+access to data protected by a permission. For example, when an e-mail
+message contains an attachment, the mail application may call upon the
+appropriate viewer to open it, even though the viewer doesn't have general
+permission to look at all the content provider's data.
</p>
-<p>
-In such cases, permission is granted by
-<code>{@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION}</code>
-and <code>{@link android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION}</code>
-flags in the Intent object that activates the component. For example, the
-mail application might put {@code FLAG_GRANT_READ_URI_PERMISSION} in the
-Intent passed to {@code Context.startActivity()}. The permission is specific
-to the URI in the Intent.
+<p>
+In such cases, permission is granted by
+<code>{@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION}</code>
+and <code>{@link android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION}</code>
+flags in the Intent object that activates the component. For example, the
+mail application might put {@code FLAG_GRANT_READ_URI_PERMISSION} in the
+Intent passed to {@code Context.startActivity()}. The permission is specific
+to the URI in the Intent.
</p>
<p>
If you enable this feature, either by setting this attribute to "{@code true}"
-or by defining <code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission></a></code>
-subelements, you must call
-<code>{@link android.content.Context#revokeUriPermission
-Context.revokeUriPermission()}</code> when a covered URI is deleted from
+or by defining <code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission></a></code>
+subelements, you must call
+<code>{@link android.content.Context#revokeUriPermission
+Context.revokeUriPermission()}</code> when a covered URI is deleted from
the provider.
</p>
@@ -187,52 +187,52 @@
</p></dd>
<dt><a name="icon"></a>{@code android:icon}</dt>
-<dd>An icon representing the content provider.
-This attribute must be set as a reference to a drawable resource containing
-the image definition. If it is not set, the icon specified for the application
-as a whole is used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code>
+<dd>An icon representing the content provider.
+This attribute must be set as a reference to a drawable resource containing
+the image definition. If it is not set, the icon specified for the application
+as a whole is used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code>
element's <code><a href="{@docRoot}guide/topics/manifest/application-element.html#icon">icon</a></code> attribute).</dd>
<dt><a name="init"></a>{@code android:initOrder}</dt>
-<dd>The order in which the content provider should be instantiated,
-relative to other content providers hosted by the same process.
-When there are dependencies among content providers, setting this
-attribute for each of them ensures that they are created in the order
-required by those dependencies. The value is a simple integer,
+<dd>The order in which the content provider should be instantiated,
+relative to other content providers hosted by the same process.
+When there are dependencies among content providers, setting this
+attribute for each of them ensures that they are created in the order
+required by those dependencies. The value is a simple integer,
with higher numbers being initialized first.</dd>
<dt><a name="label"></a>{@code android:label}</dt>
-<dd>A user-readable label for the content provided.
-If this attribute is not set, the label set for the application as a whole is
-used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
+<dd>A user-readable label for the content provided.
+If this attribute is not set, the label set for the application as a whole is
+used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
<code><a href="{@docRoot}guide/topics/manifest/application-element.html#label">label</a></code> attribute).
<p>
The label should be set as a reference to a string resource, so that
-it can be localized like other strings in the user interface.
-However, as a convenience while you're developing the application,
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
it can also be set as a raw string.
</p></dd>
<dt><a name="multi"></a>{@code android:multiprocess}</dt>
-<dd>Whether or not an instance of the content provider can be created in
+<dd>Whether or not an instance of the content provider can be created in
every client process — "{@code true}" if instances can run in multiple
processes, and "{@code false}" if not. The default value is "{@code false}".
<p>
-Normally, a content provider is instantiated in the process of the
-application that defined it. However, if this flag is set to "{@code true}",
-the system can create an instance in every process where there's a client
-that wants to interact with it, thus avoiding the overhead of interprocess
+Normally, a content provider is instantiated in the process of the
+application that defined it. However, if this flag is set to "{@code true}",
+the system can create an instance in every process where there's a client
+that wants to interact with it, thus avoiding the overhead of interprocess
communication.
</p></dd>
<dt><a name="nm"></a>{@code android:name}</dt>
-<dd>The name of the class that implements the content provider, a subclass of
-{@link android.content.ContentProvider}. This should be a fully qualified
-class name (such as, "{@code com.example.project.TransportationProvider}").
-However, as a shorthand, if the first character of the name is a period,
-it is appended to the package name specified in the
+<dd>The name of the class that implements the content provider, a subclass of
+{@link android.content.ContentProvider}. This should be a fully qualified
+class name (such as, "{@code com.example.project.TransportationProvider}").
+However, as a shorthand, if the first character of the name is a period,
+it is appended to the package name specified in the
<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
<p>
@@ -242,58 +242,58 @@
<dt><a name="prmsn"></a>{@code android:permission}</dt>
<dd>The name of a permission that clients must have to read or write the
-content provider's data. This attribute is a convenient way of setting a
-single permission for both reading and writing. However, the
-<code><a href="#rprmsn">readPermission</a></code> and
+content provider's data. This attribute is a convenient way of setting a
+single permission for both reading and writing. However, the
+<code><a href="#rprmsn">readPermission</a></code> and
<code><a href="#wprmsn">writePermission</a></code> attributes take precedence
-over this one. If the <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#rprmsn">readPermission</a></code>
+over this one. If the <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#rprmsn">readPermission</a></code>
attribute is also set, it controls access for querying the content provider.
And if the <code><a href="#wprmsn">writePermission</a></code> attribute is set,
it controls access for modifying the provider's data.
<p>
-For more information on permissions, see the
-<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a>
-section in the introduction and a separate document,
+For more information on permissions, see the
+<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a>
+section in the introduction and a separate document,
<a href="{@docRoot}guide/topics/security/security.html">Security and
Permissions</a>.
</p></dd>
<dt><a name="proc"></a>{@code android:process}</dt>
-<dd>The name of the process in which the content provider should run. Normally,
-all components of an application run in the default process created for the
-application. It has the same name as the application package. The
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code>
-attribute can set a different
+<dd>The name of the process in which the content provider should run. Normally,
+all components of an application run in the default process created for the
+application. It has the same name as the application package. The
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code>
+attribute can set a different
default for all components. But each component can override the default
-with its own {@code process} attribute, allowing you to spread your
+with its own {@code process} attribute, allowing you to spread your
application across multiple processes.
<p>
-If the name assigned to this attribute begins with a colon (':'), a new
-process, private to the application, is created when it's needed and
+If the name assigned to this attribute begins with a colon (':'), a new
+process, private to the application, is created when it's needed and
the activity runs in that process.
-If the process name begins with a lowercase character, the activity will run
+If the process name begins with a lowercase character, the activity will run
in a global process of that name, provided that it has permission to do so.
-This allows components in different applications to share a process, reducing
+This allows components in different applications to share a process, reducing
resource usage.
</p></dd>
<dt><a name="rprmsn"></a>{@code android:readPermission}</dt>
-<dd>A permission that clients must have to query the content provider.
-See also the <code><a href="#prmsn">permission</a></code> and
+<dd>A permission that clients must have to query the content provider.
+See also the <code><a href="#prmsn">permission</a></code> and
<code><a href="#wprmsn">writePermission</a></code> attributes.</dd>
<dt><a name="sync"></a>{@code android:syncable}</dt>
-<dd>Whether or not the data under the content provider's control
-is to be synchronized with data on a server — "{@code true}"
+<dd>Whether or not the data under the content provider's control
+is to be synchronized with data on a server — "{@code true}"
if it is to be synchronized, and "{@code false}" if not.</dd>
<dt><a name="wprmsn"></a>{@code android:writePermission}</dt>
-<dd>A permission that clients must have to make changes to the data
-controlled by the content provider.
-See also the <code><a href="#prmsn">permission</a></code> and
+<dd>A permission that clients must have to make changes to the data
+controlled by the content provider.
+See also the <code><a href="#prmsn">permission</a></code> and
<code><a href="#rprmsn">readPermission</a></code> attributes.</dd>
</dl></dd>
diff --git a/docs/html/guide/topics/manifest/receiver-element.jd b/docs/html/guide/topics/manifest/receiver-element.jd
index 081a191..800ee8a 100644
--- a/docs/html/guide/topics/manifest/receiver-element.jd
+++ b/docs/html/guide/topics/manifest/receiver-element.jd
@@ -24,14 +24,14 @@
<dt>description:</dt>
<dd itemprop="description">Declares a broadcast receiver (a {@link android.content.BroadcastReceiver}
-subclass) as one of the application's components. Broadcast receivers enable
-applications to receive intents that are broadcast by the system or by other
+subclass) as one of the application's components. Broadcast receivers enable
+applications to receive intents that are broadcast by the system or by other
applications, even when other components of the application are not running.
<p>
There are two ways to make a broadcast receiver known to the system: One is
declare it in the manifest file with this element. The other is to create
-the receiver dynamically in code and register it with the <code>{@link
+the receiver dynamically in code and register it with the <code>{@link
android.content.Context#registerReceiver Context.registerReceiver()}</code>
method. See the {@link android.content.BroadcastReceiver} class description
for more on dynamically created receivers.
@@ -40,14 +40,14 @@
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="enabled"></a>{@code android:enabled}</dt>
-<dd>Whether or not the broadcast receiver can be instantiated by the system —
-"{@code true}" if it can be, and "{@code false}" if not. The default value
+<dd>Whether or not the broadcast receiver can be instantiated by the system —
+"{@code true}" if it can be, and "{@code false}" if not. The default value
is "{@code true}".
<p>
-The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element has its own
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
-application components, including broadcast receivers. The
+The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element has its own
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
+application components, including broadcast receivers. The
<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> and
{@code <receiver>} attributes must both be "{@code true}" for
the broadcast receiver to be enabled. If either is "{@code false}", it is
@@ -55,72 +55,72 @@
</p></dd>
<dt><a name="exported"></a>{@code android:exported}</dt>
-<dd>Whether or not the broadcast receiver can receive messages from sources
-outside its application — "{@code true}" if it can, and "{@code false}"
-if not. If "{@code false}", the only messages the broadcast receiver can
-receive are those sent by components of the same application or applications
-with the same user ID.
+<dd>Whether or not the broadcast receiver can receive messages from sources
+outside its application — "{@code true}" if it can, and "{@code false}"
+if not. If "{@code false}", the only messages the broadcast receiver can
+receive are those sent by components of the same application or applications
+with the same user ID.
<p>
-The default value depends on whether the broadcast receiver contains intent filters.
+The default value depends on whether the broadcast receiver contains intent filters.
The absence of any filters means that it can be invoked only by Intent objects that
-specify its exact class name. This implies that the receiver is intended only for
-application-internal use (since others would not normally know the class name).
+specify its exact class name. This implies that the receiver is intended only for
+application-internal use (since others would not normally know the class name).
So in this case, the default value is "{@code false}".
-On the other hand, the presence of at least one filter implies that the broadcast
-receiver is intended to receive intents broadcast by the system or other applications,
+On the other hand, the presence of at least one filter implies that the broadcast
+receiver is intended to receive intents broadcast by the system or other applications,
so the default value is "{@code true}".
</p>
<p>
-This attribute is not the only way to limit a broadcast receiver's external exposure.
-You can also use a permission to limit the external entities that can send it messages
+This attribute is not the only way to limit a broadcast receiver's external exposure.
+You can also use a permission to limit the external entities that can send it messages
(see the <code><a href="{@docRoot}guide/topics/manifest/receiver-element.html#prmsn">permission</a></code> attribute).
</p></dd>
<dt><a name="icon"></a>{@code android:icon}</dt>
-<dd>An icon representing the broadcast receiver. This attribute must be set
-as a reference to a drawable resource containing the image definition.
-If it is not set, the icon specified for the application as a whole is used
-instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code>
+<dd>An icon representing the broadcast receiver. This attribute must be set
+as a reference to a drawable resource containing the image definition.
+If it is not set, the icon specified for the application as a whole is used
+instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code>
element's <code><a href="{@docRoot}guide/topics/manifest/application-element.html#icon">icon</a></code> attribute).
<p>
-The broadcast receiver's icon — whether set here or by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element — is also the
-default icon for all the receiver's intent filters (see the
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#icon">icon</a></code> attribute).
+The broadcast receiver's icon — whether set here or by the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element — is also the
+default icon for all the receiver's intent filters (see the
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#icon">icon</a></code> attribute).
</p></dd>
<dt><a name="label"></a>{@code android:label}</dt>
-<dd>A user-readable label for the broadcast receiver. If this attribute is not
-set, the label set for the application as a whole is
-used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
+<dd>A user-readable label for the broadcast receiver. If this attribute is not
+set, the label set for the application as a whole is
+used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
<code><a href="{@docRoot}guide/topics/manifest/application-element.html#label">label</a></code> attribute).
<p>
-The broadcast receiver's label — whether set here or by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element — is also the
-default label for all the receiver's intent filters (see the
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#label">label</a></code> attribute).
+The broadcast receiver's label — whether set here or by the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element — is also the
+default label for all the receiver's intent filters (see the
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#label">label</a></code> attribute).
</p>
<p>
The label should be set as a reference to a string resource, so that
-it can be localized like other strings in the user interface.
-However, as a convenience while you're developing the application,
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
it can also be set as a raw string.
</p></dd>
<dt><a name="nm"></a>{@code android:name}</dt>
-<dd>The name of the class that implements the broadcast receiver, a subclass of
-{@link android.content.BroadcastReceiver}. This should be a fully qualified
-class name (such as, "{@code com.example.project.ReportReceiver}"). However,
-as a shorthand, if the first character of the name is a period (for example,
-"{@code . ReportReceiver}"), it is appended to the package name specified in
-the <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
+<dd>The name of the class that implements the broadcast receiver, a subclass of
+{@link android.content.BroadcastReceiver}. This should be a fully qualified
+class name (such as, "{@code com.example.project.ReportReceiver}"). However,
+as a shorthand, if the first character of the name is a period (for example,
+"{@code . ReportReceiver}"), it is appended to the package name specified in
+the <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
<p>Once you publish your application, you <a
href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">should not
@@ -132,38 +132,38 @@
</p></dd>
<dt><a name="prmsn"></a>{@code android:permission}</dt>
-<dd>The name of a permission that broadcasters must have to send a
+<dd>The name of a permission that broadcasters must have to send a
message to the broadcast receiver.
-If this attribute is not set, the permission set by the
+If this attribute is not set, the permission set by the
<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#prmsn">permission</a></code> attribute applies
-to the broadcast receiver. If neither attribute is set, the receiver
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#prmsn">permission</a></code> attribute applies
+to the broadcast receiver. If neither attribute is set, the receiver
is not protected by a permission.
<p>
-For more information on permissions, see the
-<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a>
-section in the introduction and a separate document,
+For more information on permissions, see the
+<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a>
+section in the introduction and a separate document,
<a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a>.
</p></dd>
<dt><a name="proc"></a>{@code android:process}</dt>
-<dd>The name of the process in which the broadcast receiver should run.
-Normally, all components of an application run in the default process created
-for the application. It has the same name as the application package. The
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code> attribute can set a different
+<dd>The name of the process in which the broadcast receiver should run.
+Normally, all components of an application run in the default process created
+for the application. It has the same name as the application package. The
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code> attribute can set a different
default for all components. But each component can override the default
-with its own {@code process} attribute, allowing you to spread your
+with its own {@code process} attribute, allowing you to spread your
application across multiple processes.
<p>
-If the name assigned to this attribute begins with a colon (':'), a new
-process, private to the application, is created when it's needed and
+If the name assigned to this attribute begins with a colon (':'), a new
+process, private to the application, is created when it's needed and
the broadcast receiver runs in that process.
-If the process name begins with a lowercase character, the receiver will run
+If the process name begins with a lowercase character, the receiver will run
in a global process of that name, provided that it has permission to do so.
-This allows components in different applications to share a process, reducing
+This allows components in different applications to share a process, reducing
resource usage.
</p></dd>
</dl></dd>
diff --git a/docs/html/guide/topics/manifest/service-element.jd b/docs/html/guide/topics/manifest/service-element.jd
index fca85f5..9197a7f 100644
--- a/docs/html/guide/topics/manifest/service-element.jd
+++ b/docs/html/guide/topics/manifest/service-element.jd
@@ -25,108 +25,108 @@
<dt>description:</dt>
<dd itemprop="description">Declares a service (a {@link android.app.Service} subclass) as one
-of the application's components. Unlike activities, services lack a
-visual user interface. They're used to implement long-running background
-operations or a rich communications API that can be called by other
+of the application's components. Unlike activities, services lack a
+visual user interface. They're used to implement long-running background
+operations or a rich communications API that can be called by other
applications.
<p>
All services must be represented by {@code <service>} elements in
-the manifest file. Any that are not declared there will not be seen
+the manifest file. Any that are not declared there will not be seen
by the system and will never be run.
</p></dd>
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="enabled"></a>{@code android:enabled}</dt>
-<dd>Whether or not the service can be instantiated by the system —
-"{@code true}" if it can be, and "{@code false}" if not. The default value
+<dd>Whether or not the service can be instantiated by the system —
+"{@code true}" if it can be, and "{@code false}" if not. The default value
is "{@code true}".
<p>
-The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element has its own
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
-application components, including services. The
+The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element has its own
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
+application components, including services. The
<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> and {@code <service>}
attributes must both be "{@code true}" (as they both
-are by default) for the service to be enabled. If either is
+are by default) for the service to be enabled. If either is
"{@code false}", the service is disabled; it cannot be instantiated.
</p></dd>
<dt><a name="exported"></a>{@code android:exported}</dt>
-<dd>Whether or not components of other applications can invoke
-the service or interact with it — "{@code true}" if they can, and
-"{@code false}" if not. When the value is "{@code false}", only
-components of the same application or applications
+<dd>Whether or not components of other applications can invoke
+the service or interact with it — "{@code true}" if they can, and
+"{@code false}" if not. When the value is "{@code false}", only
+components of the same application or applications
with the same user ID can start the service or bind to it.
<p>
-The default value depends on whether the service contains intent filters. The
-absence of any filters means that it can be invoked only by specifying
-its exact class name. This implies that the service is intended only for
-application-internal use (since others would not know the class name). So in
+The default value depends on whether the service contains intent filters. The
+absence of any filters means that it can be invoked only by specifying
+its exact class name. This implies that the service is intended only for
+application-internal use (since others would not know the class name). So in
this case, the default value is "{@code false}".
-On the other hand, the presence of at least one filter implies that the service
+On the other hand, the presence of at least one filter implies that the service
is intended for external use, so the default value is "{@code true}".
</p>
<p>
This attribute is not the only way to limit the exposure of a service to other
-applications. You can also use a permission to limit the external entities that
-can interact with the service (see the <code><a href="{@docRoot}guide/topics/manifest/service-element.html#prmsn">permission</a></code>
+applications. You can also use a permission to limit the external entities that
+can interact with the service (see the <code><a href="{@docRoot}guide/topics/manifest/service-element.html#prmsn">permission</a></code>
attribute).
</p></dd>
<dt><a name="icon"></a>{@code android:icon}</dt>
-<dd>An icon representing the service. This attribute must be set as a
-reference to a drawable resource containing the image definition.
-If it is not set, the icon specified for the application
-as a whole is used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code>
+<dd>An icon representing the service. This attribute must be set as a
+reference to a drawable resource containing the image definition.
+If it is not set, the icon specified for the application
+as a whole is used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code>
element's <code><a href="{@docRoot}guide/topics/manifest/application-element.html#icon">icon</a></code> attribute).
</p>
<p>
-The service's icon — whether set here or by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element — is also the
-default icon for all the service's intent filters (see the
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element's
+The service's icon — whether set here or by the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element — is also the
+default icon for all the service's intent filters (see the
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element's
<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#icon">icon</a></code> attribute).
-</p></dd>
+</p></dd>
<dt><a name="isolated"></a>{@code android:isolatedProcess}</dt>
<dd>If set to true, this service will run under a special process that is isolated from the
rest of the system and has no permissions of its own.
- The only communication with it is through the Service API
+ The only communication with it is through the Service API
(binding and starting).</dd>
<dt><a name="label"></a>{@code android:label}</dt>
-<dd>A name for the service that can be displayed to users.
-If this attribute is not set, the label set for the application as a whole is
-used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
+<dd>A name for the service that can be displayed to users.
+If this attribute is not set, the label set for the application as a whole is
+used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
<code><a href="{@docRoot}guide/topics/manifest/application-element.html#label">label</a></code> attribute).
<p>
-The service's label — whether set here or by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element — is also the
-default label for all the service's intent filters (see the
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#label">label</a></code> attribute).
+The service's label — whether set here or by the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element — is also the
+default label for all the service's intent filters (see the
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#label">label</a></code> attribute).
</p>
<p>
The label should be set as a reference to a string resource, so that
-it can be localized like other strings in the user interface.
-However, as a convenience while you're developing the application,
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
it can also be set as a raw string.
</p></dd>
<dt><a name="nm"></a>{@code android:name}</dt>
-<dd>The name of the {@link android.app.Service} subclass that implements
-the service. This should be a fully qualified class name (such as,
-"{@code com.example.project.RoomService}"). However, as a shorthand, if
+<dd>The name of the {@link android.app.Service} subclass that implements
+the service. This should be a fully qualified class name (such as,
+"{@code com.example.project.RoomService}"). However, as a shorthand, if
the first character of the name is a period (for example, "{@code .RoomService}"),
-it is appended to the package name specified in the
-<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
+it is appended to the package name specified in the
+<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
<p>Once you publish your application, you <a
href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">should not
@@ -138,8 +138,8 @@
</p></dd>
<dt><a name="prmsn"></a>{@code android:permission}</dt>
-<dd>The name of a permission that an entity must have in order to
-launch the service or bind to it. If a caller of
+<dd>The name of a permission that an entity must have in order to
+launch the service or bind to it. If a caller of
<code>{@link android.content.Context#startService startService()}</code>,
<code>{@link android.content.Context#bindService bindService()}</code>, or
<code>{@link android.content.Context#stopService stopService()}</code>,
@@ -147,38 +147,38 @@
Intent object will not be delivered to the service.
<p>
-If this attribute is not set, the permission set by the
+If this attribute is not set, the permission set by the
<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#prmsn">permission</a></code>
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#prmsn">permission</a></code>
attribute applies to the service. If neither attribute is set, the service is
not protected by a permission.
</p>
<p>
-For more information on permissions, see the
-<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#perms">Permissions</a>
-section in the introduction and a separate document,
+For more information on permissions, see the
+<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#perms">Permissions</a>
+section in the introduction and a separate document,
<a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a>.
</p></dd>
<dt><a name="proc"></a>{@code android:process}</dt>
-<dd>The name of the process where the service is to run. Normally,
-all components of an application run in the default process created for the
-application. It has the same name as the application package. The
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code>
-attribute can set a different
+<dd>The name of the process where the service is to run. Normally,
+all components of an application run in the default process created for the
+application. It has the same name as the application package. The
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code>
+attribute can set a different
default for all components. But component can override the default
-with its own {@code process} attribute, allowing you to spread your
+with its own {@code process} attribute, allowing you to spread your
application across multiple processes.
<p>
-If the name assigned to this attribute begins with a colon (':'), a new
-process, private to the application, is created when it's needed and
+If the name assigned to this attribute begins with a colon (':'), a new
+process, private to the application, is created when it's needed and
the service runs in that process.
-If the process name begins with a lowercase character, the service will run
+If the process name begins with a lowercase character, the service will run
in a global process of that name, provided that it has permission to do so.
-This allows components in different applications to share a process, reducing
+This allows components in different applications to share a process, reducing
resource usage.
</p></dd>
</dl></dd>
diff --git a/docs/html/guide/topics/manifest/supports-gl-texture-element.jd b/docs/html/guide/topics/manifest/supports-gl-texture-element.jd
index ab751c2..a72fc81 100644
--- a/docs/html/guide/topics/manifest/supports-gl-texture-element.jd
+++ b/docs/html/guide/topics/manifest/supports-gl-texture-element.jd
@@ -3,16 +3,16 @@
parent.link=manifest-intro.html
@jd:body
- <div class="sidebox-wrapper">
+ <div class="sidebox-wrapper">
<div class="sidebox">
- <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
- <p style="color:#669999;padding-top:1em;">Google Play Filtering</p>
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
+ <p style="color:#669999;padding-top:1em;">Google Play Filtering</p>
<p style="padding-top:1em;">Google Play filters applications according
to the texture compression formats that they support, to ensure that
they can be installed only on devices that can handle their textures
properly. You can use texture compression filtering
as a way of targeting specific device types, based on GPU platform.</p>
-
+
<p style="margin-top:1em;">For important information about how
Google Play uses <code><supports-gl-texture></code> elements as
the basis for filtering, please read <a href="#market-texture-filtering">Google
diff --git a/docs/html/guide/topics/manifest/supports-screens-element.jd b/docs/html/guide/topics/manifest/supports-screens-element.jd
index a4546fa..ce2bb8d 100644
--- a/docs/html/guide/topics/manifest/supports-screens-element.jd
+++ b/docs/html/guide/topics/manifest/supports-screens-element.jd
@@ -74,7 +74,7 @@
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
@@ -84,14 +84,14 @@
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
@@ -116,7 +116,7 @@
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.
@@ -127,14 +127,14 @@
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>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—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.)
+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
@@ -209,7 +209,7 @@
android:largestWidthLimitDp} is larger than 320.</p>
<p>This attribute was introduced in API level 13.</p>
</dd>
-
+
</dl></dd>
diff --git a/docs/html/guide/topics/manifest/uses-library-element.jd b/docs/html/guide/topics/manifest/uses-library-element.jd
index aa7ca82..f8d8e62 100644
--- a/docs/html/guide/topics/manifest/uses-library-element.jd
+++ b/docs/html/guide/topics/manifest/uses-library-element.jd
@@ -3,10 +3,10 @@
parent.link=manifest-intro.html
@jd:body
-<div class="sidebox-wrapper">
+<div class="sidebox-wrapper">
<div class="sidebox">
- <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
- <p style="color:#669999;padding-top:1em;">Google Play Filtering</p>
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
+ <p style="color:#669999;padding-top:1em;">Google Play Filtering</p>
<p style="padding-top:1em;">Google Play uses the <uses-library> elements declared
in your app manifest to filter your app from devices that do not meet it's library
requirements. For more information about filtering, see the topic
diff --git a/docs/html/guide/topics/manifest/uses-permission-element.jd b/docs/html/guide/topics/manifest/uses-permission-element.jd
index 32fe21e..03a0dc1 100644
--- a/docs/html/guide/topics/manifest/uses-permission-element.jd
+++ b/docs/html/guide/topics/manifest/uses-permission-element.jd
@@ -5,10 +5,10 @@
<dl class="xml">
-<div class="sidebox-wrapper">
+<div class="sidebox-wrapper">
<div class="sidebox">
-<img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
-<p style="color:#669999;padding-top:1em;">Google Play Filtering</p>
+<img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
+<p style="color:#669999;padding-top:1em;">Google Play Filtering</p>
<p style="clear:left;">In some cases, the permissions that you request
through <code><uses-permission></code> can affect how
@@ -43,24 +43,24 @@
<dt>description:</dt>
<dd itemprop="description">Requests a permission that the application must be granted in
-order for it to operate correctly. Permissions are granted by the user when the
+order for it to operate correctly. Permissions are granted by the user when the
application is installed (on devices running Android 5.1 and lower) or while the app is running (on devices running Android 6.0 and higher).
<p>
-For more information on permissions, see the
-<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#perms">Permissions</a></code>
+For more information on permissions, see the
+<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#perms">Permissions</a></code>
section in the introduction and the separate
<a href="{@docRoot}guide/topics/security/permissions.html">System
Permissions</a> API guide.
-A list of permissions defined by the base platform can be found at
+A list of permissions defined by the base platform can be found at
{@link android.Manifest.permission android.Manifest.permission}.
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="nm"></a>{@code android:name}</dt>
-<dd>The name of the permission. It can be a permission defined by the
-application with the <code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code>
-element, a permission defined by another application, or one of the
+<dd>The name of the permission. It can be a permission defined by the
+application with the <code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code>
+element, a permission defined by another application, or one of the
standard system permissions (such as
{@link android.Manifest.permission#CAMERA "android.permission.CAMERA"}
or {@link android.Manifest.permission#READ_CONTACTS
diff --git a/docs/html/guide/topics/media/index.jd b/docs/html/guide/topics/media/index.jd
index a750c9a..c66ab30 100644
--- a/docs/html/guide/topics/media/index.jd
+++ b/docs/html/guide/topics/media/index.jd
@@ -1,6 +1,6 @@
page.title=Media and Camera
page.landing=true
-page.landing.intro=Add video, audio, and photo capabilities to your app with Android's robust APIs for playing and recording media.
+page.landing.intro=Add video, audio, and photo capabilities to your app with Android's robust APIs for playing and recording media.
page.landing.image=
@jd:body
diff --git a/docs/html/guide/topics/media/jet/jetcreator_manual.jd b/docs/html/guide/topics/media/jet/jetcreator_manual.jd
index 214c79e..c2df25b 100644
--- a/docs/html/guide/topics/media/jet/jetcreator_manual.jd
+++ b/docs/html/guide/topics/media/jet/jetcreator_manual.jd
@@ -21,7 +21,7 @@
<p>JET works in conjunction with SONiVOX's
Embedded Audio Synthesizer (EAS) which is the MIDI
playback device for Android. Both the
-JET and EAS engines are integrated into the Android embedded platform through the
+JET and EAS engines are integrated into the Android embedded platform through the
{@link android.media.JetPlayer} class, as well
as inherent in the JET Creator application. As such, the JET content author can
be sure that the playback will sound exactly the same in both the JET Creator
@@ -387,34 +387,34 @@
you first launch JET Creator you are presented with an open dialog like the
following.</p>
-
+
<p><img border=0 width=450 height=285
src="{@docRoot}images/jet/jc_open_dlg.png"
</p>
-
-
+
+
<p> <b>Open</b> will open an existing .jtc (JET Creator file) file. Use the browser
button to browse to the directory where you have saved your .jtc file.</p>
-
+
<p> <b>New</b> will create a new .jtc file.</p>
-
+
<p> <b>Import</b> will import a JET Archive (.zip) file.</p>
-
+
<p> <b>Cancel</b> will cancel the dialog and exit the application.</p>
-
-
+
+
<h1>5 Main Window </h1>
@@ -457,16 +457,16 @@
<p>The buttons along the left side of main
window do the following:</p>
-<p>Add:
+<p>Add:
Displays the segment or event window for adding a new segment or event</p>
-<p>Revise:
+<p>Revise:
Displays the segment or event window for updating an existing segment or event</p>
-<p>Delete:
+<p>Delete:
Deletes the selected segment or event (will ask for confirmation)</p>
-<p>Move:
+<p>Move:
Displays the move window which allows you to move selected segments or events
in time</p>
@@ -476,11 +476,11 @@
<p>Dequeue All: Dequeues
(deselects) all segments</p>
-<p>Play:
+<p>Play:
Starts playback of all queued segments. This button changes to Stop if any
segments are playing</p>
-<p>Audition:
+<p>Audition:
Displays the Audition window (see below)</p>
diff --git a/docs/html/guide/topics/media/jetplayer.jd b/docs/html/guide/topics/media/jetplayer.jd
index f3d55f9..0f32121 100644
--- a/docs/html/guide/topics/media/jetplayer.jd
+++ b/docs/html/guide/topics/media/jetplayer.jd
@@ -1,5 +1,5 @@
page.title=JetPlayer
-parent.title=Multimedia and Camera
+parent.title=Multimedia and Camera
parent.link=index.html
@jd:body
diff --git a/docs/html/guide/topics/processes/process-lifecycle.jd b/docs/html/guide/topics/processes/process-lifecycle.jd
index 0380f94..47ca1ec 100644
--- a/docs/html/guide/topics/processes/process-lifecycle.jd
+++ b/docs/html/guide/topics/processes/process-lifecycle.jd
@@ -48,7 +48,7 @@
at the top of the screen that the user is interacting with (its
{@link android.app.Activity#onResume} method has been called).</li>
<li> It has a {@link android.content.BroadcastReceiver} that is currently running
- (its {@link android.content.BroadcastReceiver#onReceive
+ (its {@link android.content.BroadcastReceiver#onReceive
BroadcastReceiver.onReceive()} method is executing).</li>
<li>It has a {@link android.app.Service} that is currently executing code
in one of its callbacks ({@link android.app.Service#onCreate Service.onCreate()},
diff --git a/docs/html/guide/topics/providers/calendar-provider.jd b/docs/html/guide/topics/providers/calendar-provider.jd
index 3cd4511..485f3c1 100644
--- a/docs/html/guide/topics/providers/calendar-provider.jd
+++ b/docs/html/guide/topics/providers/calendar-provider.jd
@@ -42,7 +42,7 @@
<li><a href="#intent-view">Using intents to view calendar data</a></li>
</ol>
</li>
-
+
<li><a href="#sync-adapter">Sync Adapters</a></li>
</ol>
@@ -63,8 +63,8 @@
<p>The Calender Provider API can be used by applications and sync adapters. The
rules vary depending on what type of program is making the calls. This document
-focuses primarily on using the Calendar Provider API as an application. For
-a discussion of how sync adapters are different, see
+focuses primarily on using the Calendar Provider API as an application. For
+a discussion of how sync adapters are different, see
<a href="#sync-adapter">Sync Adapters</a>.</p>
@@ -79,17 +79,17 @@
<h2 id="overview">Basics</h2>
-<p><a href="{@docRoot}guide/topics/providers/content-providers.html">Content providers</a> store data and make it accessible to
+<p><a href="{@docRoot}guide/topics/providers/content-providers.html">Content providers</a> store data and make it accessible to
applications. The content providers offered by the Android platform (including the Calendar Provider) typically expose data as a set of tables based on a
relational database model, where each row is a record and each column is data of
a particular type and meaning. Through the Calendar Provider API, applications
and sync adapters can get read/write access to the database tables that hold a
user's calendar data.</p>
-<p>Every content provider exposes a public URI (wrapped as a
-{@link android.net.Uri}
+<p>Every content provider exposes a public URI (wrapped as a
+{@link android.net.Uri}
object) that uniquely identifies its data set. A content provider that controls
- multiple data sets (multiple tables) exposes a separate URI for each one. All
+ multiple data sets (multiple tables) exposes a separate URI for each one. All
URIs for providers begin with the string "content://". This
identifies the data as being controlled by a content provider. The Calendar
Provider defines constants for the URIs for each of its classes (tables). These
@@ -113,26 +113,26 @@
</tr>
<tr>
<td><p>{@link android.provider.CalendarContract.Calendars}</p></td>
-
- <td>This table holds
+
+ <td>This table holds
the calendar-specific information. Each row in this table contains the details for
a single calendar, such as the name, color, sync information, and so on.</td>
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Events}</td>
-
+
<td>This table holds the
event-specific information. Each row in this table has the information for a single
event—for example, event title, location, start time, end
time, and so on. The event can occur one-time or can recur multiple times. Attendees,
-reminders, and extended properties are stored in separate tables.
-They each have an {@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}
+reminders, and extended properties are stored in separate tables.
+They each have an {@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}
that references the {@link android.provider.BaseColumns#_ID} in the Events table.</td>
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Instances}</td>
-
+
<td>This table holds the
start and end time for each occurrence of an event. Each row in this table
represents a single event occurrence. For one-time events there is a 1:1 mapping
@@ -141,7 +141,7 @@
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Attendees}</td>
-
+
<td>This table holds the
event attendee (guest) information. Each row represents a single guest of an
event. It specifies the type of guest and the guest's attendance response
@@ -149,17 +149,17 @@
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Reminders}</td>
-
+
<td>This table holds the
alert/notification data. Each row represents a single alert for an event. An
event can have multiple reminders. The maximum number of reminders per event is
-specified in
-{@link android.provider.CalendarContract.CalendarColumns#MAX_REMINDERS},
+specified in
+{@link android.provider.CalendarContract.CalendarColumns#MAX_REMINDERS},
which is set by the sync adapter that
owns the given calendar. Reminders are specified in minutes before the event
and have a method that determines how the user will be alerted.</td>
</tr>
-
+
</table>
<p>The Calendar Provider API is designed to be flexible and powerful. At the
@@ -178,9 +178,9 @@
<li><strong>Sync adapters.</strong> A sync adapter synchronizes the calendar data
-on a user's device with another server or data source. In the
+on a user's device with another server or data source. In the
{@link android.provider.CalendarContract.Calendars} and
-{@link android.provider.CalendarContract.Events} tables,
+{@link android.provider.CalendarContract.Events} tables,
there are columns that are reserved for the sync adapters to use.
The provider and applications should not modify them. In fact, they are not
visible unless they are accessed as a sync adapter. For more information about
@@ -209,9 +209,9 @@
<h2 id="calendar">Calendars Table</h2>
-<p>The {@link android.provider.CalendarContract.Calendars} table contains details
+<p>The {@link android.provider.CalendarContract.Calendars} table contains details
for individual calendars. The following
-Calendars columns are writable by both an application and a <a href="#sync-adapter">sync adapter</a>.
+Calendars columns are writable by both an application and a <a href="#sync-adapter">sync adapter</a>.
For a full list of supported fields, see the
{@link android.provider.CalendarContract.Calendars} reference.</p>
<table>
@@ -229,7 +229,7 @@
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Calendars#VISIBLE}</td>
-
+
<td>A boolean indicating whether the calendar is selected to be displayed. A
value of 0 indicates that events associated with this calendar should not be
shown. A value of 1 indicates that events associated with this calendar should
@@ -240,7 +240,7 @@
</tr>
<tr>
<td>{@link android.provider.CalendarContract.CalendarColumns#SYNC_EVENTS}</td>
-
+
<td>A boolean indicating whether the calendar should be synced and have its
events stored on the device. A value of 0 says do not sync this calendar or
store its events on the device. A value of 1 says sync events for this calendar
@@ -253,8 +253,8 @@
<p>Here is an example that shows how to get the calendars that are owned by a particular
user. For simplicity's sake, in this example the query operation is shown in the
user interface thread ("main thread"). In practice, this should be done in an asynchronous
-thread instead of on the main thread. For more discussion, see
-<a href="{@docRoot}guide/components/loaders.html">Loaders</a>. If you are not just
+thread instead of on the main thread. For more discussion, see
+<a href="{@docRoot}guide/components/loaders.html">Loaders</a>. If you are not just
reading data but modifying it, see {@link android.content.AsyncQueryHandler}.
</p>
@@ -268,18 +268,18 @@
Calendars.CALENDAR_DISPLAY_NAME, // 2
Calendars.OWNER_ACCOUNT // 3
};
-
+
// The indices for the projection array above.
private static final int PROJECTION_ID_INDEX = 0;
private static final int PROJECTION_ACCOUNT_NAME_INDEX = 1;
private static final int PROJECTION_DISPLAY_NAME_INDEX = 2;
private static final int PROJECTION_OWNER_ACCOUNT_INDEX = 3;</pre>
-
+
<div class="sidebox-wrapper"> <div class="sidebox"> <h3>Why must you include
ACCOUNT_TYPE?</h3> <p>If you query on a {@link
android.provider.CalendarContract.Calendars#ACCOUNT_NAME
-Calendars.ACCOUNT_NAME}, you must also include
+Calendars.ACCOUNT_NAME}, you must also include
{@link android.provider.CalendarContract.Calendars#ACCOUNT_TYPE Calendars.ACCOUNT_TYPE}
in the selection. That is because a given account is
only considered unique given both its <code>ACCOUNT_NAME</code> and its
@@ -289,7 +289,7 @@
android.provider.CalendarContract#ACCOUNT_TYPE_LOCAL} for calendars not
associated with a device account. {@link
android.provider.CalendarContract#ACCOUNT_TYPE_LOCAL} accounts do not get
-synced.</p> </div> </div>
+synced.</p> </div> </div>
<p> In the next part of the example, you construct your query. The selection
@@ -301,59 +301,59 @@
has viewed, not just calendars the user owns, omit the <code>OWNER_ACCOUNT</code>.
The query returns a {@link android.database.Cursor}
object that you can use to traverse the result set returned by the database
-query. For more discussion of using queries in content providers,
+query. For more discussion of using queries in content providers,
see <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.</p>
<pre>// Run query
Cursor cur = null;
ContentResolver cr = getContentResolver();
-Uri uri = Calendars.CONTENT_URI;
-String selection = "((" + Calendars.ACCOUNT_NAME + " = ?) AND ("
+Uri uri = Calendars.CONTENT_URI;
+String selection = "((" + Calendars.ACCOUNT_NAME + " = ?) AND ("
+ Calendars.ACCOUNT_TYPE + " = ?) AND ("
+ Calendars.OWNER_ACCOUNT + " = ?))";
String[] selectionArgs = new String[] {"sampleuser@gmail.com", "com.google",
- "sampleuser@gmail.com"};
-// Submit the query and get a Cursor object back.
+ "sampleuser@gmail.com"};
+// Submit the query and get a Cursor object back.
cur = cr.query(uri, EVENT_PROJECTION, selection, selectionArgs, null);</pre>
<p>This next section uses the cursor to step through the result set. It uses the
constants that were set up at the beginning of the example to return the values
for each field.</p>
-
+
<pre>// Use the cursor to step through the returned records
while (cur.moveToNext()) {
long calID = 0;
String displayName = null;
String accountName = null;
String ownerName = null;
-
+
// Get the field values
calID = cur.getLong(PROJECTION_ID_INDEX);
displayName = cur.getString(PROJECTION_DISPLAY_NAME_INDEX);
accountName = cur.getString(PROJECTION_ACCOUNT_NAME_INDEX);
ownerName = cur.getString(PROJECTION_OWNER_ACCOUNT_INDEX);
-
+
// Do something with the values...
...
}
</pre>
-
+
<h3 id="modify-calendar">Modifying a calendar</h3>
<p>To perform an update of an calendar, you can provide the {@link
android.provider.BaseColumns#_ID} of the calendar either as an appended ID to
-the Uri
+the Uri
-({@link android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()})
+({@link android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()})
or as the first selection item. The selection
should start with <code>"_id=?"</code>, and the first
<code>selectionArg</code> should be the {@link
-android.provider.BaseColumns#_ID} of the calendar.
+android.provider.BaseColumns#_ID} of the calendar.
You can also do updates by encoding the ID in the URI. This example changes a
-calendar's display name using the
-({@link android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()})
+calendar's display name using the
+({@link android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()})
approach:</p>
<pre>private static final String DEBUG_TAG = "MyActivity";
@@ -375,7 +375,7 @@
the calendar insertion as a sync adapter, using an {@link
android.provider.CalendarContract.SyncColumns#ACCOUNT_TYPE} of {@link
android.provider.CalendarContract#ACCOUNT_TYPE_LOCAL}.
-{@link android.provider.CalendarContract#ACCOUNT_TYPE_LOCAL}
+{@link android.provider.CalendarContract#ACCOUNT_TYPE_LOCAL}
is a special account type for calendars that are not
associated with a device account. Calendars of this type are not synced to a server. For a
discussion of sync adapters, see <a href="#sync-adapter">Sync Adapters</a>.</p>
@@ -434,7 +434,7 @@
</tr>
<tr>
<td>{@link android.provider.CalendarContract.EventsColumns#DURATION}</td>
-
+
<td>The duration of the event in <a
href="http://tools.ietf.org/html/rfc5545#section-3.8.2.5">RFC5545</a> format.
For example, a value of <code>"PT1H"</code> states that the event
@@ -445,41 +445,41 @@
</tr>
<tr>
<td>{@link android.provider.CalendarContract.EventsColumns#ALL_DAY}</td>
-
+
<td>A value of 1 indicates this event occupies the entire day, as defined by
the local time zone. A value of 0 indicates it is a regular event that may start
and end at any time during a day.</td>
-
+
</tr>
-
-
+
+
<tr>
<td>{@link android.provider.CalendarContract.EventsColumns#RRULE}</td>
-
+
<td>The recurrence rule for the event format. For
example, <code>"FREQ=WEEKLY;COUNT=10;WKST=SU"</code>. You can find
more examples <a
href="http://tools.ietf.org/html/rfc5545#section-3.8.5.3">here</a>.</td>
-
+
</tr>
-
+
<tr>
<td>{@link android.provider.CalendarContract.EventsColumns#RDATE}</td>
- <td>The recurrence dates for the event.
- You typically use {@link android.provider.CalendarContract.EventsColumns#RDATE}
- in conjunction with {@link android.provider.CalendarContract.EventsColumns#RRULE}
+ <td>The recurrence dates for the event.
+ You typically use {@link android.provider.CalendarContract.EventsColumns#RDATE}
+ in conjunction with {@link android.provider.CalendarContract.EventsColumns#RRULE}
to define an aggregate set of
repeating occurrences. For more discussion, see the <a
href="http://tools.ietf.org/html/rfc5545#section-3.8.5.2">RFC5545 spec</a>.</td>
</tr>
-
+
<tr>
<td>{@link android.provider.CalendarContract.EventsColumns#AVAILABILITY}</td>
-
- <td>If this event counts as busy time or is free time that can be
+
+ <td>If this event counts as busy time or is free time that can be
scheduled over. </td>
-
+
</tr>
<tr>
<td>{@link android.provider.CalendarContract.EventsColumns#GUESTS_CAN_MODIFY}</td>
@@ -519,11 +519,11 @@
android.content.Intent#ACTION_INSERT INSERT} Intent, described in <a
href="#intent-insert">Using an intent to insert an event</a>—in that
scenario, a default time zone is supplied.</li>
-
+
<li>For non-recurring events, you must include {@link
android.provider.CalendarContract.EventsColumns#DTEND}. </li>
-
-
+
+
<li>For recurring events, you must include a {@link
android.provider.CalendarContract.EventsColumns#DURATION} in addition to {@link
android.provider.CalendarContract.EventsColumns#RRULE} or {@link
@@ -532,9 +532,9 @@
android.content.Intent#ACTION_INSERT INSERT} Intent, described in <a
href="#intent-insert">Using an intent to insert an event</a>—in that
scenario, you can use an {@link
-android.provider.CalendarContract.EventsColumns#RRULE} in conjunction with {@link android.provider.CalendarContract.EventsColumns#DTSTART} and {@link android.provider.CalendarContract.EventsColumns#DTEND}, and the Calendar application
+android.provider.CalendarContract.EventsColumns#RRULE} in conjunction with {@link android.provider.CalendarContract.EventsColumns#DTSTART} and {@link android.provider.CalendarContract.EventsColumns#DTEND}, and the Calendar application
converts it to a duration automatically.</li>
-
+
</ul>
<p>Here is an example of inserting an event. This is being performed in the UI
@@ -545,8 +545,8 @@
<pre>
long calID = 3;
-long startMillis = 0;
-long endMillis = 0;
+long startMillis = 0;
+long endMillis = 0;
Calendar beginTime = Calendar.getInstance();
beginTime.set(2012, 9, 14, 7, 30);
startMillis = beginTime.getTimeInMillis();
@@ -567,7 +567,7 @@
// get the event ID that is the last element in the Uri
long eventID = Long.parseLong(uri.getLastPathSegment());
-//
+//
// ... do something with event ID
//
//</pre>
@@ -584,14 +584,14 @@
that you use an {@link android.content.Intent#ACTION_EDIT EDIT} Intent, as
described in <a href="#intent-edit">Using an intent to edit an event</a>.
However, if you need to, you can edit events directly. To perform an update of
-an Event, you can provide the <code>_ID</code> of the
+an Event, you can provide the <code>_ID</code> of the
event either as an appended ID to the Uri ({@link
-android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()})
-or as the first selection item.
+android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()})
+or as the first selection item.
The selection should start with <code>"_id=?"</code>, and the first
<code>selectionArg</code> should be the <code>_ID</code> of the event. You can
also do updates using a selection with no ID. Here is an example of updating an
-event. It changes the title of the event using the
+event. It changes the title of the event using the
{@link android.content.ContentUris#withAppendedId(android.net.Uri,long) withAppendedId()}
approach:</p>
@@ -604,7 +604,7 @@
ContentValues values = new ContentValues();
Uri updateUri = null;
// The new title for the event
-values.put(Events.TITLE, "Kickboxing");
+values.put(Events.TITLE, "Kickboxing");
updateUri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
int rows = getContentResolver().update(updateUri, values, null, null);
Log.i(DEBUG_TAG, "Rows updated: " + rows); </pre>
@@ -631,22 +631,22 @@
Uri deleteUri = null;
deleteUri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
int rows = getContentResolver().delete(deleteUri, null, null);
-Log.i(DEBUG_TAG, "Rows deleted: " + rows);
+Log.i(DEBUG_TAG, "Rows deleted: " + rows);
</pre>
<h2 id="attendees">Attendees Table</h2>
<p>Each row of the {@link android.provider.CalendarContract.Attendees} table
-represents a single attendee or guest of an event. Calling
-{@link android.provider.CalendarContract.Reminders#query(android.content.ContentResolver, long, java.lang.String[]) query()}
+represents a single attendee or guest of an event. Calling
+{@link android.provider.CalendarContract.Reminders#query(android.content.ContentResolver, long, java.lang.String[]) query()}
returns a list of attendees for the
-event with the given {@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}.
-This {@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}
+event with the given {@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}.
+This {@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}
must match the {@link
-android.provider.BaseColumns#_ID} of a particular event.</p>
+android.provider.BaseColumns#_ID} of a particular event.</p>
<p>The following table lists the
-writable fields. When inserting a new attendee, you must include all of them
+writable fields. When inserting a new attendee, you must include all of them
except <code>ATTENDEE_NAME</code>.
</p>
@@ -704,7 +704,7 @@
<h3 id="add-attendees">Adding Attendees</h3>
<p>Here is an example that adds a single attendee to an event. Note that the
-{@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}
+{@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}
is required:</p>
<pre>
@@ -724,17 +724,17 @@
<h2 id="reminders">Reminders Table</h2>
<p>Each row of the {@link android.provider.CalendarContract.Reminders} table
-represents a single reminder for an event. Calling
+represents a single reminder for an event. Calling
{@link android.provider.CalendarContract.Reminders#query(android.content.ContentResolver, long, java.lang.String[]) query()} returns a list of reminders for the
-event with the given
+event with the given
{@link android.provider.CalendarContract.AttendeesColumns#EVENT_ID}.</p>
<p>The following table lists the writable fields for reminders. All of them must
be included when inserting a new reminder. Note that sync adapters specify the
types of reminders they support in the {@link
-android.provider.CalendarContract.Calendars} table. See
-{@link android.provider.CalendarContract.CalendarColumns#ALLOWED_REMINDERS}
+android.provider.CalendarContract.Calendars} table. See
+{@link android.provider.CalendarContract.CalendarColumns#ALLOWED_REMINDERS}
for details.</p>
@@ -779,16 +779,16 @@
<h2 id="instances">Instances Table</h2>
-<p>The
+<p>The
{@link android.provider.CalendarContract.Instances} table holds the
start and end time for occurrences of an event. Each row in this table
represents a single event occurrence. The instances table is not writable and only
provides a way to query event occurrences. </p>
-<p>The following table lists some of the fields you can query on for an instance. Note
-that time zone is defined by
-{@link android.provider.CalendarContract.CalendarCache#KEY_TIMEZONE_TYPE}
-and
+<p>The following table lists some of the fields you can query on for an instance. Note
+that time zone is defined by
+{@link android.provider.CalendarContract.CalendarCache#KEY_TIMEZONE_TYPE}
+and
{@link android.provider.CalendarContract.CalendarCache#KEY_TIMEZONE_INSTANCES}.</p>
@@ -807,18 +807,18 @@
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Instances#END_DAY}</td>
-
+
<td>The Julian end day of the instance, relative to the Calendar's time
-zone.
-
+zone.
+
</td>
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Instances#END_MINUTE}</td>
-
+
<td>The end minute of the instance measured from midnight in the
Calendar's time zone.</td>
-
+
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Instances#EVENT_ID}</td>
@@ -826,16 +826,16 @@
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Instances#START_DAY}</td>
- <td>The Julian start day of the instance, relative to the Calendar's time zone.
+ <td>The Julian start day of the instance, relative to the Calendar's time zone.
</td>
</tr>
<tr>
<td>{@link android.provider.CalendarContract.Instances#START_MINUTE}</td>
-
+
<td>The start minute of the instance measured from midnight, relative to the
-Calendar's time zone.
+Calendar's time zone.
</td>
-
+
</tr>
</table>
@@ -846,7 +846,7 @@
in the URI. In this example, {@link android.provider.CalendarContract.Instances}
gets access to the {@link
android.provider.CalendarContract.EventsColumns#TITLE} field through its
-implementation of the {@link android.provider.CalendarContract.EventsColumns} interface.
+implementation of the {@link android.provider.CalendarContract.EventsColumns} interface.
In other words, {@link
android.provider.CalendarContract.EventsColumns#TITLE} is returned through a
database view, not through querying the raw {@link
@@ -859,7 +859,7 @@
Instances.BEGIN, // 1
Instances.TITLE // 2
};
-
+
// The indices for the projection array above.
private static final int PROJECTION_ID_INDEX = 0;
private static final int PROJECTION_BEGIN_INDEX = 1;
@@ -874,7 +874,7 @@
Calendar endTime = Calendar.getInstance();
endTime.set(2011, 10, 24, 8, 0);
long endMillis = endTime.getTimeInMillis();
-
+
Cursor cur = null;
ContentResolver cr = getContentResolver();
@@ -889,28 +889,28 @@
ContentUris.appendId(builder, endMillis);
// Submit the query
-cur = cr.query(builder.build(),
- INSTANCE_PROJECTION,
- selection,
- selectionArgs,
+cur = cr.query(builder.build(),
+ INSTANCE_PROJECTION,
+ selection,
+ selectionArgs,
null);
-
+
while (cur.moveToNext()) {
String title = null;
long eventID = 0;
- long beginVal = 0;
-
+ long beginVal = 0;
+
// Get the field values
eventID = cur.getLong(PROJECTION_ID_INDEX);
beginVal = cur.getLong(PROJECTION_BEGIN_INDEX);
title = cur.getString(PROJECTION_TITLE_INDEX);
-
- // Do something with the values.
- Log.i(DEBUG_TAG, "Event: " + title);
+
+ // Do something with the values.
+ Log.i(DEBUG_TAG, "Event: " + title);
Calendar calendar = Calendar.getInstance();
- calendar.setTimeInMillis(beginVal);
+ calendar.setTimeInMillis(beginVal);
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
- Log.i(DEBUG_TAG, "Date: " + formatter.format(calendar.getTime()));
+ Log.i(DEBUG_TAG, "Date: " + formatter.format(calendar.getTime()));
}
}</pre>
@@ -928,9 +928,9 @@
<td><br>
{@link android.content.Intent#ACTION_VIEW VIEW} <br></td>
<td><p><code>content://com.android.calendar/time/<ms_since_epoch></code></p>
- You can also refer to the URI with
-{@link android.provider.CalendarContract#CONTENT_URI CalendarContract.CONTENT_URI}.
-For an example of using this intent, see <a href="{@docRoot}guide/topics/providers/calendar-provider.html#intent-view">Using intents to view calendar data</a>.
+ You can also refer to the URI with
+{@link android.provider.CalendarContract#CONTENT_URI CalendarContract.CONTENT_URI}.
+For an example of using this intent, see <a href="{@docRoot}guide/topics/providers/calendar-provider.html#intent-view">Using intents to view calendar data</a>.
</td>
<td>Open calendar to the time specified by <code><ms_since_epoch></code>.</td>
@@ -941,11 +941,11 @@
</td>
<td><p><code>content://com.android.calendar/events/<event_id></code></p>
-
- You can also refer to the URI with
-{@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.
+
+ You can also refer to the URI with
+{@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.
For an example of using this intent, see <a href="{@docRoot}guide/topics/providers/calendar-provider.html#intent-view">Using intents to view calendar data</a>.
-
+
</td>
<td>View the event specified by <code><event_id></code>.</td>
@@ -958,12 +958,12 @@
<tr>
<td>{@link android.content.Intent#ACTION_EDIT EDIT} </td>
<td><p><code>content://com.android.calendar/events/<event_id></code></p>
-
- You can also refer to the URI with
-{@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.
+
+ You can also refer to the URI with
+{@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.
For an example of using this intent, see <a href="{@docRoot}guide/topics/providers/calendar-provider.html#intent-edit">Using an intent to edit an event</a>.
-
-
+
+
</td>
<td>Edit the event specified by <code><event_id></code>.</td>
@@ -978,11 +978,11 @@
<br>
{@link android.content.Intent#ACTION_INSERT INSERT} </td>
<td><p><code>content://com.android.calendar/events</code></p>
-
- You can also refer to the URI with
-{@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.
+
+ You can also refer to the URI with
+{@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}.
For an example of using this intent, see <a href="{@docRoot}guide/topics/providers/calendar-provider.html#intent-insert">Using an intent to insert an event</a>.
-
+
</td>
<td>Create an event.</td>
@@ -1002,7 +1002,7 @@
<td>Name for the event.</td>
</tr>
<tr>
-
+
<td>{@link android.provider.CalendarContract#EXTRA_EVENT_BEGIN_TIME
CalendarContract.EXTRA_EVENT_BEGIN_TIME}</td>
<td>Event begin time in milliseconds from the epoch.</td>
@@ -1010,25 +1010,25 @@
<tr>
<td>{@link android.provider.CalendarContract#EXTRA_EVENT_END_TIME
CalendarContract.EXTRA_EVENT_END_TIME}</td>
-
+
<td>Event end time in milliseconds from the epoch.</td>
</tr>
<tr>
<td>{@link android.provider.CalendarContract#EXTRA_EVENT_ALL_DAY
CalendarContract.EXTRA_EVENT_ALL_DAY}</td>
-
+
<td>A boolean that indicates that an event is all day. Value can be
<code>true</code> or <code>false</code>.</td> </tr>
<tr>
<td>{@link android.provider.CalendarContract.EventsColumns#EVENT_LOCATION
Events.EVENT_LOCATION}</td>
-
+
<td>Location of the event.</td>
</tr>
<tr>
<td>{@link android.provider.CalendarContract.EventsColumns#DESCRIPTION
Events.DESCRIPTION}</td>
-
+
<td>Event description.</td>
</tr>
<tr>
@@ -1045,16 +1045,16 @@
<td>
{@link android.provider.CalendarContract.EventsColumns#ACCESS_LEVEL
Events.ACCESS_LEVEL}</td>
-
+
<td>Whether the event is private or public.</td>
</tr>
<tr>
<td>{@link android.provider.CalendarContract.EventsColumns#AVAILABILITY
Events.AVAILABILITY}</td>
-
+
<td>If this event counts as busy time or is free time that can be scheduled over.</td>
-
-</table>
+
+</table>
<p>The following sections describe how to use these intents.</p>
@@ -1066,23 +1066,23 @@
android.Manifest.permission#WRITE_CALENDAR} permission included in its <a
href="#manifest">manifest file</a>.</p>
-
+
<p>When users run an application that uses this approach, the application sends
them to the Calendar to finish adding the event. The {@link
android.content.Intent#ACTION_INSERT INSERT} Intent uses extra fields to
pre-populate a form with the details of the event in the Calendar. Users can
then cancel the event, edit the form as needed, or save the event to their
calendars.</p>
-
+
<p>Here is a code snippet that schedules an event on January 19, 2012, that runs
from 7:30 a.m. to 8:30 a.m. Note the following about this code snippet:</p>
<ul>
- <li>It specifies {@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}
+ <li>It specifies {@link android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI}
as the Uri.</li>
-
+
<li>It uses the {@link
android.provider.CalendarContract#EXTRA_EVENT_BEGIN_TIME
CalendarContract.EXTRA_EVENT_BEGIN_TIME} and {@link
@@ -1090,10 +1090,10 @@
CalendarContract.EXTRA_EVENT_END_TIME} extra fields to pre-populate the form
with the time of the event. The values for these times must be in UTC milliseconds
from the epoch.</li>
-
+
<li>It uses the {@link android.content.Intent#EXTRA_EMAIL Intent.EXTRA_EMAIL}
extra field to provide a comma-separated list of invitees, specified by email address.</li>
-
+
</ul>
<pre>
Calendar beginTime = Calendar.getInstance();
@@ -1166,18 +1166,18 @@
<ul>
<li>A sync adapter needs to specify that it's a sync adapter by setting {@link android.provider.CalendarContract#CALLER_IS_SYNCADAPTER} to <code>true</code>.</li>
-
-
+
+
<li>A sync adapter needs to provide an {@link
android.provider.CalendarContract.SyncColumns#ACCOUNT_NAME} and an {@link
android.provider.CalendarContract.SyncColumns#ACCOUNT_TYPE} as query parameters in the URI. </li>
-
+
<li>A sync adapter has write access to more columns than an application or widget.
- For example, an application can only modify a few characteristics of a calendar,
+ For example, an application can only modify a few characteristics of a calendar,
such as its name, display name, visibility setting, and whether the calendar is
synced. By comparison, a sync adapter can access not only those columns, but many others,
such as calendar color, time zone, access level, location, and so on.
-However, a sync adapter is restricted to the <code>ACCOUNT_NAME</code> and
+However, a sync adapter is restricted to the <code>ACCOUNT_NAME</code> and
<code>ACCOUNT_TYPE</code> it specified.</li> </ul>
<p>Here is a helper method you can use to return a URI for use with a sync adapter:</p>
@@ -1188,5 +1188,5 @@
.appendQueryParameter(Calendars.ACCOUNT_TYPE, accountType).build();
}
</pre>
-<p>For a sample implementation of a sync adapter (not specifically related to Calendar), see
+<p>For a sample implementation of a sync adapter (not specifically related to Calendar), see
<a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">SampleSyncAdapter</a>.
diff --git a/docs/html/guide/topics/providers/content-provider-basics.jd b/docs/html/guide/topics/providers/content-provider-basics.jd
index b7ae3d2..37df4e9 100644
--- a/docs/html/guide/topics/providers/content-provider-basics.jd
+++ b/docs/html/guide/topics/providers/content-provider-basics.jd
@@ -238,7 +238,7 @@
For example, to get a list of the words and their locales from the User Dictionary Provider,
you call {@link android.content.ContentResolver#query ContentResolver.query()}.
The {@link android.content.ContentResolver#query query()} method calls the
- {@link android.content.ContentProvider#query ContentProvider.query()} method defined by the
+ {@link android.content.ContentProvider#query ContentProvider.query()} method defined by the
User Dictionary Provider. The following lines of code show a
{@link android.content.ContentResolver#query ContentResolver.query()} call:
<p>
@@ -253,7 +253,7 @@
</pre>
<p>
Table 2 shows how the arguments to
- {@link android.content.ContentResolver#query
+ {@link android.content.ContentResolver#query
query(Uri,projection,selection,selectionArgs,sortOrder)} match an SQL SELECT statement:
</p>
<p class="table-caption">
@@ -361,8 +361,8 @@
</p>
<p class="note">
For the sake of clarity, the code snippets in this section call
- {@link android.content.ContentResolver#query ContentResolver.query()} on the "UI thread"". In
- actual code, however, you should do queries asynchronously on a separate thread. One way to do
+ {@link android.content.ContentResolver#query ContentResolver.query()} on the "UI thread"". In
+ actual code, however, you should do queries asynchronously on a separate thread. One way to do
this is to use the {@link android.content.CursorLoader} class, which is described
in more detail in the <a href="{@docRoot}guide/components/loaders.html">
Loaders</a> guide. Also, the lines of code are snippets only; they don't show a complete
@@ -430,7 +430,7 @@
<p>
The next snippet shows how to use
{@link android.content.ContentResolver#query ContentResolver.query()}, using the User Dictionary
- Provider as an example. A provider client query is similar to an SQL query, and it contains a
+ Provider as an example. A provider client query is similar to an SQL query, and it contains a
set of columns to return, a set of selection criteria, and a sort order.
</p>
<p>
@@ -440,8 +440,8 @@
<p>
The expression that specifies the rows to retrieve is split into a selection clause and
selection arguments. The selection clause is a combination of logical and Boolean expressions,
- column names, and values (the variable <code>mSelectionClause</code>). If you specify the
- replaceable parameter <code>?</code> instead of a value, the query method retrieves the value
+ column names, and values (the variable <code>mSelectionClause</code>). If you specify the
+ replaceable parameter <code>?</code> instead of a value, the query method retrieves the value
from the selection arguments array (the variable <code>mSelectionArgs</code>).
</p>
<p>
@@ -567,14 +567,14 @@
<!-- Displaying the results -->
<h3 id="DisplayResults">Displaying query results</h3>
<p>
- The {@link android.content.ContentResolver#query ContentResolver.query()} client method always
- returns a {@link android.database.Cursor} containing the columns specified by the query's
- projection for the rows that match the query's selection criteria. A
- {@link android.database.Cursor} object provides random read access to the rows and columns it
- contains. Using {@link android.database.Cursor} methods, you can iterate over the rows in the
+ The {@link android.content.ContentResolver#query ContentResolver.query()} client method always
+ returns a {@link android.database.Cursor} containing the columns specified by the query's
+ projection for the rows that match the query's selection criteria. A
+ {@link android.database.Cursor} object provides random read access to the rows and columns it
+ contains. Using {@link android.database.Cursor} methods, you can iterate over the rows in the
results, determine the data type of each column, get the data out of a column, and examine other
- properties of the results. Some {@link android.database.Cursor} implementations automatically
- update the object when the provider's data changes, or trigger methods in an observer object
+ properties of the results. Some {@link android.database.Cursor} implementations automatically
+ update the object when the provider's data changes, or trigger methods in an observer object
when the {@link android.database.Cursor} changes, or both.
</p>
<p class="note">
@@ -705,14 +705,14 @@
<p>
To get the permissions needed to access a provider, an application requests them with a
<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code>
- element in its manifest file. When the Android Package Manager installs the application, a user
- must approve all of the permissions the application requests. If the user approves all of them,
+ element in its manifest file. When the Android Package Manager installs the application, a user
+ must approve all of the permissions the application requests. If the user approves all of them,
Package Manager continues the installation; if the user doesn't approve them, Package Manager
aborts the installation.
</p>
<p>
The following
-<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code>
+<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code>
element requests read access to the User Dictionary Provider:
</p>
<pre>
@@ -795,8 +795,8 @@
To update a row, you use a {@link android.content.ContentValues} object with the updated
values just as you do with an insertion, and selection criteria just as you do with a query.
The client method you use is
- {@link android.content.ContentResolver#update ContentResolver.update()}. You only need to add
- values to the {@link android.content.ContentValues} object for columns you're updating. If you
+ {@link android.content.ContentResolver#update ContentResolver.update()}. You only need to add
+ values to the {@link android.content.ContentValues} object for columns you're updating. If you
want to clear the contents of a column, set the value to <code>null</code>.
</p>
<p>
@@ -830,7 +830,7 @@
</pre>
<p>
You should also sanitize user input when you call
- {@link android.content.ContentResolver#update ContentResolver.update()}. To learn more about
+ {@link android.content.ContentResolver#update ContentResolver.update()}. To learn more about
this, read the section <a href="#Injection">Protecting against malicious input</a>.
</p>
<h3 id="Deleting">Deleting data</h3>
@@ -860,7 +860,7 @@
</pre>
<p>
You should also sanitize user input when you call
- {@link android.content.ContentResolver#delete ContentResolver.delete()}. To learn more about
+ {@link android.content.ContentResolver#delete ContentResolver.delete()}. To learn more about
this, read the section <a href="#Injection">Protecting against malicious input</a>.
</p>
<!-- Provider Data Types -->
@@ -948,9 +948,9 @@
To access a provider in "batch mode",
you create an array of {@link android.content.ContentProviderOperation} objects and then
dispatch them to a content provider with
- {@link android.content.ContentResolver#applyBatch ContentResolver.applyBatch()}. You pass the
- content provider's <em>authority</em> to this method, rather than a particular content URI.
- This allows each {@link android.content.ContentProviderOperation} object in the array to work
+ {@link android.content.ContentResolver#applyBatch ContentResolver.applyBatch()}. You pass the
+ content provider's <em>authority</em> to this method, rather than a particular content URI.
+ This allows each {@link android.content.ContentProviderOperation} object in the array to work
against a different table. A call to {@link android.content.ContentResolver#applyBatch
ContentResolver.applyBatch()} returns an array of results.
</p>
@@ -1013,7 +1013,7 @@
<p>
A provider defines URI permissions for content URIs in its manifest, using the
<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">android:grantUriPermission</a></code>
- attribute of the
+ attribute of the
<code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code>
element, as well as the
<code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission></a></code>
diff --git a/docs/html/guide/topics/providers/content-provider-creating.jd b/docs/html/guide/topics/providers/content-provider-creating.jd
index baa92e1..ec6909c 100755
--- a/docs/html/guide/topics/providers/content-provider-creating.jd
+++ b/docs/html/guide/topics/providers/content-provider-creating.jd
@@ -422,7 +422,7 @@
* in the path
*/
sUriMatcher.addURI("com.example.app.provider", "table3", 1);
-
+
/*
* Sets the code for a single row to 2. In this case, the "#" wildcard is
* used. "content://com.example.app.provider/table3/3" matches, but
@@ -881,7 +881,7 @@
A contract class also helps developers because it usually has mnemonic names for its constants,
so developers are less likely to use incorrect values for column names or URIs. Since it's a
class, it can contain Javadoc documentation. Integrated development environments such as
- Android Studio can auto-complete constant names from the contract class and display Javadoc for
+ Android Studio can auto-complete constant names from the contract class and display Javadoc for
the constants.
</p>
<p>
diff --git a/docs/html/guide/topics/renderscript/compute.jd b/docs/html/guide/topics/renderscript/compute.jd
index fc795ff..861c925 100755
--- a/docs/html/guide/topics/renderscript/compute.jd
+++ b/docs/html/guide/topics/renderscript/compute.jd
@@ -167,7 +167,7 @@
</ul>
<p>We strongly recommend using the Support Library APIs for accessing RenderScript because they
- provide a wider range of device compatibility. Developers targeting specific versions of
+ provide a wider range of device compatibility. Developers targeting specific versions of
Android can use {@link android.renderscript} if necessary.</p>
diff --git a/docs/html/guide/topics/resources/accessing-resources.jd b/docs/html/guide/topics/resources/accessing-resources.jd
index b971238..953b274 100644
--- a/docs/html/guide/topics/resources/accessing-resources.jd
+++ b/docs/html/guide/topics/resources/accessing-resources.jd
@@ -264,8 +264,8 @@
android:text="@string/hello" />
</pre>
-<p class="note"><strong>Note:</strong> You should use string resources at
-all times, so that your application can be localized for other languages.
+<p class="note"><strong>Note:</strong> You should use string resources at
+all times, so that your application can be localized for other languages.
For information about creating alternative
resources (such as localized strings), see <a
href="providing-resources.html#AlternativeResources">Providing Alternative
diff --git a/docs/html/guide/topics/resources/animation-resource.jd b/docs/html/guide/topics/resources/animation-resource.jd
index e5cac88..05582f0 100644
--- a/docs/html/guide/topics/resources/animation-resource.jd
+++ b/docs/html/guide/topics/resources/animation-resource.jd
@@ -12,7 +12,7 @@
<ol>
<li><a href="#Tween">Tween animation</a></li>
<li><a href="#Frame">Frame animation</a></li>
- </ol>
+ </ol>
</li>
</ol>
<h2>See also</h2>
@@ -94,7 +94,7 @@
</set>
</pre>
-<p>The file must have a single root element: either
+<p>The file must have a single root element: either
<code><set></code>, <code><objectAnimator></code>, or <code><valueAnimator></code>. You can
group animation elements together inside the <code><set></code> element, including other
<code><set></code> elements.
@@ -109,7 +109,7 @@
<code><valueAnimator></code>, or other <code><set></code> elements). Represents
an {@link android.animation.AnimatorSet}.
<p>You can specify nested <code><set></code> tags to further
- group animations together. Each <code><set></code> can define its own
+ group animations together. Each <code><set></code> can define its own
<code>ordering</code> attribute.</p>
<p class="caps">attributes:</p>
@@ -119,11 +119,11 @@
</dt>
<dd>
<em>Keyword</em>. Specifies the play ordering of animations in this set.
- <table>
- <tr><th>Value</th><th>Description</th></tr>
- <tr><td><code>sequentially</code></td><td>Play animations in this set sequentially</td></tr>
- <tr><td><code>together</code> (default)</td><td>Play animations in this set at the same time.</td></tr>
- </table>
+ <table>
+ <tr><th>Value</th><th>Description</th></tr>
+ <tr><td><code>sequentially</code></td><td>Play animations in this set sequentially</td></tr>
+ <tr><td><code>together</code> (default)</td><td>Play animations in this set at the same time.</td></tr>
+ </table>
</dd>
</dl>
</dd>
@@ -131,11 +131,11 @@
<dt id="obj-animator-element"><code><objectAnimator></code></dt>
<dd>Animates a specific property of an object over a specific amount of time. Represents
an {@link android.animation.ObjectAnimator}.</p>
-
+
<p class="caps">attributes:</p>
<dl class="atn-list">
<dt>
- <code>android:propertyName</code>
+ <code>android:propertyName</code>
</dt>
<dd>
<em>String</em>. <strong>Required</strong>. The object's property to animate, referenced by its name. For example you can specify
@@ -206,11 +206,11 @@
<dd>
<em>Keyword</em>. Do not specify this attribute if the value is a color. The animation framework automatically handles color
values
- <table>
- <tr><th>Value</th><th>Description</th></tr>
- <tr><td><code>intType</code></td><td>Specifies that the animated values are integers</td></tr>
- <tr><td><code>floatType</code> (default)</td><td>Specifies that the animated values are floats</td></tr>
- </table>
+ <table>
+ <tr><th>Value</th><th>Description</th></tr>
+ <tr><td><code>intType</code></td><td>Specifies that the animated values are integers</td></tr>
+ <tr><td><code>floatType</code> (default)</td><td>Specifies that the animated values are floats</td></tr>
+ </table>
</dd>
</dl>
@@ -279,11 +279,11 @@
<dd>
<em>Keyword</em>. Do not specify this attribute if the value is a color. The animation framework automatically handles color
values.
- <table>
- <tr><th>Value</th><th>Description</th></tr>
- <tr><td><code>intType</code></td><td>Specifies that the animated values are integers</td></tr>
- <tr><td><code>floatType</code> (default)</td><td>Specifies that the animated values are floats</td></tr>
- </table>
+ <table>
+ <tr><th>Value</th><th>Description</th></tr>
+ <tr><td><code>intType</code></td><td>Specifies that the animated values are integers</td></tr>
+ <tr><td><code>floatType</code> (default)</td><td>Specifies that the animated values are floats</td></tr>
+ </table>
</dd>
</dl>
@@ -320,7 +320,7 @@
before starting the animation set. Calling {@link android.animation.AnimatorSet#setTarget
setTarget()} sets a single target object for all children of the {@link
android.animation.AnimatorSet} as a convenience. The following code shows how to do this:</p>
-
+
<pre>
AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(myContext,
R.anim.property_animator);
diff --git a/docs/html/guide/topics/resources/more-resources.jd b/docs/html/guide/topics/resources/more-resources.jd
index 1afbf70..8488cde 100644
--- a/docs/html/guide/topics/resources/more-resources.jd
+++ b/docs/html/guide/topics/resources/more-resources.jd
@@ -760,7 +760,7 @@
</dd>
</dl>
-</dd>
+</dd>
<dt>example:</dt>
<dd>
@@ -781,7 +781,7 @@
</dd>
</dl>
-</dd>
+</dd>
<dt>see also:</dt>
diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd
index c919ed5..80a989a 100644
--- a/docs/html/guide/topics/resources/providing-resources.jd
+++ b/docs/html/guide/topics/resources/providing-resources.jd
@@ -523,7 +523,7 @@
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,
@@ -608,7 +608,7 @@
</ul>
<p><em>Added in API level 8, television added in API 13, watch added in API 20.</em></p>
<p>For information about how your app can respond when the device is inserted into or
- removed from a dock, read <a
+ removed from a dock, read <a
href="{@docRoot}training/monitoring-device-state/docking-monitoring.html">Determining
and Monitoring the Docking State and Type</a>.</p>
<p>This can change during the life of your application if the user places the device in a
@@ -659,8 +659,8 @@
Level 8</em></li>
<li>{@code xxhdpi}: Extra-extra-high-density screens; approximately 480dpi. <em>Added in API
Level 16</em></li>
- <li>{@code xxxhdpi}: Extra-extra-extra-high-density uses (launcher icon only, see the
- <a href="{@docRoot}guide/practices/screens_support.html#xxxhdpi-note">note</a>
+ <li>{@code xxxhdpi}: Extra-extra-extra-high-density uses (launcher icon only, see the
+ <a href="{@docRoot}guide/practices/screens_support.html#xxxhdpi-note">note</a>
in <em>Supporting Multiple Screens</em>); approximately 640dpi. <em>Added in API
Level 18</em></li>
<li>{@code nodpi}: This can be used for bitmap resources that you do not want to be scaled
diff --git a/docs/html/guide/topics/resources/runtime-changes.jd b/docs/html/guide/topics/resources/runtime-changes.jd
index 8781d20..2e6f9b7 100644
--- a/docs/html/guide/topics/resources/runtime-changes.jd
+++ b/docs/html/guide/topics/resources/runtime-changes.jd
@@ -84,12 +84,12 @@
<p>To retain stateful objects in a fragment during a runtime configuration change:</p>
<ol>
- <li>Extend the {@link android.app.Fragment} class and declare references to your stateful
+ <li>Extend the {@link android.app.Fragment} class and declare references to your stateful
objects.</li>
<li>Call {@link android.app.Fragment#setRetainInstance(boolean)} when the fragment is created.
</li>
<li>Add the fragment to your activity.</li>
- <li>Use {@link android.app.FragmentManager} to retrieve the fragment when the activity is
+ <li>Use {@link android.app.FragmentManager} to retrieve the fragment when the activity is
restarted.</li>
</ol>
@@ -127,8 +127,8 @@
means that your application maintains a hold on them and they cannot be garbage-collected, so
lots of memory can be lost.)</p>
-<p>Then use {@link android.app.FragmentManager} to add the fragment to the activity.
-You can obtain the data object from the fragment when the activity starts again during runtime
+<p>Then use {@link android.app.FragmentManager} to add the fragment to the activity.
+You can obtain the data object from the fragment when the activity starts again during runtime
configuration changes. For example, define your activity as follows:</p>
<pre>
@@ -170,7 +170,7 @@
<p>In this example, {@link android.app.Activity#onCreate(Bundle) onCreate()} adds a fragment
or restores a reference to it. {@link android.app.Activity#onCreate(Bundle) onCreate()} also
stores the stateful object inside the fragment instance.
-{@link android.app.Activity#onDestroy() onDestroy()} updates the stateful object inside the
+{@link android.app.Activity#onDestroy() onDestroy()} updates the stateful object inside the
retained fragment instance.</p>
diff --git a/docs/html/guide/topics/sensors/index.jd b/docs/html/guide/topics/sensors/index.jd
index 09d27e7..36d3adc 100644
--- a/docs/html/guide/topics/sensors/index.jd
+++ b/docs/html/guide/topics/sensors/index.jd
@@ -1,7 +1,7 @@
page.title=Location and Sensors APIs
page.landing=true
page.tags=location,sensors
-page.landing.intro=Use sensors on the device to add rich location and motion capabilities to your app, from GPS or network location to accelerometer, gyroscope, temperature, barometer, and more.
+page.landing.intro=Use sensors on the device to add rich location and motion capabilities to your app, from GPS or network location to accelerometer, gyroscope, temperature, barometer, and more.
page.landing.image=
@jd:body
@@ -10,7 +10,7 @@
<div class="col-6">
<h3>Blog Articles</h3>
-
+
<a href="http://android-developers.blogspot.com/2010/09/one-screen-turn-deserves-another.html">
<h4>One Screen Turn Deserves Another</h4>
<p>However, there’s a new wrinkle: recently, a few devices have shipped (see here and here)
@@ -18,7 +18,7 @@
the default position, the screens are wider than they are tall. This introduces a few fairly subtle
issues that we’ve noticed causing problems in some apps.</p>
</a>
-
+
<a href="http://android-developers.blogspot.com/2011/06/deep-dive-into-location.html">
<h4>A Deep Dive Into Location</h4>
<p>I’ve written an open-source reference app that incorporates all of the tips, tricks, and
@@ -29,7 +29,7 @@
<div class="col-6">
<h3>Training</h3>
-
+
<a href="http://developer.android.com/training/location/index.html">
<h4>Making Your App Location Aware</h4>
<p>This class teaches you how to incorporate location based services in your Android
diff --git a/docs/html/guide/topics/text/index.jd b/docs/html/guide/topics/text/index.jd
index 3865f25..2bf4696 100644
--- a/docs/html/guide/topics/text/index.jd
+++ b/docs/html/guide/topics/text/index.jd
@@ -9,7 +9,7 @@
<div class="col-12">
<h3>Blog Articles</h3>
-
+
<a href="http://android-developers.blogspot.com/2011/12/add-voice-typing-to-your-ime.html">
<h4>Add Voice Typing To Your IME</h4>
<p>A new feature available in Android 4.0 is voice typing: the difference for users is that
diff --git a/docs/html/guide/topics/text/spell-checker-framework.jd b/docs/html/guide/topics/text/spell-checker-framework.jd
index a5d9932..7c059ce 100644
--- a/docs/html/guide/topics/text/spell-checker-framework.jd
+++ b/docs/html/guide/topics/text/spell-checker-framework.jd
@@ -6,7 +6,7 @@
<h2>In This Document</h2>
<ol>
<li>
- <a href="#SpellCheckLifeCycle">Spell Check Lifecycle</a>
+ <a href="#SpellCheckLifeCycle">Spell Check Lifecycle</a>
</li>
<li>
<a href="#SpellCheckImplementation">Implementing a Spell Checker Service</a>
@@ -30,12 +30,12 @@
</div>
<p>
- The Android platform offers a spelling checker framework that lets you implement
- and access spell checking in your application. The framework is one of the
+ The Android platform offers a spelling checker framework that lets you implement
+ and access spell checking in your application. The framework is one of the
Text Service APIs offered by the Android platform.
</p>
<p>
- To use the framework in your app, you create a special type of Android service that
+ To use the framework in your app, you create a special type of Android service that
generates a spelling checker <strong>session</strong> object. Based on text you provide,
the session object returns spelling suggestions generated by the spelling checker.
</p>
diff --git a/docs/html/guide/topics/ui/accessibility/apps.jd b/docs/html/guide/topics/ui/accessibility/apps.jd
index eb639e3..26fb3cc 100644
--- a/docs/html/guide/topics/ui/accessibility/apps.jd
+++ b/docs/html/guide/topics/ui/accessibility/apps.jd
@@ -458,7 +458,7 @@
// Call the super implementation to populate its text to the event, which
// calls onPopulateAccessibilityEvent() on API Level 14 and up.
boolean completed = super.dispatchPopulateAccessibilityEvent(event);
-
+
// In case this is running on a API revision earlier that 14, check
// the text content of the event and add an appropriate text
// description for this custom view:
diff --git a/docs/html/guide/topics/ui/binding.jd b/docs/html/guide/topics/ui/binding.jd
index a4fd25c..48a1d40 100644
--- a/docs/html/guide/topics/ui/binding.jd
+++ b/docs/html/guide/topics/ui/binding.jd
@@ -16,7 +16,7 @@
<pre>
-// Get a Spinner and bind it to an ArrayAdapter that
+// Get a Spinner and bind it to an ArrayAdapter that
// references a String array.
Spinner s1 = (Spinner) findViewById(R.id.spinner1);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
@@ -31,7 +31,7 @@
Spinner s2 = (Spinner) findViewById(R.id.spinner2);
Cursor cur = managedQuery(People.CONTENT_URI, PROJECTION, null, null);
-
+
SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,
android.R.layout.simple_spinner_item, // Use a template
// that displays a
@@ -41,7 +41,7 @@
// people database to...
new int[] {android.R.id.text1}); // The "text1" view defined in
// the XML template
-
+
adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
s2.setAdapter(adapter2);
</pre>
@@ -70,7 +70,7 @@
// Now hook into our object and set its onItemClickListener member
// to our class handler object.
mHistoryView = (ListView)findViewById(R.id.history);
-mHistoryView.setOnItemClickListener(mMessageClickedHandler);
+mHistoryView.setOnItemClickListener(mMessageClickedHandler);
</pre>
<div class="special">
diff --git a/docs/html/guide/topics/ui/controls.jd b/docs/html/guide/topics/ui/controls.jd
index a58d9f9..bb8c1a7 100644
--- a/docs/html/guide/topics/ui/controls.jd
+++ b/docs/html/guide/topics/ui/controls.jd
@@ -71,7 +71,7 @@
<tr>
<td><a href="controls/radiobutton.html">Radio button</a></td>
<td>Similar to checkboxes, except that only one option can be selected in the group.</td>
- <td>{@link android.widget.RadioGroup RadioGroup}
+ <td>{@link android.widget.RadioGroup RadioGroup}
<br>{@link android.widget.RadioButton RadioButton} </td>
</tr>
<tr>
diff --git a/docs/html/guide/topics/ui/controls/button.jd b/docs/html/guide/topics/ui/controls/button.jd
index 295044f..a529d53 100644
--- a/docs/html/guide/topics/ui/controls/button.jd
+++ b/docs/html/guide/topics/ui/controls/button.jd
@@ -214,7 +214,7 @@
<li>The second <code><item></code> defines the bitmap to use when the button is
focused (when the button is highlighted using the trackball or directional
pad).</li>
- <li>The third <code><item></code> defines the bitmap to use when the button is in the
+ <li>The third <code><item></code> defines the bitmap to use when the button is in the
default state (it's neither pressed nor focused).</li>
</ul>
<p class="note"><strong>Note:</strong> The order of the <code><item></code> elements is
diff --git a/docs/html/guide/topics/ui/controls/checkbox.jd b/docs/html/guide/topics/ui/controls/checkbox.jd
index 2a64e38..f5feeb1 100644
--- a/docs/html/guide/topics/ui/controls/checkbox.jd
+++ b/docs/html/guide/topics/ui/controls/checkbox.jd
@@ -65,7 +65,7 @@
public void onCheckboxClicked(View view) {
// Is the view now checked?
boolean checked = ((CheckBox) view).isChecked();
-
+
// Check which checkbox was clicked
switch(view.getId()) {
case R.id.checkbox_meat:
diff --git a/docs/html/guide/topics/ui/controls/pickers.jd b/docs/html/guide/topics/ui/controls/pickers.jd
index c0667ad..9788f08 100644
--- a/docs/html/guide/topics/ui/controls/pickers.jd
+++ b/docs/html/guide/topics/ui/controls/pickers.jd
@@ -123,15 +123,15 @@
<p>For example, here's a button that, when clicked, calls a method to show the dialog:</p>
<pre>
-<Button
- android:layout_width="wrap_content"
+<Button
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/pick_time"
+ android:text="@string/pick_time"
android:onClick="showTimePickerDialog" />
</pre>
<p>When the user clicks this button, the system calls the following method:</p>
-
+
<pre>
public void showTimePickerDialog(View v) {
DialogFragment newFragment = new TimePickerFragment();
@@ -224,15 +224,15 @@
<p>For example, here's a button that, when clicked, calls a method to show the dialog:</p>
<pre>
-<Button
- android:layout_width="wrap_content"
+<Button
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/pick_date"
+ android:text="@string/pick_date"
android:onClick="showDatePickerDialog" />
</pre>
<p>When the user clicks this button, the system calls the following method:</p>
-
+
<pre>
public void showDatePickerDialog(View v) {
DialogFragment newFragment = new DatePickerFragment();
diff --git a/docs/html/guide/topics/ui/controls/radiobutton.jd b/docs/html/guide/topics/ui/controls/radiobutton.jd
index b2556e19..e1441d3 100644
--- a/docs/html/guide/topics/ui/controls/radiobutton.jd
+++ b/docs/html/guide/topics/ui/controls/radiobutton.jd
@@ -72,7 +72,7 @@
public void onRadioButtonClicked(View view) {
// Is the button now checked?
boolean checked = ((RadioButton) view).isChecked();
-
+
// Check which radio button was clicked
switch(view.getId()) {
case R.id.radio_pirates:
diff --git a/docs/html/guide/topics/ui/controls/spinner.jd b/docs/html/guide/topics/ui/controls/spinner.jd
index 3b8aaad..00b0432 100644
--- a/docs/html/guide/topics/ui/controls/spinner.jd
+++ b/docs/html/guide/topics/ui/controls/spinner.jd
@@ -4,7 +4,7 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>In this document</h2>
<ol>
<li><a href="#Populate">Populate the Spinner with User Choices</a></li>
@@ -113,8 +113,8 @@
<pre>
public class SpinnerActivity extends Activity implements OnItemSelectedListener {
...
-
- public void onItemSelected(AdapterView<?> parent, View view,
+
+ public void onItemSelected(AdapterView<?> parent, View view,
int pos, long id) {
// An item was selected. You can retrieve the selected item using
// parent.getItemAtPosition(pos)
diff --git a/docs/html/guide/topics/ui/controls/text.jd b/docs/html/guide/topics/ui/controls/text.jd
index f4d72b2a..f5c2a42 100644
--- a/docs/html/guide/topics/ui/controls/text.jd
+++ b/docs/html/guide/topics/ui/controls/text.jd
@@ -4,7 +4,7 @@
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>In this document</h2>
<ol>
<li><a href="#Keyboard">Specifying the Keyboard Type</a>
@@ -279,7 +279,7 @@
layout with only the text field:
<pre>
<?xml version="1.0" encoding="utf-8"?>
-<AutoCompleteTextView xmlns:android="http://schemas.android.com/apk/res/android"
+<AutoCompleteTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/autocomplete_country"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
@@ -313,8 +313,8 @@
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_country);
// Get the string array
String[] countries = getResources().getStringArray(R.array.countries_array);
-// Create the adapter and set it to the AutoCompleteTextView
-ArrayAdapter<String> adapter =
+// Create the adapter and set it to the AutoCompleteTextView
+ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, countries);
textView.setAdapter(adapter);
</pre>
diff --git a/docs/html/guide/topics/ui/custom-components.jd b/docs/html/guide/topics/ui/custom-components.jd
index b7249c5..bd3de1c 100755
--- a/docs/html/guide/topics/ui/custom-components.jd
+++ b/docs/html/guide/topics/ui/custom-components.jd
@@ -14,37 +14,37 @@
</div>
</div>
-<p>Android offers a sophisticated and powerful componentized model for building your UI,
-based on the fundamental layout classes: {@link android.view.View} and
-{@link android.view.ViewGroup}. To start with, the platform includes a variety of prebuilt
-View and ViewGroup subclasses — called widgets and layouts, respectively —
+<p>Android offers a sophisticated and powerful componentized model for building your UI,
+based on the fundamental layout classes: {@link android.view.View} and
+{@link android.view.ViewGroup}. To start with, the platform includes a variety of prebuilt
+View and ViewGroup subclasses — called widgets and layouts, respectively —
that you can use to construct your UI.</p>
-<p>A partial list of available widgets includes {@link android.widget.Button Button},
-{@link android.widget.TextView TextView},
-{@link android.widget.EditText EditText},
+<p>A partial list of available widgets includes {@link android.widget.Button Button},
+{@link android.widget.TextView TextView},
+{@link android.widget.EditText EditText},
{@link android.widget.ListView ListView},
-{@link android.widget.CheckBox CheckBox},
-{@link android.widget.RadioButton RadioButton},
-{@link android.widget.Gallery Gallery},
-{@link android.widget.Spinner Spinner}, and the more special-purpose
-{@link android.widget.AutoCompleteTextView AutoCompleteTextView},
+{@link android.widget.CheckBox CheckBox},
+{@link android.widget.RadioButton RadioButton},
+{@link android.widget.Gallery Gallery},
+{@link android.widget.Spinner Spinner}, and the more special-purpose
+{@link android.widget.AutoCompleteTextView AutoCompleteTextView},
{@link android.widget.ImageSwitcher ImageSwitcher}, and
{@link android.widget.TextSwitcher TextSwitcher}. </p>
-<p>Among the layouts available are {@link android.widget.LinearLayout LinearLayout},
-{@link android.widget.FrameLayout FrameLayout}, {@link android.widget.RelativeLayout RelativeLayout},
+<p>Among the layouts available are {@link android.widget.LinearLayout LinearLayout},
+{@link android.widget.FrameLayout FrameLayout}, {@link android.widget.RelativeLayout RelativeLayout},
and others. For more examples, see <a href="layout-objects.html">Common Layout Objects</a>.</p>
-<p>If none of the prebuilt widgets or layouts meets your needs, you can create your own View subclass.
-If you only need to make small adjustments to an existing widget or layout, you can simply subclass
+<p>If none of the prebuilt widgets or layouts meets your needs, you can create your own View subclass.
+If you only need to make small adjustments to an existing widget or layout, you can simply subclass
the widget or layout and override its methods.
</p>
-<p>Creating your own View subclasses gives you precise control over the appearance and function
-of a screen element. To give an idea of the control you get with custom views, here are some
+<p>Creating your own View subclasses gives you precise control over the appearance and function
+of a screen element. To give an idea of the control you get with custom views, here are some
examples of what you could do with them:</p>
-
+
<ul>
<li>
You could create a completely custom-rendered View type, for example a "volume
@@ -60,7 +60,7 @@
</li>
<li>
You could override the way that an EditText component is rendered on the screen
- (the <a href="{@docRoot}resources/samples/NotePad/index.html">Notepad Tutorial</a> uses this to good effect,
+ (the <a href="{@docRoot}resources/samples/NotePad/index.html">Notepad Tutorial</a> uses this to good effect,
to create a lined-notepad page).
</li>
<li>
@@ -69,7 +69,7 @@
</li>
</ul>
<p>
-The sections below explain how to create custom Views and use them in your application.
+The sections below explain how to create custom Views and use them in your application.
For detailed reference information, see the {@link android.view.View} class. </p>
@@ -77,26 +77,26 @@
<p>Here is a high level overview of what you need to know to get started in creating your own
View components:</p>
-
+
<ol>
<li>
- Extend an existing {@link android.view.View View} class or subclass
+ Extend an existing {@link android.view.View View} class or subclass
with your own class.
</li>
<li>
- Override some of the methods from the superclass. The superclass methods
+ Override some of the methods from the superclass. The superclass methods
to override start with '<code>on</code>', for
- example, {@link android.view.View#onDraw onDraw()},
- {@link android.view.View#onMeasure onMeasure()}, and
+ example, {@link android.view.View#onDraw onDraw()},
+ {@link android.view.View#onMeasure onMeasure()}, and
{@link android.view.View#onKeyDown onKeyDown()}.
- This is similar to the <code>on...</code> events in {@link android.app.Activity Activity}
+ This is similar to the <code>on...</code> events in {@link android.app.Activity Activity}
or {@link android.app.ListActivity ListActivity}
that you override for lifecycle and other functionality hooks.
<li>
- Use your new extension class. Once completed, your new extension class
+ Use your new extension class. Once completed, your new extension class
can be used in place of the view upon which it was based.
</li>
-</ol>
+</ol>
<p class="note"><strong>Tip:</strong>
Extension classes can be defined as inner classes inside the activities
that use them. This is useful because it controls access to them but
@@ -119,7 +119,7 @@
screen, and the available processing power (remember that ultimately your
application might have to run on something with significantly less power
than your desktop workstation).</p>
-<p>To create a fully customized component:</p>
+<p>To create a fully customized component:</p>
<ol>
<li>
The most generic view you can extend is, unsurprisingly, {@link
@@ -170,11 +170,11 @@
(which are passed in to the <code>onMeasure()</code> method) and by the
requirement to call the <code>setMeasuredDimension()</code> method with the
measured width and height once they have been calculated. If you fail to
-call this method from an overridden <code>onMeasure()</code> method, the
+call this method from an overridden <code>onMeasure()</code> method, the
result will be an exception at measurement time.</p>
-<p>At a high level, implementing <code>onMeasure()</code> looks something
+<p>At a high level, implementing <code>onMeasure()</code> looks something
like this:</p>
-
+
<ol>
<li>
The overridden <code>onMeasure()</code> method is called with width and
@@ -193,7 +193,7 @@
measurement width and height which will be required to render the
component. It should try to stay within the specifications passed in,
although it can choose to exceed them (in this case, the parent can
- choose what to do, including clipping, scrolling, throwing an exception,
+ choose what to do, including clipping, scrolling, throwing an exception,
or asking the <code>onMeasure()</code> to try again, perhaps with
different measurement specifications).
</li>
@@ -212,7 +212,7 @@
<thead>
<tr><th>Category</th> <th>Methods</th> <th>Description</th></tr>
</thead>
-
+
<tbody>
<tr>
<td rowspan="2">Creation</td>
@@ -228,7 +228,7 @@
<td>Called after a view and all of its children has been inflated
from XML.</td>
</tr>
-
+
<tr>
<td rowspan="3">Layout</td>
<td><code>{@link android.view.View#onMeasure}</code></td>
@@ -247,14 +247,14 @@
<td>Called when the size of this view has changed.
</td>
</tr>
-
+
<tr>
<td>Drawing</td>
<td><code>{@link android.view.View#onDraw}</code></td>
<td>Called when the view should render its content.
</td>
</tr>
-
+
<tr>
<td rowspan="4">Event processing</td>
<td><code>{@link android.view.View#onKeyDown}</code></td>
@@ -265,58 +265,58 @@
<td><code>{@link android.view.View#onKeyUp}</code></td>
<td>Called when a key up event occurs.
</td>
- </tr>
+ </tr>
<tr>
<td><code>{@link android.view.View#onTrackballEvent}</code></td>
<td>Called when a trackball motion event occurs.
</td>
- </tr>
+ </tr>
<tr>
<td><code>{@link android.view.View#onTouchEvent}</code></td>
<td>Called when a touch screen motion event occurs.
</td>
- </tr>
-
+ </tr>
+
<tr>
<td rowspan="2">Focus</td>
<td><code>{@link android.view.View#onFocusChanged}</code></td>
<td>Called when the view gains or loses focus.
</td>
</tr>
-
+
<tr>
<td><code>{@link android.view.View#onWindowFocusChanged}</code></td>
<td>Called when the window containing the view gains or loses focus.
</td>
</tr>
-
+
<tr>
<td rowspan="3">Attaching</td>
<td><code>{@link android.view.View#onAttachedToWindow()}</code></td>
<td>Called when the view is attached to a window.
</td>
</tr>
-
+
<tr>
<td><code>{@link android.view.View#onDetachedFromWindow}</code></td>
<td>Called when the view is detached from its window.
</td>
- </tr>
-
+ </tr>
+
<tr>
<td><code>{@link android.view.View#onWindowVisibilityChanged}</code></td>
<td>Called when the visibility of the window containing the view
has changed.
</td>
- </tr>
+ </tr>
</tbody>
-
+
</table>
<h3 id="customexample">A Custom View Example</h3>
-<p>The CustomView sample in the
+<p>The CustomView sample in the
<a href="{@docRoot}resources/samples/ApiDemos/index.html">API Demos</a> provides an example
of a customized View. The custom View is defined in the
<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/LabelView.html">LabelView</a>
@@ -359,9 +359,9 @@
something from the list, it populates the EditText field, but the user can
also type something directly into the EditText if they prefer.</p>
<p>In Android, there are actually two other Views readily available to do
-this: {@link android.widget.Spinner Spinner} and
-{@link android.widget.AutoCompleteTextView AutoCompleteTextView}, but
-regardless, the concept of a Combo Box makes an easy-to-understand
+this: {@link android.widget.Spinner Spinner} and
+{@link android.widget.AutoCompleteTextView AutoCompleteTextView}, but
+regardless, the concept of a Combo Box makes an easy-to-understand
example.</p>
<p>To create a compound component:</p>
<ol>
@@ -397,7 +397,7 @@
<li>
In the case of extending a Layout, you don't need to override the
<code>onDraw()</code> and <code>onMeasure()</code> methods since the
- layout will have default behavior that will likely work just fine. However,
+ layout will have default behavior that will likely work just fine. However,
you can still override them if you need to.
</li>
<li>
@@ -409,7 +409,7 @@
<p>
To summarize, the use of a Layout as the basis for a Custom Control has a
number of advantages, including:</p>
-
+
<ul>
<li>
You can specify the layout using the declarative XML files just like
@@ -433,7 +433,7 @@
SpeechView which extends LinearLayout to make a component for displaying
Speech quotes. The corresponding classes in the sample code are
<code>List4.java</code> and <code>List6.java</code>.</p>
-
+
<h2 id="modifying">Modifying an Existing View Type</h2>
@@ -450,7 +450,7 @@
them is extending an EditText View to make a lined notepad. This is not a
perfect example, and the APIs for doing this might change from this early
preview, but it does demonstrate the principles.</p>
-<p>If you haven't done so already, import the
+<p>If you haven't done so already, import the
NotePad sample into Android Studio (or
just look at the source using the link provided). In particular look at the definition of
<code>MyEditText</code> in the <a
@@ -462,7 +462,7 @@
<strong>The Definition</strong>
<p>The class is defined with the following line:<br/>
<code>public static class MyEditText extends EditText</code></p>
-
+
<ul>
<li>
It is defined as an inner class within the <code>NoteEditor</code>
@@ -488,7 +488,7 @@
</li>
<li>
<strong>Class Initialization</strong>
- <p>As always, the super is called first. Furthermore,
+ <p>As always, the super is called first. Furthermore,
this is not a default constructor, but a parameterized one. The
EditText is created with these parameters when it is inflated from an
XML layout file, thus, our constructor needs to both take them and pass them
@@ -496,7 +496,7 @@
</li>
<li>
<strong>Overridden Methods</strong>
- <p>In this example, there is only one method to be overridden:
+ <p>In this example, there is only one method to be overridden:
<code>onDraw()</code> — but there could easily be others needed when you
create your own custom components.</p>
<p>For the NotePad sample, overriding the <code>onDraw()</code> method allows
@@ -513,7 +513,7 @@
<code>res/layout</code> folder.</p>
<pre>
<view
- class="com.android.notepad.NoteEditor$MyEditText"
+ class="com.android.notepad.NoteEditor$MyEditText"
id="@+id/note"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@@ -522,7 +522,7 @@
android:scrollbars="vertical"
android:fadingEdge="vertical" />
</pre>
-
+
<ul>
<li>
The custom component is created as a generic view in the XML, and
@@ -531,7 +531,7 @@
<code>NoteEditor$MyEditText</code> notation which is a standard way to
refer to inner classes in the Java programming language.
<p>If your custom View component is not defined as an inner class, then you can,
- alternatively, declare the View component
+ alternatively, declare the View component
with the XML element name, and exclude the <code>class</code> attribute. For example:</p>
<pre>
<com.android.notepad.MyEditText
diff --git a/docs/html/guide/topics/ui/dialogs.jd b/docs/html/guide/topics/ui/dialogs.jd
index e4469ea..7ab4ca5 100644
--- a/docs/html/guide/topics/ui/dialogs.jd
+++ b/docs/html/guide/topics/ui/dialogs.jd
@@ -32,7 +32,7 @@
<li>{@link android.app.DialogFragment}</li>
<li>{@link android.app.AlertDialog}</li>
</ol>
-
+
<h2>See also</h2>
<ol>
<li><a href="{@docRoot}design/building-blocks/dialogs.html">Dialogs design guide</a></li>
@@ -238,8 +238,8 @@
</pre>
<p>The <code>set...Button()</code> methods require a title for the button (supplied
-by a <a href="{@docRoot}guide/topics/resources/string-resource.html">string resource</a>) and a
-{@link android.content.DialogInterface.OnClickListener} that defines the action to take
+by a <a href="{@docRoot}guide/topics/resources/string-resource.html">string resource</a>) and a
+{@link android.content.DialogInterface.OnClickListener} that defines the action to take
when the user presses the button.</p>
<p>There are three different action buttons you can add:</p>
@@ -251,7 +251,7 @@
<dt>Neutral</dt>
<dd>You should use this when the user may not want to proceed with the action,
but doesn't necessarily want to cancel. It appears between the positive and negative
- buttons. For example, the action might be "Remind me later."</dd>
+ buttons. For example, the action might be "Remind me later."</dd>
</dl>
<p>You can add only one of each button type to an {@link
@@ -274,7 +274,7 @@
<li>A persistent multiple-choice list (checkboxes)</li>
</ul>
-<p>To create a single-choice list like the one in figure 3,
+<p>To create a single-choice list like the one in figure 3,
use the {@link android.app.AlertDialog.Builder#setItems setItems()} method:</p>
<pre style="clear:right">
@@ -294,7 +294,7 @@
<p>Because the list appears in the dialog's content area,
the dialog cannot show both a message and a list and you should set a title for the
-dialog with {@link android.app.AlertDialog.Builder#setTitle setTitle()}.
+dialog with {@link android.app.AlertDialog.Builder#setTitle setTitle()}.
To specify the items for the list, call {@link
android.app.AlertDialog.Builder#setItems setItems()}, passing an array.
Alternatively, you can specify a list using {@link
@@ -320,11 +320,11 @@
<h4 id="Checkboxes">Adding a persistent multiple-choice or single-choice list</h4>
-<p>To add a list of multiple-choice items (checkboxes) or
+<p>To add a list of multiple-choice items (checkboxes) or
single-choice items (radio buttons), use the
{@link android.app.AlertDialog.Builder#setMultiChoiceItems(Cursor,String,String,
-DialogInterface.OnMultiChoiceClickListener) setMultiChoiceItems()} or
-{@link android.app.AlertDialog.Builder#setSingleChoiceItems(int,int,DialogInterface.OnClickListener)
+DialogInterface.OnMultiChoiceClickListener) setMultiChoiceItems()} or
+{@link android.app.AlertDialog.Builder#setSingleChoiceItems(int,int,DialogInterface.OnClickListener)
setSingleChoiceItems()} methods, respectively.</p>
<p>For example, here's how you can create a multiple-choice list like the
@@ -349,7 +349,7 @@
// If the user checked the item, add it to the selected items
mSelectedItems.add(which);
} else if (mSelectedItems.contains(which)) {
- // Else, if the item is already in the array, remove it
+ // Else, if the item is already in the array, remove it
mSelectedItems.remove(Integer.valueOf(which));
}
}
@@ -376,7 +376,7 @@
<p>Although both a traditional list and a list with radio buttons
provide a "single choice" action, you should use {@link
-android.app.AlertDialog.Builder#setSingleChoiceItems(int,int,DialogInterface.OnClickListener)
+android.app.AlertDialog.Builder#setSingleChoiceItems(int,int,DialogInterface.OnClickListener)
setSingleChoiceItems()} if you want to persist the user's choice.
That is, if opening the dialog again later should indicate what the user's current choice is,
then you create a list with radio buttons.</p>
@@ -445,7 +445,7 @@
a matching font style.</p>
<p>To inflate the layout in your {@link android.support.v4.app.DialogFragment},
-get a {@link android.view.LayoutInflater} with
+get a {@link android.view.LayoutInflater} with
{@link android.app.Activity#getLayoutInflater()} and call
{@link android.view.LayoutInflater#inflate inflate()}, where the first parameter
is the layout resource ID and the second parameter is a parent view for the layout.
@@ -473,7 +473,7 @@
public void onClick(DialogInterface dialog, int id) {
LoginDialogFragment.this.getDialog().cancel();
}
- });
+ });
return builder.create();
}
</pre>
@@ -508,7 +508,7 @@
<pre>
public class NoticeDialogFragment extends DialogFragment {
-
+
/* The activity that creates an instance of this dialog fragment must
* implement this interface in order to receive event callbacks.
* Each method passes the DialogFragment in case the host needs to query it. */
@@ -516,10 +516,10 @@
public void onDialogPositiveClick(DialogFragment dialog);
public void onDialogNegativeClick(DialogFragment dialog);
}
-
+
// Use this instance of the interface to deliver action events
NoticeDialogListener mListener;
-
+
// Override the Fragment.onAttach() method to instantiate the NoticeDialogListener
@Override
public void onAttach(Activity activity) {
@@ -546,7 +546,7 @@
public class MainActivity extends FragmentActivity
implements NoticeDialogFragment.NoticeDialogListener{
...
-
+
public void showNoticeDialog() {
// Create an instance of the dialog fragment and show it
DialogFragment dialog = new NoticeDialogFragment();
@@ -659,7 +659,7 @@
// Inflate the layout to use as dialog or embedded fragment
return inflater.inflate(R.layout.purchase_items, container, false);
}
-
+
/** The system calls this only when creating the layout in a dialog. */
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
@@ -681,7 +681,7 @@
public void showDialog() {
FragmentManager fragmentManager = getSupportFragmentManager();
CustomDialogFragment newFragment = new CustomDialogFragment();
-
+
if (mIsLargeLayout) {
// The device is using a large layout, so show the fragment as a dialog
newFragment.show(fragmentManager, "dialog");
@@ -781,7 +781,7 @@
android.support.v4.app.DialogFragment}.</p>
<p>You can also <em>cancel</em> a dialog. This is a special event that indicates the user
-explicitly left the dialog without completing the task. This occurs if the user presses the
+explicitly left the dialog without completing the task. This occurs if the user presses the
<em>Back</em> button, touches the screen outside the dialog area,
or if you explicitly call {@link android.app.Dialog#cancel()} on the {@link
android.app.Dialog} (such as in response to a "Cancel" button in the dialog).</p>
diff --git a/docs/html/guide/topics/ui/drag-drop.jd b/docs/html/guide/topics/ui/drag-drop.jd
index 4eb54f2..8871c87 100644
--- a/docs/html/guide/topics/ui/drag-drop.jd
+++ b/docs/html/guide/topics/ui/drag-drop.jd
@@ -978,7 +978,7 @@
Log.e("DragDrop Example","Unknown action type received by OnDragListener.");
break;
}
-
+
return false;
}
};
diff --git a/docs/html/guide/topics/ui/how-android-draws.jd b/docs/html/guide/topics/ui/how-android-draws.jd
index 168f77b..7956369 100644
--- a/docs/html/guide/topics/ui/how-android-draws.jd
+++ b/docs/html/guide/topics/ui/how-android-draws.jd
@@ -4,18 +4,18 @@
@jd:body
-<p>When an {@link android.app.Activity} receives focus, it will be requested to
+<p>When an {@link android.app.Activity} receives focus, it will be requested to
draw its layout.
-The Android framework will handle the procedure for drawing, but the
+The Android framework will handle the procedure for drawing, but the
{@link android.app.Activity} must provide
the root node of its layout hierarchy.</p>
-<p>Drawing begins with the root node of the layout. It is requested to measure and
-draw the layout tree. Drawing is handled by walking the tree and rendering each
-{@link android.view.View} that intersects the invalid region. In turn, each
+<p>Drawing begins with the root node of the layout. It is requested to measure and
+draw the layout tree. Drawing is handled by walking the tree and rendering each
+{@link android.view.View} that intersects the invalid region. In turn, each
{@link android.view.ViewGroup} is responsible for requesting
-each of its children to be drawn
-(with the {@link android.view.View#draw(Canvas) draw()} method)
+each of its children to be drawn
+(with the {@link android.view.View#draw(Canvas) draw()} method)
and each {@link android.view.View} is responsible for drawing itself.
Because the tree is traversed in-order,
this means that parents will be drawn before (i.e., behind) their children, with
@@ -24,55 +24,55 @@
<div class="sidebox-wrapper">
<div class="sidebox">
- <p>The framework will not draw {@link android.view.View} objects that are not
-in the invalid region, and also
+ <p>The framework will not draw {@link android.view.View} objects that are not
+in the invalid region, and also
will take care of drawing the {@link android.view.View} background for you.</p>
- <p>You can force a {@link android.view.View} to draw, by calling
+ <p>You can force a {@link android.view.View} to draw, by calling
{@link android.view.View#invalidate()}.
</p>
</div>
</div>
<p>
- Drawing the layout is a two pass process: a measure pass and a layout pass.
-The measuring pass is implemented in {@link android.view.View#measure(int, int)}
-and is a top-down traversal of the {@link android.view.View} tree. Each {@link android.view.View}
+ Drawing the layout is a two pass process: a measure pass and a layout pass.
+The measuring pass is implemented in {@link android.view.View#measure(int, int)}
+and is a top-down traversal of the {@link android.view.View} tree. Each {@link android.view.View}
pushes dimension specifications down the tree
- during the recursion. At the end of the measure pass, every
+ during the recursion. At the end of the measure pass, every
{@link android.view.View} has stored
its measurements. The second pass happens in
{@link android.view.View#layout(int,int,int,int)} and is also top-down. During
this pass each parent is responsible for positioning all of its children
using the sizes computed in the measure pass.
</p>
-
+
<p>
- When a {@link android.view.View} object's
-{@link android.view.View#measure(int, int) measure()} method
+ When a {@link android.view.View} object's
+{@link android.view.View#measure(int, int) measure()} method
returns, its {@link android.view.View#getMeasuredWidth()} and
- {@link android.view.View#getMeasuredHeight()} values must be set, along
- with those for all of that {@link android.view.View} object's descendants.
-A {@link android.view.View} object's measured width and
-measured height values must respect the constraints imposed by the
+ {@link android.view.View#getMeasuredHeight()} values must be set, along
+ with those for all of that {@link android.view.View} object's descendants.
+A {@link android.view.View} object's measured width and
+measured height values must respect the constraints imposed by the
{@link android.view.View} object's parents. This guarantees
that at the end of the measure pass, all parents accept all of their
- children's measurements. A parent {@link android.view.View} may call
+ children's measurements. A parent {@link android.view.View} may call
{@link android.view.View#measure(int, int) measure()} more than once on
its children. For example, the parent may measure each child once with
unspecified dimensions to find out how big they want to be, then call
- {@link android.view.View#measure(int, int) measure()} on them again with
+ {@link android.view.View#measure(int, int) measure()} on them again with
actual numbers if the sum of all the children's
- unconstrained sizes is too big or too small (that is, if the children
+ unconstrained sizes is too big or too small (that is, if the children
don't agree among themselves
- as to how much space they each get, the parent will intervene and set
+ as to how much space they each get, the parent will intervene and set
the rules on the second pass).
</p>
-
+
<div class="sidebox-wrapper">
<div class="sidebox"><p>
- To initiate a layout, call {@link android.view.View#requestLayout}.
+ To initiate a layout, call {@link android.view.View#requestLayout}.
This method is typically
- called by a {@link android.view.View} on itself
+ called by a {@link android.view.View} on itself
when it believes that is can no longer fit within
its current bounds.</p>
</div>
@@ -80,54 +80,54 @@
<p>
The measure pass uses two classes to communicate dimensions. The
- {@link android.view.ViewGroup.LayoutParams} class is used by
+ {@link android.view.ViewGroup.LayoutParams} class is used by
{@link android.view.View} objects to tell their parents how they
- want to be measured and positioned. The base
+ want to be measured and positioned. The base
{@link android.view.ViewGroup.LayoutParams} class just
- describes how big the {@link android.view.View} wants to be for both
+ describes how big the {@link android.view.View} wants to be for both
width and height. For each
dimension, it can specify one of:</p>
<ul>
<li> an exact number
- <li>{@link android.view.ViewGroup.LayoutParams#MATCH_PARENT MATCH_PARENT},
+ <li>{@link android.view.ViewGroup.LayoutParams#MATCH_PARENT MATCH_PARENT},
which means the {@link android.view.View} wants to be as big as its parent
(minus padding)</li>
- <li>{@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT WRAP_CONTENT},
+ <li>{@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT WRAP_CONTENT},
which means that the {@link android.view.View} wants to be just big enough to
enclose its content (plus padding).</li>
</ul>
- <p>There are subclasses of {@link android.view.ViewGroup.LayoutParams} for
+ <p>There are subclasses of {@link android.view.ViewGroup.LayoutParams} for
different subclasses of {@link android.view.ViewGroup}.
- For example, {@link android.widget.RelativeLayout} has its own subclass of
+ For example, {@link android.widget.RelativeLayout} has its own subclass of
{@link android.view.ViewGroup.LayoutParams}, which includes
- the ability to center child {@link android.view.View} objects
+ the ability to center child {@link android.view.View} objects
horizontally and vertically.
</p>
-
+
<p>
- {@link android.view.View.MeasureSpec MeasureSpec} objects are used to push
+ {@link android.view.View.MeasureSpec MeasureSpec} objects are used to push
requirements down the tree from parent to
- child. A {@link android.view.View.MeasureSpec MeasureSpec} can be in one of
+ child. A {@link android.view.View.MeasureSpec MeasureSpec} can be in one of
three modes:</p>
<ul>
- <li>{@link android.view.View.MeasureSpec#UNSPECIFIED UNSPECIFIED}: This is
+ <li>{@link android.view.View.MeasureSpec#UNSPECIFIED UNSPECIFIED}: This is
used by a parent to determine the desired dimension
- of a child {@link android.view.View}. For example, a
-{@link android.widget.LinearLayout} may call
+ of a child {@link android.view.View}. For example, a
+{@link android.widget.LinearLayout} may call
{@link android.view.View#measure(int, int) measure()} on its child
- with the height set to {@link android.view.View.MeasureSpec#UNSPECIFIED UNSPECIFIED}
-and a width of {@link android.view.View.MeasureSpec#EXACTLY EXACTLY} 240 to
-find out how tall the child {@link android.view.View} wants to be given a
+ with the height set to {@link android.view.View.MeasureSpec#UNSPECIFIED UNSPECIFIED}
+and a width of {@link android.view.View.MeasureSpec#EXACTLY EXACTLY} 240 to
+find out how tall the child {@link android.view.View} wants to be given a
width of 240 pixels.</li>
- <li>{@link android.view.View.MeasureSpec#EXACTLY EXACTLY}: This is used
+ <li>{@link android.view.View.MeasureSpec#EXACTLY EXACTLY}: This is used
by the parent to impose an exact size on the
child. The child must use this size, and guarantee that all of its
descendants will fit within this size.</li>
- <li>{@link android.view.View.MeasureSpec#AT_MOST AT MOST}: This is used by
+ <li>{@link android.view.View.MeasureSpec#AT_MOST AT MOST}: This is used by
the parent to impose a maximum size on the
child. The child must guarantee that it and all of its descendants will fit
within this size.</li>
</ul>
-
+
diff --git a/docs/html/guide/topics/ui/index.jd b/docs/html/guide/topics/ui/index.jd
index 0725eb7..ccdf200 100644
--- a/docs/html/guide/topics/ui/index.jd
+++ b/docs/html/guide/topics/ui/index.jd
@@ -1,6 +1,6 @@
page.title=User Interface
page.landing=true
-page.landing.intro=Your app's user interface is everything that the user can see and interact with. Android provides a variety of pre-built UI components such as structured layout objects and UI controls that allow you to build the graphical user interface for your app. Android also provides other UI modules for special interfaces such as dialogs, notifications, and menus.
+page.landing.intro=Your app's user interface is everything that the user can see and interact with. Android provides a variety of pre-built UI components such as structured layout objects and UI controls that allow you to build the graphical user interface for your app. Android also provides other UI modules for special interfaces such as dialogs, notifications, and menus.
page.landing.image=images/ui/ui_index.png
page.landing.next=overview.html
diff --git a/docs/html/guide/topics/ui/layout/grid.jd b/docs/html/guide/topics/ui/layout/grid.jd
index 3474f48..31f9b9c 100644
--- a/docs/html/guide/topics/ui/layout/grid.jd
+++ b/docs/html/guide/topics/ui/layout/grid.jd
@@ -32,7 +32,7 @@
Each row has zero or more cells, each of which is defined by any kind of other View. So, the cells of a row may be
composed of a variety of View objects, like ImageView or TextView objects.
A cell may also be a ViewGroup object (for example, you can nest another TableLayout as a cell).</p>
-<p>The following sample layout has two rows and two cells in each. The accompanying screenshot shows the
+<p>The following sample layout has two rows and two cells in each. The accompanying screenshot shows the
result, with cell borders displayed as dotted lines (added for visual effect). </p>
<table class="columns">
@@ -71,7 +71,7 @@
<p>Columns can be hidden, marked to stretch and fill the available screen space,
or can be marked as shrinkable to force the column to shrink until the table
- fits the screen. See the {@link android.widget.TableLayout TableLayout reference}
+ fits the screen. See the {@link android.widget.TableLayout TableLayout reference}
documentation for more details. </p>
diff --git a/docs/html/guide/topics/ui/layout/linear.jd b/docs/html/guide/topics/ui/layout/linear.jd
index 7441782..4224d17 100644
--- a/docs/html/guide/topics/ui/layout/linear.jd
+++ b/docs/html/guide/topics/ui/layout/linear.jd
@@ -59,7 +59,7 @@
>{@code android:layout_weight}</a> attribute.
This attribute assigns an "importance" value to a view in
terms of how much space it should occupy on the screen. A larger weight value allows it to expand
-to fill any remaining space in the parent view.
+to fill any remaining space in the parent view.
Child views can specify a weight value, and then any remaining space in the view group is
assigned to children in the proportion of their declared weight. Default
weight is zero.</p>
diff --git a/docs/html/guide/topics/ui/layout/listview.jd b/docs/html/guide/topics/ui/layout/listview.jd
index 3c6e32c..e6e5578 100644
--- a/docs/html/guide/topics/ui/layout/listview.jd
+++ b/docs/html/guide/topics/ui/layout/listview.jd
@@ -80,7 +80,7 @@
ContactsContract.Data.DISPLAY_NAME};
// This is the select criteria
- static final String SELECTION = "((" +
+ static final String SELECTION = "((" +
ContactsContract.Data.DISPLAY_NAME + " NOTNULL) AND (" +
ContactsContract.Data.DISPLAY_NAME + " != '' ))";
@@ -105,7 +105,7 @@
// Create an empty adapter we will use to display the loaded data.
// We pass null for the cursor, then update it in onLoadFinished()
- mAdapter = new SimpleCursorAdapter(this,
+ mAdapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1, null,
fromColumns, toViews, 0);
setListAdapter(mAdapter);
@@ -138,7 +138,7 @@
mAdapter.swapCursor(null);
}
- @Override
+ @Override
public void onListItemClick(ListView l, View v, int position, long id) {
// Do something when a list item is clicked
}
diff --git a/docs/html/guide/topics/ui/layout/relative.jd b/docs/html/guide/topics/ui/layout/relative.jd
index ca5cb48..92735ae 100644
--- a/docs/html/guide/topics/ui/layout/relative.jd
+++ b/docs/html/guide/topics/ui/layout/relative.jd
@@ -38,7 +38,7 @@
views are drawn at the top-left of the layout, so you must define the position of each view
using the various layout properties available from {@link
android.widget.RelativeLayout.LayoutParams}.</p>
-
+
<p>Some of the many layout properties available to views in a {@link android.widget.RelativeLayout}
include:</p>
<dl>
diff --git a/docs/html/guide/topics/ui/menus.jd b/docs/html/guide/topics/ui/menus.jd
index ad2aa9b..73dec20 100644
--- a/docs/html/guide/topics/ui/menus.jd
+++ b/docs/html/guide/topics/ui/menus.jd
@@ -77,9 +77,9 @@
"Search," "Compose email," and "Settings."
<p>See the section about <a href="#options-menu">Creating an Options Menu</a>.</p>
</dd>
-
+
<dt><strong>Context menu and contextual action mode</strong></dt>
-
+
<dd>A context menu is a <a href="#FloatingContextMenu">floating menu</a> that appears when the
user performs a long-click on an element. It provides actions that affect the selected content or
context frame.
@@ -88,7 +88,7 @@
to select multiple items.</p>
<p>See the section about <a href="#context-menu">Creating Contextual Menus</a>.</p>
</dd>
-
+
<dt><strong>Popup menu</strong></dt>
<dd>A popup menu displays a list of items in a vertical list that's anchored to the view that
invoked the menu. It's good for providing an overflow of actions that relate to specific content or
@@ -130,7 +130,7 @@
<dt><code><item></code></dt>
<dd>Creates a {@link android.view.MenuItem}, which represents a single item in a menu. This
element may contain a nested <code><menu></code> element in order to create a submenu.</dd>
-
+
<dt><code><group></code></dt>
<dd>An optional, invisible container for {@code <item>} elements. It allows you to
categorize menu items so they share properties such as active state and visibility. For more
@@ -224,7 +224,7 @@
<em>More</em>.</li>
<li>If you've developed your application for <strong>Android 3.0 (API level 11) and
-higher</strong>, items from the options menu are available in the
+higher</strong>, items from the options menu are available in the
app bar. By default, the system
places all items in the action overflow, which the user can reveal with the action overflow icon on
the right side of the app bar (or by pressing the device <em>Menu</em> button, if available). To
@@ -343,7 +343,7 @@
android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} only to create the initial
menu state and not to make changes during the activity lifecycle.</p>
-<p>If you want to modify the options menu based on
+<p>If you want to modify the options menu based on
events that occur during the activity lifecycle, you can do so in
the {@link android.app.Activity#onPrepareOptionsMenu(Menu) onPrepareOptionsMenu()} method. This
method passes you the {@link android.view.Menu} object as it currently exists so you can modify it,
@@ -360,7 +360,7 @@
call {@link android.app.Activity#invalidateOptionsMenu invalidateOptionsMenu()} to request that the
system call {@link android.app.Activity#onPrepareOptionsMenu(Menu) onPrepareOptionsMenu()}.</p>
-<p class="note"><strong>Note:</strong>
+<p class="note"><strong>Note:</strong>
You should never change items in the options menu based on the {@link android.view.View} currently
in focus. When in touch mode (when the user is not using a trackball or d-pad), views
cannot take focus, so you should never use focus as the basis for modifying
@@ -738,8 +738,8 @@
<pre>
<ImageButton
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:src="@drawable/ic_overflow_holo_dark"
android:contentDescription="@string/descr_overflow_button"
android:onClick="showPopup" />
@@ -1023,6 +1023,6 @@
<p>Read more about writing intent filters in the
<a href="/guide/components/intents-filters.html">Intents and Intent Filters</a> document.</p>
-<p>For a sample application using this technique, see the
+<p>For a sample application using this technique, see the
<a href="{@docRoot}resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.html">Note
Pad</a> sample code.</p>
diff --git a/docs/html/guide/topics/ui/notifiers/toasts.jd b/docs/html/guide/topics/ui/notifiers/toasts.jd
index e5d4a0a..d962727 100644
--- a/docs/html/guide/topics/ui/notifiers/toasts.jd
+++ b/docs/html/guide/topics/ui/notifiers/toasts.jd
@@ -2,14 +2,14 @@
@jd:body
<div id="qv-wrapper">
- <div id="qv">
+ <div id="qv">
<h2>In this document</h2>
<ol>
<li><a href="#Basics">The Basics</a></li>
<li><a href="#Positioning">Positioning your Toast</a></li>
<li><a href="#CustomToastView">Creating a Custom Toast View</a></li>
</ol>
-
+
<h2>Key classes</h2>
<ol>
<li>{@link android.widget.Toast}</li>
@@ -19,14 +19,14 @@
<p>A toast provides simple feedback about an operation in a small popup.
It only fills the amount of space required for the message and the current
-activity remains visible and interactive.
-For example, navigating away from an email before you send it triggers a
-"Draft saved" toast to let you know that you can continue editing later.
+activity remains visible and interactive.
+For example, navigating away from an email before you send it triggers a
+"Draft saved" toast to let you know that you can continue editing later.
Toasts automatically disappear after a timeout.</p>
<img src="{@docRoot}images/toast.png" alt="" />
-<p>If user response to a status message is required, consider instead using a
+<p>If user response to a status message is required, consider instead using a
<a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Notification</a>.</p>
@@ -49,8 +49,8 @@
</pre>
<p>This example demonstrates everything you need for most toast notifications.
-You should rarely need anything else. You may, however, want to position the
-toast differently or even use your own layout instead of a simple text message.
+You should rarely need anything else. You may, however, want to position the
+toast differently or even use your own layout instead of a simple text message.
The following sections describe how you can do these things.</p>
<p>You can also chain your methods and avoid holding on to the Toast object, like this:</p>
@@ -61,7 +61,7 @@
<p>A standard toast notification appears near the bottom of the screen, centered horizontally.
You can change this position with the {@link android.widget.Toast#setGravity(int,int,int)}
-method. This accepts three parameters: a {@link android.view.Gravity} constant,
+method. This accepts three parameters: a {@link android.view.Gravity} constant,
an x-position offset, and a y-position offset.</p>
<p>For example, if you decide that the toast should appear in the top-left corner, you can set the
@@ -70,7 +70,7 @@
toast.setGravity(Gravity.TOP|Gravity.LEFT, 0, 0);
</pre>
-<p>If you want to nudge the position to the right, increase the value of the second parameter.
+<p>If you want to nudge the position to the right, increase the value of the second parameter.
To nudge it down, increase the value of the last parameter.
@@ -103,7 +103,7 @@
android:textColor="#FFF"
/>
</LinearLayout>
-</pre>
+</pre>
<p>Notice that the ID of the LinearLayout element is "toast_layout_root". You must use this
ID to inflate the layout from the XML, as shown here:</p>
@@ -123,21 +123,21 @@
toast.show();
</pre>
-<p>First, retrieve the {@link android.view.LayoutInflater} with
-{@link android.app.Activity#getLayoutInflater()}
+<p>First, retrieve the {@link android.view.LayoutInflater} with
+{@link android.app.Activity#getLayoutInflater()}
(or {@link android.content.Context#getSystemService(String) getSystemService()}),
-and then inflate the layout from XML using
+and then inflate the layout from XML using
{@link android.view.LayoutInflater#inflate(int, ViewGroup)}. The first parameter
is the layout resource ID and the second is the root View. You can use
-this inflated layout to find more View objects in the layout, so now capture and
+this inflated layout to find more View objects in the layout, so now capture and
define the content for the ImageView and TextView elements. Finally, create
a new Toast with {@link android.widget.Toast#Toast(Context)} and set some properties
of the toast, such as the gravity and duration. Then call
{@link android.widget.Toast#setView(View)} and pass it the inflated layout.
-You can now display the toast with your custom layout by calling
+You can now display the toast with your custom layout by calling
{@link android.widget.Toast#show()}.</p>
-<p class="note"><strong>Note:</strong> Do not use the public constructor for a Toast
+<p class="note"><strong>Note:</strong> Do not use the public constructor for a Toast
unless you are going to define the layout with {@link android.widget.Toast#setView(View)}.
If you do not have a custom layout to use, you must use
{@link android.widget.Toast#makeText(Context,int,int)} to create the Toast.</p>
diff --git a/docs/html/guide/topics/ui/overview.jd b/docs/html/guide/topics/ui/overview.jd
index 85c5756..f323d6c 100644
--- a/docs/html/guide/topics/ui/overview.jd
+++ b/docs/html/guide/topics/ui/overview.jd
@@ -39,7 +39,7 @@
<pre>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
@@ -60,7 +60,7 @@
<p>For a complete guide to creating a UI layout, see <a href="declaring-layout.html">XML
Layouts</a>.
-
+
<h2 id="UIComponents">User Interface Components</h2>
<p>You don't have to build all of your UI using {@link android.view.View} and {@link
diff --git a/docs/html/guide/topics/ui/settings.jd b/docs/html/guide/topics/ui/settings.jd
index 243c1c34..9e304a3 100644
--- a/docs/html/guide/topics/ui/settings.jd
+++ b/docs/html/guide/topics/ui/settings.jd
@@ -84,7 +84,7 @@
<img src="{@docRoot}images/ui/settings/settings.png" alt="" width="435" />
<p class="img-caption"><strong>Figure 1.</strong> Screenshots from the Android Messaging app's
-settings. Selecting an item defined by a {@link android.preference.Preference}
+settings. Selecting an item defined by a {@link android.preference.Preference}
opens an interface to change the setting.</p>
@@ -230,7 +230,7 @@
<dt>{@code android:key}</dt>
<dd>This attribute is required for preferences that persist a data value. It specifies the unique
key (a string) the system uses when saving this setting's value in the {@link
-android.content.SharedPreferences}.
+android.content.SharedPreferences}.
<p>The only instances in which this attribute is <em>not required</em> is when the preference is a
{@link android.preference.PreferenceCategory} or {@link android.preference.PreferenceScreen}, or the
preference specifies an {@link android.content.Intent} to invoke (with an <a
@@ -291,7 +291,7 @@
<pre>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <PreferenceCategory
+ <PreferenceCategory
android:title="@string/pref_sms_storage_title"
android:key="pref_key_storage_settings">
<CheckBoxPreference
@@ -299,12 +299,12 @@
android:summary="@string/pref_summary_auto_delete"
android:title="@string/pref_title_auto_delete"
android:defaultValue="false"... />
- <Preference
+ <Preference
android:key="pref_key_sms_delete_limit"
android:dependency="pref_key_auto_delete"
android:summary="@string/pref_summary_delete_limit"
android:title="@string/pref_title_sms_delete"... />
- <Preference
+ <Preference
android:key="pref_key_mms_delete_limit"
android:dependency="pref_key_auto_delete"
android:summary="@string/pref_summary_delete_limit"
@@ -594,11 +594,11 @@
<pre>
<?xml version="1.0" encoding="utf-8"?>
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
- <header
+ <header
android:fragment="com.example.prefs.SettingsActivity$SettingsFragmentOne"
android:title="@string/prefs_category_one"
android:summary="@string/prefs_summ_category_one" />
- <header
+ <header
android:fragment="com.example.prefs.SettingsActivity$SettingsFragmentTwo"
android:title="@string/prefs_category_two"
android:summary="@string/prefs_summ_category_two" >
@@ -678,15 +678,15 @@
load.</p>
<p>For example, here's an XML file for preference headers that is used on Android 3.0
-and higher ({@code res/xml/preference_headers.xml}):</p>
+and higher ({@code res/xml/preference_headers.xml}):</p>
<pre>
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
- <header
+ <header
android:fragment="com.example.prefs.SettingsFragmentOne"
android:title="@string/prefs_category_one"
android:summary="@string/prefs_summ_category_one" />
- <header
+ <header
android:fragment="com.example.prefs.SettingsFragmentTwo"
android:title="@string/prefs_category_two"
android:summary="@string/prefs_summ_category_two" />
@@ -698,18 +698,18 @@
<pre>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <Preference
+ <Preference
android:title="@string/prefs_category_one"
android:summary="@string/prefs_summ_category_one" >
- <intent
+ <intent
android:targetPackage="com.example.prefs"
android:targetClass="com.example.prefs.SettingsActivity"
android:action="com.example.prefs.PREFS_ONE" />
</Preference>
- <Preference
+ <Preference
android:title="@string/prefs_category_two"
android:summary="@string/prefs_summ_category_two" >
- <intent
+ <intent
android:targetPackage="com.example.prefs"
android:targetClass="com.example.prefs.SettingsActivity"
android:action="com.example.prefs.PREFS_TWO" />
@@ -982,11 +982,11 @@
public class NumberPickerPreference extends DialogPreference {
public NumberPickerPreference(Context context, AttributeSet attrs) {
super(context, attrs);
-
+
setDialogLayoutResource(R.layout.numberpicker_dialog);
setPositiveButtonText(android.R.string.ok);
setNegativeButtonText(android.R.string.cancel);
-
+
setDialogIcon(null);
}
...
@@ -1201,7 +1201,7 @@
// Cast state to custom BaseSavedState and pass to superclass
SavedState myState = (SavedState) state;
super.onRestoreInstanceState(myState.getSuperState());
-
+
// Set this Preference's widget to reflect the restored state
mNumberPicker.setValue(myState.value);
}
diff --git a/docs/html/guide/topics/ui/themes.jd b/docs/html/guide/topics/ui/themes.jd
index f932dbd..436b789 100644
--- a/docs/html/guide/topics/ui/themes.jd
+++ b/docs/html/guide/topics/ui/themes.jd
@@ -177,7 +177,7 @@
<p>The best place to find properties that apply to a specific {@link android.view.View} is the
corresponding class reference, which lists all of the supported XML attributes. For example, all of the
attributes listed in the table of
-<a href="{@docRoot}reference/android/widget/TextView.html#lattrs">TextView XML
+<a href="{@docRoot}reference/android/widget/TextView.html#lattrs">TextView XML
attributes</a> can be used in a style definition for a {@link android.widget.TextView} element (or one of
its subclasses). One of the attributes listed in the reference is <a
href="{@docRoot}reference/android/widget/TextView.html#attr_android:inputType">{@code
@@ -279,14 +279,14 @@
<h3 id="ApplyATheme">Apply a theme to an Activity or application</h3>
<p>To set a theme for all the activities of your application, open the {@code AndroidManifest.xml} file and
-edit the <code><application></code> tag to include the <code>android:theme</code> attribute with the
+edit the <code><application></code> tag to include the <code>android:theme</code> attribute with the
style name. For example:</p>
<pre>
<application android:theme="@style/CustomTheme">
</pre>
-<p>If you want a theme applied to just one Activity in your application, then add the
+<p>If you want a theme applied to just one Activity in your application, then add the
<code>android:theme</code> attribute to the <code><activity></code> tag instead.</p>
<p>Just as Android provides other built-in resources, there are many pre-defined themes that you can use, to avoid
@@ -374,9 +374,9 @@
for you to change your theme programatically (perhaps based on a user preference), you can.</p>
<p>To set the theme in your program code, use the {@link android.content.ContextWrapper#setTheme(int)}
-method and pass it the theme resource ID. Note that, when doing so, you must be sure to set the theme <em>before</em>
-instantiating any Views in the context, for example, before calling
-<code>setContentView(View)</code> or <code>inflate(int, ViewGroup)</code>. This ensures that
+method and pass it the theme resource ID. Note that, when doing so, you must be sure to set the theme <em>before</em>
+instantiating any Views in the context, for example, before calling
+<code>setContentView(View)</code> or <code>inflate(int, ViewGroup)</code>. This ensures that
the system applies the same theme for all of your UI screens. Here's an example:</p>
<pre>
@@ -391,7 +391,7 @@
<p>If you are considering loading a theme programmatically for the main
screen of your application, note that the theme would not be applied
in any animations the system would use to start the activity, which
-would take place before your application opens. In most cases, if
+would take place before your application opens. In most cases, if
you want to apply a theme to your main screen, doing so in XML
is a better approach. </p>
diff --git a/docs/html/guide/topics/ui/ui-events.jd b/docs/html/guide/topics/ui/ui-events.jd
index 6d41b15..7dd24a4 100644
--- a/docs/html/guide/topics/ui/ui-events.jd
+++ b/docs/html/guide/topics/ui/ui-events.jd
@@ -20,8 +20,8 @@
When considering events within your user interface, the approach is to capture the events from
the specific View object that the user interacts with. The View class provides the means to do so.</p>
-<p>Within the various View classes that you'll use to compose your layout, you may notice several public callback
-methods that look useful for UI events. These methods are called by the Android framework when the
+<p>Within the various View classes that you'll use to compose your layout, you may notice several public callback
+methods that look useful for UI events. These methods are called by the Android framework when the
respective action occurs on that object. For instance, when a View (such as a Button) is touched,
the <code>onTouchEvent()</code> method is called on that object. However, in order to intercept this, you must extend
the class and override the method. However, extending every View object
@@ -30,7 +30,7 @@
called <a href="#EventListeners">event listeners</a>, are your ticket to capturing the user interaction with your UI.</p>
<p>While you will more commonly use the event listeners to listen for user interaction, there may
-come a time when you do want to extend a View class, in order to build a custom component.
+come a time when you do want to extend a View class, in order to build a custom component.
Perhaps you want to extend the {@link android.widget.Button}
class to make something more fancy. In this case, you'll be able to define the default event behaviors for your
class using the class <a href="#EventHandlers">event handlers</a>.</p>
@@ -38,7 +38,7 @@
<h2 id="EventListeners">Event Listeners</h2>
-<p>An event listener is an interface in the {@link android.view.View} class that contains a single
+<p>An event listener is an interface in the {@link android.view.View} class that contains a single
callback method. These methods will be called by the Android framework when the View to which the listener has
been registered is triggered by user interaction with the item in the UI.</p>
@@ -46,27 +46,27 @@
<dl>
<dt><code>onClick()</code></dt>
- <dd>From {@link android.view.View.OnClickListener}.
- This is called when the user either touches the item
+ <dd>From {@link android.view.View.OnClickListener}.
+ This is called when the user either touches the item
(when in touch mode), or focuses upon the item with the navigation-keys or trackball and
presses the suitable "enter" key or presses down on the trackball.</dd>
<dt><code>onLongClick()</code></dt>
- <dd>From {@link android.view.View.OnLongClickListener}.
- This is called when the user either touches and holds the item (when in touch mode), or
+ <dd>From {@link android.view.View.OnLongClickListener}.
+ This is called when the user either touches and holds the item (when in touch mode), or
focuses upon the item with the navigation-keys or trackball and
presses and holds the suitable "enter" key or presses and holds down on the trackball (for one second).</dd>
<dt><code>onFocusChange()</code></dt>
- <dd>From {@link android.view.View.OnFocusChangeListener}.
+ <dd>From {@link android.view.View.OnFocusChangeListener}.
This is called when the user navigates onto or away from the item, using the navigation-keys or trackball.</dd>
<dt><code>onKey()</code></dt>
- <dd>From {@link android.view.View.OnKeyListener}.
+ <dd>From {@link android.view.View.OnKeyListener}.
This is called when the user is focused on the item and presses or releases a hardware key on the device.</dd>
<dt><code>onTouch()</code></dt>
- <dd>From {@link android.view.View.OnTouchListener}.
+ <dd>From {@link android.view.View.OnTouchListener}.
This is called when the user performs an action qualified as a touch event, including a press, a release,
or any movement gesture on the screen (within the bounds of the item).</dd>
<dt><code>onCreateContextMenu()</code></dt>
- <dd>From {@link android.view.View.OnCreateContextMenuListener}.
+ <dd>From {@link android.view.View.OnCreateContextMenuListener}.
This is called when a Context Menu is being built (as the result of a sustained "long click"). See the discussion
on context menus in the <a href="{@docRoot}guide/topics/ui/menus.html#context-menu">Menus</a>
developer guide.</dd>
@@ -75,8 +75,8 @@
<p>These methods are the sole inhabitants of their respective interface. To define one of these methods
and handle your events, implement the nested interface in your Activity or define it as an anonymous class.
Then, pass an instance of your implementation
-to the respective <code>View.set...Listener()</code> method. (E.g., call
-<code>{@link android.view.View#setOnClickListener(View.OnClickListener) setOnClickListener()}</code>
+to the respective <code>View.set...Listener()</code> method. (E.g., call
+<code>{@link android.view.View#setOnClickListener(View.OnClickListener) setOnClickListener()}</code>
and pass it your implementation of the {@link android.view.View.OnClickListener OnClickListener}.)</p>
<p>The example below shows how to register an on-click listener for a Button. </p>
@@ -121,17 +121,17 @@
no return value, but some other event listener methods must return a boolean. The reason
depends on the event. For the few that do, here's why:</p>
<ul>
- <li><code>{@link android.view.View.OnLongClickListener#onLongClick(View) onLongClick()}</code> -
- This returns a boolean to indicate whether you have consumed the event and it should not be carried further.
- That is, return <em>true</em> to indicate that you have handled the event and it should stop here;
+ <li><code>{@link android.view.View.OnLongClickListener#onLongClick(View) onLongClick()}</code> -
+ This returns a boolean to indicate whether you have consumed the event and it should not be carried further.
+ That is, return <em>true</em> to indicate that you have handled the event and it should stop here;
return <em>false</em> if you have not handled it and/or the event should continue to any other
on-click listeners.</li>
- <li><code>{@link android.view.View.OnKeyListener#onKey(View,int,KeyEvent) onKey()}</code> -
+ <li><code>{@link android.view.View.OnKeyListener#onKey(View,int,KeyEvent) onKey()}</code> -
This returns a boolean to indicate whether you have consumed the event and it should not be carried further.
- That is, return <em>true</em> to indicate that you have handled the event and it should stop here;
+ That is, return <em>true</em> to indicate that you have handled the event and it should stop here;
return <em>false</em> if you have not handled it and/or the event should continue to any other
on-key listeners.</li>
- <li><code>{@link android.view.View.OnTouchListener#onTouch(View,MotionEvent) onTouch()}</code> -
+ <li><code>{@link android.view.View.OnTouchListener#onTouch(View,MotionEvent) onTouch()}</code> -
This returns a boolean to indicate whether your listener consumes this event. The important thing is that
this event can have multiple actions that follow each other. So, if you return <em>false</em> when the
down action event is received, you indicate that you have not consumed the event and are also
@@ -142,7 +142,7 @@
<p>Remember that hardware key events are always delivered to the View currently in focus. They are dispatched starting from the top
of the View hierarchy, and then down, until they reach the appropriate destination. If your View (or a child of your View)
currently has focus, then you can see the event travel through the <code>{@link android.view.View#dispatchKeyEvent(KeyEvent)
-dispatchKeyEvent()}</code> method. As an alternative to capturing key events through your View, you can also receive
+dispatchKeyEvent()}</code> method. As an alternative to capturing key events through your View, you can also receive
all of the events inside your Activity with <code>{@link android.app.Activity#onKeyDown(int,KeyEvent) onKeyDown()}</code>
and <code>{@link android.app.Activity#onKeyUp(int,KeyEvent) onKeyUp()}</code>.</p>
@@ -176,19 +176,19 @@
<li><code>{@link android.view.View#onTouchEvent}</code> - Called when a touch screen motion event occurs.</li>
<li><code>{@link android.view.View#onFocusChanged}</code> - Called when the view gains or loses focus.</li>
</ul>
-<p>There are some other methods that you should be aware of, which are not part of the View class,
-but can directly impact the way you're able to handle events. So, when managing more complex events inside
+<p>There are some other methods that you should be aware of, which are not part of the View class,
+but can directly impact the way you're able to handle events. So, when managing more complex events inside
a layout, consider these other methods:</p>
<ul>
<li><code>{@link android.app.Activity#dispatchTouchEvent(MotionEvent)
- Activity.dispatchTouchEvent(MotionEvent)}</code> - This allows your {@link
+ Activity.dispatchTouchEvent(MotionEvent)}</code> - This allows your {@link
android.app.Activity} to intercept all touch events before they are dispatched to the window.</li>
<li><code>{@link android.view.ViewGroup#onInterceptTouchEvent(MotionEvent)
ViewGroup.onInterceptTouchEvent(MotionEvent)}</code> - This allows a {@link
android.view.ViewGroup} to watch events as they are dispatched to child Views.</li>
<li><code>{@link android.view.ViewParent#requestDisallowInterceptTouchEvent(boolean)
ViewParent.requestDisallowInterceptTouchEvent(boolean)}</code> - Call this
- upon a parent View to indicate that it should not intercept touch events with <code>{@link
+ upon a parent View to indicate that it should not intercept touch events with <code>{@link
android.view.ViewGroup#onInterceptTouchEvent(MotionEvent)}</code>.</li>
</ul>
@@ -199,7 +199,7 @@
what will accept input. If the device has touch capabilities, however, and the user
begins interacting with the interface by touching it, then it is no longer necessary to
highlight items, or give focus to a particular View. Thus, there is a mode
-for interaction named "touch mode."
+for interaction named "touch mode."
</p>
<p>
For a touch-capable device, once the user touches the screen, the device
@@ -214,7 +214,7 @@
with the user interface without touching the screen.
</p>
<p>
-The touch mode state is maintained throughout the entire system (all windows and activities).
+The touch mode state is maintained throughout the entire system (all windows and activities).
To query the current state, you can call
{@link android.view.View#isInTouchMode} to see whether the device is currently in touch mode.
</p>
@@ -254,10 +254,10 @@
<p>Ordinarily, in this vertical layout, navigating up from the first Button would not go
anywhere, nor would navigating down from the second Button. Now that the top Button has
-defined the bottom one as the <var>nextFocusUp</var> (and vice versa), the navigation focus will
+defined the bottom one as the <var>nextFocusUp</var> (and vice versa), the navigation focus will
cycle from top-to-bottom and bottom-to-top.</p>
-<p>If you'd like to declare a View as focusable in your UI (when it is traditionally not),
+<p>If you'd like to declare a View as focusable in your UI (when it is traditionally not),
add the <code>android:focusable</code> XML attribute to the View, in your layout declaration.
Set the value <var>true</var>. You can also declare a View
as focusable while in Touch Mode with <code>android:focusableInTouchMode</code>.</p>
@@ -282,7 +282,7 @@
the framework will take care of measuring, laying out, and drawing the tree
as appropriate.</li>
</ol>
-
+
<p class="note"><strong>Note:</strong> The entire View tree is single threaded. You must always be on
the UI thread when calling any method on any View.
If you are doing work on other threads and want to update the state of a View
diff --git a/docs/html/guide/webapps/debugging.jd b/docs/html/guide/webapps/debugging.jd
index a74797d..9e8e113 100755
--- a/docs/html/guide/webapps/debugging.jd
+++ b/docs/html/guide/webapps/debugging.jd
@@ -92,7 +92,7 @@
<h2 id="WebView">Using Console APIs in WebView</h2>
<p>All the console APIs shown above are also
-supported when debugging in {@link android.webkit.WebView}.
+supported when debugging in {@link android.webkit.WebView}.
If you're targeting Android 2.1 (API level 7) and higher, you must
provide a {@link android.webkit.WebChromeClient}
that implements the {@link android.webkit.WebChromeClient#onConsoleMessage(String,int,String)
diff --git a/docs/html/guide/webapps/targeting.jd b/docs/html/guide/webapps/targeting.jd
index 4a2ea17..10259b1 100644
--- a/docs/html/guide/webapps/targeting.jd
+++ b/docs/html/guide/webapps/targeting.jd
@@ -108,7 +108,7 @@
<p>When optimizing your site for mobile devices, you should usually set the width to
-{@code "device-width"} so the size fits exactly on all devices, then use CSS media queries to
+{@code "device-width"} so the size fits exactly on all devices, then use CSS media queries to
flexibly adapt layouts to suit different screen sizes.
<p class="note"><strong>Note:</strong> You should disable user scaling only when you're certain
diff --git a/docs/html/license.jd b/docs/html/license.jd
index 4f4036b..e843c6b 100644
--- a/docs/html/license.jd
+++ b/docs/html/license.jd
@@ -9,7 +9,7 @@
<p>For the purposes of licensing, the content of this web site is divided
into two categories:</p>
<ul>
- <li>Documentation content, including both static documentation and content extracted from source
+ <li>Documentation content, including both static documentation and content extracted from source
code modules, as well as sample code, and </li>
<li>All other site content</li>
</ul>
@@ -66,7 +66,7 @@
license, note that proprietary trademarks and brand features are not
included in that license.</li>
-<li>Google's trademarks and other brand features (including the
+<li>Google's trademarks and other brand features (including the
<img src="images/android-logo.png" alt="Android"
style="margin:0;padding:0 2px;vertical-align:baseline" /> stylized typeface logo) are not included
in the license.
@@ -74,7 +74,7 @@
href="{@docRoot}distribute/tools/promote/brand.html">Brand Guidelines</a> for
information about this usage. </li>
-<li>In some cases, a page may include content, such as an image, that is not
+<li>In some cases, a page may include content, such as an image, that is not
covered by the license. In that case, we will label the content that is not licensed. </li>
<li>In addition, content linked from a page on this site is not covered
@@ -92,22 +92,22 @@
versions of content that appears on a page made available under the
terms of the Creative Commons Attribution license. On this site, the
requirement for attribution applies only to the non-documentation
-content, as described earlier in this document. The complete
-requirements for attribution can be found in section 4b of the
+content, as described earlier in this document. The complete
+requirements for attribution can be found in section 4b of the
<a href="http://creativecommons.org/licenses/by/2.5/legalcode">
Creative Commons legal code</a>.
</p>
<p>
In practice we ask that you provide attribution to the Android Open
- Source project to the best of the ability of the medium in which you
- are producing the work. There are several typical ways in which this
+ Source project to the best of the ability of the medium in which you
+ are producing the work. There are several typical ways in which this
might apply:
</p>
<h3>Exact Reproductions</h3>
<p>
If your online work <em>exactly reproduces</em> text or images from this
site, in whole or in part, please include a paragraph at the bottom
- of your page that reads:
+ of your page that reads:
</p>
<p style="margin-left:20px;font-style:italic">
Portions of this page are reproduced from work created and <a
diff --git a/docs/html/samples/index.jd b/docs/html/samples/index.jd
index 5885086..240a54c 100644
--- a/docs/html/samples/index.jd
+++ b/docs/html/samples/index.jd
@@ -35,7 +35,7 @@
from GitHub as a new project.
</p>
-<p>To view the Android code samples that you can import, see the
+<p>To view the Android code samples that you can import, see the
<a class="external-link" href="https://github.com/googlesamples/">Google Samples page</a> on GitHub.</p>
<h2>Download Samples</h2>
@@ -69,6 +69,6 @@
<p class="note">
<strong>Note:</strong> At this time, the downloadable projects are designed for use with Gradle
- and Android Studio.
+ and Android Studio.
</p>
diff --git a/docs/html/sdk/OLD_RELEASENOTES.jd b/docs/html/sdk/OLD_RELEASENOTES.jd
index b7fd12f..dfbeaeb 100644
--- a/docs/html/sdk/OLD_RELEASENOTES.jd
+++ b/docs/html/sdk/OLD_RELEASENOTES.jd
@@ -14,7 +14,7 @@
<a name="0.9_r1" id="0.9_r1"></a>
<h2>Android 0.9 SDK Beta (r1)</h2>
-<p>This beta SDK release contains a large number of bug fixes and improvements from the early-look SDKs.
+<p>This beta SDK release contains a large number of bug fixes and improvements from the early-look SDKs.
The sections below describe the highlights of the release.
<h3>New Features and Notable Changes</h3>
@@ -109,7 +109,7 @@
</ul>
<p>Known issues/limitations for Graphical Layout Editor include:</p>
-
+
<ul>
<li>Font display is very close but not equals to on-device rendering since the font engine in Java slightly differs from the font engine in Android. This should not have any impact on your layouts.
</li>
@@ -123,7 +123,7 @@
</li>
<li>No support for WebView, MapView and SurfaceView.
</li>
- <li>No UI support for <merge>, <include>, <ViewStub> elements. You can add these elements to your manifest using the xml editor only.
+ <li>No UI support for <merge>, <include>, <ViewStub> elements. You can add these elements to your manifest using the xml editor only.
</li>
<li>If a layout fails to render in a way that prevents the whole editor from opening, you can:
@@ -221,7 +221,7 @@
</li>
<li>The DDMS utility has been refactored into library form. This is not of direct interest to application developers, but may be of interest to vendors interested in integrating the Android SDK into their products. Watch for more information about the ddmlib library soon.
</li>
- <li>For performance and maintainability reasons, some APIs were moved into separate modules that must be explicitly included in the application via a directive in AndroidManifest.xml. Notable APIs that fall into this category are the MapView, and the java.awt.* classes, which each now reside in separate modules that must be imported. Developers who overlook this requirement will see ClassNotFoundExceptions that seem spurious.
+ <li>For performance and maintainability reasons, some APIs were moved into separate modules that must be explicitly included in the application via a directive in AndroidManifest.xml. Notable APIs that fall into this category are the MapView, and the java.awt.* classes, which each now reside in separate modules that must be imported. Developers who overlook this requirement will see ClassNotFoundExceptions that seem spurious.
</li>
<li>Developers who use 'adb push' to install applications must now use 'adb install', since the full package manager is now implemented. 'adb push' will no longer work to install .apk files.
</li>
@@ -386,14 +386,14 @@
<h4>Emulator Console</h4>
<ul>
-<li>Now provides support for emulating inbound SMS messages. The ADT plugin and DDMS provide integrated access to
-this capability. For more information about how to emulate inbound SMS from the console,
+<li>Now provides support for emulating inbound SMS messages. The ADT plugin and DDMS provide integrated access to
+this capability. For more information about how to emulate inbound SMS from the console,
see <a href="{@docRoot}tools/help/emulator.html#sms">SMS Emulation</a>. </li>
</ul>
<h4>Emulator</h4>
-<ul><li>The default emulator skin has been changed to HVGA-P from QVGA-L. For information
-about emulator skins and how to load a specific skin when starting the emulator, see
+<ul><li>The default emulator skin has been changed to HVGA-P from QVGA-L. For information
+about emulator skins and how to load a specific skin when starting the emulator, see
<a href="{@docRoot}tools/help/emulator.html#skins">Using Emulator Skins</a>.</li>
</ul>
diff --git a/docs/html/sdk/RELEASENOTES.jd b/docs/html/sdk/RELEASENOTES.jd
index 8f124a5..d9df406 100644
--- a/docs/html/sdk/RELEASENOTES.jd
+++ b/docs/html/sdk/RELEASENOTES.jd
@@ -64,13 +64,13 @@
<li>Emulator support for multiple screen sizes/densities, including new
skins. </li>
<li>Android SDK and AVD Manager, a graphical UI to let you manage your
-SDK and AVD environments more easily. The tool lets you create and manage
+SDK and AVD environments more easily. The tool lets you create and manage
your <a href="{@docRoot}tools/devices/managing-avds.html">Android Virtual
-Devices</a> and download new SDK packages (such as platform versions and
+Devices</a> and download new SDK packages (such as platform versions and
add-ons) into your environment.</li>
<li>Improved support for test packages in New Project Wizard</li>
- <li>The reference documentation now offers a "Filter by API Level"
-capability that lets you display only the parts of the API that are actually
+ <li>The reference documentation now offers a "Filter by API Level"
+capability that lets you display only the parts of the API that are actually
available to your application, based on the <code>android:minSdkVersion</code>
value the application declares in its manifest. For more information, see
<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API Levels</a></li>
@@ -114,7 +114,7 @@
<h3>Android SDK and AVD Manager</h3>
-<p>The SDK offers a new tool called Android SDK and AVD Manager that lets you
+<p>The SDK offers a new tool called Android SDK and AVD Manager that lets you
manage your SDK and AVD environments more efficiently. </p>
<p>Using the tool, you can quickly check what Android platforms, add-ons,
@@ -129,15 +129,15 @@
<p>The tool also lets you quickly create new AVDs, manage
their properties, and run a target AVD from a single window. </p>
-<p>If you are developing in Eclipse with ADT, you can access the Android SDK
+<p>If you are developing in Eclipse with ADT, you can access the Android SDK
and AVD Manager from the <strong>Window</strong> menu. </p>
-<p>If you are developing in another IDE, you can access the Android SDK and
+<p>If you are developing in another IDE, you can access the Android SDK and
AVD Manager through the <code>android</code> command-line tool, located in the
<sdk>/tools directory. You can launch the tool with a graphical UI by
using the <code>android</code> command without specifying any options. You can
also simply double-click the android.bat (Windows) or android (OS X/Linux) file.
-You can still use <code>android</code> commands to create and manage AVDs,
+You can still use <code>android</code> commands to create and manage AVDs,
including AVDs with custom hardware configurations.</p>
<h3>Integration with zipalign</h3>
@@ -160,9 +160,9 @@
<li>If you are developing in Eclipse with ADT, support for
<code>zipalign</code> is integrated into the Export Wizard. When you use the
Wizard to export a signed application package, ADT signs and then automatically
-runs <code>zipalign</code> against the exported package. If you use the Wizard
-to export an unsigned application package, then it will not zipalign the
-package because zipalign must be performed only after the APK has been signed.
+runs <code>zipalign</code> against the exported package. If you use the Wizard
+to export an unsigned application package, then it will not zipalign the
+package because zipalign must be performed only after the APK has been signed.
You must manually sign and zipalign the package after export. </li>
<li>If you are developing using Ant and are compiling in release mode, the
build tools will automatically sign and then <code>zipalign</code> the
@@ -182,14 +182,14 @@
<h3>Support for Test Packages in New Project Wizard</h3>
<p>The New Project Wizard available in the ADT 0.9.3 now lets you add a test
-package containing Instrumentation or other classes of tests while you are
+package containing Instrumentation or other classes of tests while you are
creating or importing a new Android application project. </p>
<h3>New USB Driver for Windows</h3>
<p>If you are using Windows and want to develop or test your application on an
Android-powered device (such as the T-Mobile G1), you need an appropriate USB
-driver.
+driver.
<p>The Windows version of the Android 1.6 SDK includes a new, WinUSB-based
driver that you can install. The driver is compatible with both 32- and 64-bit
@@ -241,19 +241,19 @@
<h2 id="1.5_r3">Android 1.5 SDK, Release 3</h2>
<p>Provides an updated Android 1.5 system image that includes permissions
-fixes, as described below, and a new application — an IME for Japanese
-text input. Also provides the same set of developer tools included in the
+fixes, as described below, and a new application — an IME for Japanese
+text input. Also provides the same set of developer tools included in the
previous SDK, but with bug fixes and several new features.</p>
<h3>Permissions Fixes</h3>
-<p>The latest version of the Android platform, deployable to
+<p>The latest version of the Android platform, deployable to
Android-powered devices, includes fixes to the permissions-checking
in certain areas of the framework. Specifically, the Android system
now properly checks and enforces several existing permissions where it
-did not do so in the previous release. Because of these changes in
-enforcement, you are strongly encouraged to test your application
-against the new Android 1.5 system image included in this SDK, to ensure
+did not do so in the previous release. Because of these changes in
+enforcement, you are strongly encouraged to test your application
+against the new Android 1.5 system image included in this SDK, to ensure
that it functions normally. </p>
<p>In particular, if your application uses any of the system areas listed below,
@@ -292,14 +292,14 @@
href="http://code.google.com/android/add-ons/google-apis">http://code.google.com/android/add-ons/google-apis</a> </p></li>
<li>The SDK add-on architecture now lets device manufacturers specify a USB
-Vendor ID in their add-ons.
+Vendor ID in their add-ons.
<li>The <code>android</code> tool provides a new command that scans SDK add-ons
for their USB Vendor IDs and makes them available to adb (OS X and Linux
versions of the SDK only). The command is <code>android update adb</code>. On
Windows versions of the SDK, a custom USB driver is included that supports the
"Google" and "HTC" Vendor IDs, which allow adb to recognize G1 and HTC
-Magic devices. For other devices, contact the device manufacturer
-to obtain a USB driver, especially if you have an SDK add-on that defines
+Magic devices. For other devices, contact the device manufacturer
+to obtain a USB driver, especially if you have an SDK add-on that defines
a new USB Vendor ID.</li>
<li>The telephony, sensor, and geo fix issues in the emulator are now
fixed.</li>
@@ -329,12 +329,12 @@
<ul>
<li>Multiple versions of the Android platform are included (Android 1.1,
Android 1.5). The tools are updated to let you deploy your application
-on any platform in the SDK, which helps you ensure forward-compatibility and,
+on any platform in the SDK, which helps you ensure forward-compatibility and,
if applicable, backward-compatibility.</li>
<li>Introduces <a href="{@docRoot}tools/devices/managing-avds.html">Android
Virtual Devices</a> — (AVD) configurations of options that you
run in the emulator to better model actual devices. Each AVD gets its
-own dedicated storage area, making it much easier to work with multiple emulators
+own dedicated storage area, making it much easier to work with multiple emulators
that are running concurrently.</li>
<li>Support for SDK add-ons, which extend the
Android SDK to give you access to one or more external Android libraries and/or
@@ -383,13 +383,13 @@
includes an external library, a system image, as well as custom emulator skins
and system properties. The add-on differs in that the Android platform it
provides may include customized UI, resources, or behaviors, a different set of
-preinstalled applications, or other similar modifications.
+preinstalled applications, or other similar modifications.
<p>The SDK includes a single SDK add-on — the Google APIs add-on. The
Google APIs add-on gives your application access to the com.google.android.maps
-external library that is included on many (if not most) Android-powered devices.
+external library that is included on many (if not most) Android-powered devices.
The Google APIs add-on also includes a {@link android.location.Geocoder Geocoder}
-backend service implementation. For more information, see the "Maps External
+backend service implementation. For more information, see the "Maps External
Library" section below. </p>
<h3>Android Virtual Devices (AVDs)</h3>
@@ -401,7 +401,7 @@
<li>Targets that represent core Android platform versions. </li>
<li>Targets that are SDK add-ons, which typically provide application access to
one or more external libraries and/or a customized (but compliant) system image
-that can run in the emulator.
+that can run in the emulator.
</ul>
<p>A new tool called "android" lets you discover what targets and AVDs are
@@ -427,7 +427,7 @@
<p>For your convenience, the Google APIs add-on is included in the SDK. </p>
-<p>For information about how to register for a Maps API Key, see
+<p>For information about how to register for a Maps API Key, see
<a href="http://code.google.com/android/add-ons/google-apis/mapkey.html">
Obtaining a Maps API Key</a>.</p>
@@ -566,8 +566,8 @@
for authentication to the server.</p>
<p>Developers should note that the registration service for MapView is now
-active and Google Maps is actively enforcing the Maps API Key requirement.
-For information about how to register for a Maps API Key, see
+active and Google Maps is actively enforcing the Maps API Key requirement.
+For information about how to register for a Maps API Key, see
<a href="http://code.google.com/android/add-ons/google-apis/mapkey.html">
Obtaining a Maps API Key</a>.</p>
@@ -615,21 +615,21 @@
<li>In some cases, you may encounter problems when using the browser on an
emulator started with the command-line option <code>-http-proxy</code>. </li>
<li>On the OSX platform, if you manually remove the ~/.android directory
-using <code>rm -rf ~/.android</code>, then try to run
-the emulator, it crashes. This happens because the emulator fails to create
+using <code>rm -rf ~/.android</code>, then try to run
+the emulator, it crashes. This happens because the emulator fails to create
a new .android directory before attempting to create the child SDK1.0 directory.
To work around this issue, manually create a new .android directory using
-<code>mkdir ~/.android</code>, then run the emulator. The emulator
+<code>mkdir ~/.android</code>, then run the emulator. The emulator
creates the SDK1.0 directory and starts normally. </li>
-<li>We regret to inform developers that Android 1.1 will not include support
+<li>We regret to inform developers that Android 1.1 will not include support
for ARCNet network interfaces.</li>
<li>The final set of Intent patterns honored by Android 1.0 has not yet been
fully documented. Documentation will be provided in future releases.</li>
<li>In ADT Editor, you can add at most ten new resource values at a time,
-in a given res/values/*.xml, using the form in the Android Resources pane.
+in a given res/values/*.xml, using the form in the Android Resources pane.
If you add more than ten, the Android Resources pane will not display the
-attributes fields for the additional resource entries. To work around this
-problem, you can close the file in the editor and open it again, or you
+attributes fields for the additional resource entries. To work around this
+problem, you can close the file in the editor and open it again, or you
can edit the resource entries in the XML text mode. </li>
<li>The emulator's battery-control commands (<code>power <option></code>)
are not working in this release.</li>
@@ -657,7 +657,7 @@
<p><strong>T-Mobile G1 Compatibility</strong></p>
-<p>This version of the SDK has been tested for compatibility with the first
+<p>This version of the SDK has been tested for compatibility with the first
Android-powered mobile device, the T-Mobile
G1. </p>
@@ -679,7 +679,7 @@
Android-powered device (such as the T-Mobile G1), you need an appropriate USB
driver. For your convenience, the Windows version of the Android SDK includes a
USB driver that you can install, to let you develop on the device. The USB
-driver files are located in the <code><SDK>/usb_driver</code> directory.
+driver files are located in the <code><SDK>/usb_driver</code> directory.
</p>
@@ -694,23 +694,23 @@
still access the platform's styleable attributes from your resources or code. To
do so, declare a custom resource element using a
<code><declare-styleable></code> in your project's res/values/R.attrs
-file, then declare the attribute inside. For examples, see
+file, then declare the attribute inside. For examples, see
<sdk>/samples/ApiDemos/res/values/attrs.xml. For more information about
custom resources, see <a
href="{@docRoot}guide/topics/resources/available-resources.html#customresources">Custom
Layout Resources</a>. Note that the android.R.styleable documentation is still
provided in the SDK, but only as a reference of the platform's styleable
attributes for the various elements.</li>
-<li>The VM now properly ensures that private classes are not
+<li>The VM now properly ensures that private classes are not
available to applications through reflection. If you were using reflection
-to access private classes in a previous release, you will now get a run-time
+to access private classes in a previous release, you will now get a run-time
error. </li>
<li>The Settings and Email applications are now included in the SDK and
available in the emulator.</li>
-<li>We regret to inform developers that SDK 1.0_r2 does not support MFM, RLL,
+<li>We regret to inform developers that SDK 1.0_r2 does not support MFM, RLL,
or Winchester hard disk drives.</li>
-<li>In the emulator, the control key for enabling/disabling trackball mode
+<li>In the emulator, the control key for enabling/disabling trackball mode
is changed from Control-T to F6. You can also enter trackball mode temporarily
using the Delete key. While the key is pressed, you can send trackball events.</li>
</ul>
@@ -783,19 +783,19 @@
<li>We regret to inform developers that Android 1.0 will not include support for
dot-matrix printers.</li>
<li>On the OSX platform, if you manually remove the ~/.android directory
-using <code>rm -rf ~/.android</code>, then try to run
-the emulator, it crashes. This happens because the emulator fails to create
+using <code>rm -rf ~/.android</code>, then try to run
+the emulator, it crashes. This happens because the emulator fails to create
a new .android directory before attempting to create the child SDK1.0 directory.
To work around this issue, manually create a new .android directory using
-<code>mkdir ~/.android</code>, then run the emulator. The emulator
+<code>mkdir ~/.android</code>, then run the emulator. The emulator
creates the SDK1.0 directory and starts normally. </li>
<li>The final set of Intent patterns honored by Android 1.0 has not yet been
fully documented. Documentation will be provided in future releases.</li>
<li>In ADT Editor, you can add at most ten new resource values at a time,
-in a given res/values/*.xml, using the form in the Android Resources pane.
+in a given res/values/*.xml, using the form in the Android Resources pane.
If you add more than ten, the Android Resources pane will not display the
-attributes fields for the additional resource entries. To work around this
-problem, you can close the file in the editor and open it again, or you
+attributes fields for the additional resource entries. To work around this
+problem, you can close the file in the editor and open it again, or you
can edit the resource entries in the XML text mode. </li>
<li>The emulator's battery-control commands (<code>power <option></code>)
are not working in this release.</li>
diff --git a/docs/html/sdk/older_releases.jd b/docs/html/sdk/older_releases.jd
index bb64feb..c4ed594 100644
--- a/docs/html/sdk/older_releases.jd
+++ b/docs/html/sdk/older_releases.jd
@@ -74,7 +74,7 @@
<td>238224860 bytes</td>
<td>b4bf0e610ff6db2fb6fb09c49cba1e79</td>
</tr>
-
+
</table>
@@ -119,7 +119,7 @@
<td>178117561 bytes</td>
<td>350d0211678ced38da926b8c9ffa4fac</td>
</tr>
-
+
</table>
@@ -167,7 +167,7 @@
<td>79345522 bytes</td>
<td>ebcb16b0cd4aef198b4dd9a1418efbf1</td>
</tr>
-
+
</table>
@@ -215,7 +215,7 @@
<td>94186463 bytes</td>
<td>a1f3b6d854596f850f5008856d0f380e</td>
</tr>
-
+
</table>
@@ -268,7 +268,7 @@
<td>165035130 bytes</td>
<td>1d3c3d099e95a31c43a7b3e6ae307ed3</td>
</tr>
-
+
</table>
@@ -313,7 +313,7 @@
<td>162938845 bytes</td>
<td>2addfd315da0ad8b5bde6b09d5ff3b06</td>
</tr>
-
+
</table>
@@ -358,7 +358,7 @@
<td>87.8 MB bytes</td>
<td>2660b4029039b7d714e59827e9a9a11d</td>
</tr>
-
+
</table>
diff --git a/docs/html/topic/libraries/data-binding/index.jd b/docs/html/topic/libraries/data-binding/index.jd
index 293de51..ec6e58c 100644
--- a/docs/html/topic/libraries/data-binding/index.jd
+++ b/docs/html/topic/libraries/data-binding/index.jd
@@ -515,8 +515,8 @@
<h5>Avoid Complex Listeners</h5>
Listener expressions are very powerful and can make your code very easy to read.
-On the other hand, listeners containing complex expressions make your layouts hard to read and unmaintainable.
-These expressions should be as simple as passing available data from your UI to your callback method. You should implement
+On the other hand, listeners containing complex expressions make your layouts hard to read and unmaintainable.
+These expressions should be as simple as passing available data from your UI to your callback method. You should implement
any business logic inside the callback method that you invoked from the listener expression.
<p>
diff --git a/docs/html/topic/performance/optimizing-view-hierarchies.jd b/docs/html/topic/performance/optimizing-view-hierarchies.jd
index 1738acb..27d3d16 100644
--- a/docs/html/topic/performance/optimizing-view-hierarchies.jd
+++ b/docs/html/topic/performance/optimizing-view-hierarchies.jd
@@ -381,7 +381,7 @@
<p>
For example, you may find that a {@link android.widget.TableLayout}
provides the same functionality as a more complex layout with many
-positional dependencies. In the N release of Android, the
+positional dependencies. In the N release of Android, the
<a
href="http://tools.android.com/tech-docs/layout-editor">{@code ConstraintLayout}</a> class provides similar functionality to
{@link android.widget.RelativeLayout}, but at a significantly lower cost.
diff --git a/docs/html/topic/performance/scheduling.jd b/docs/html/topic/performance/scheduling.jd
index b6f0fdc..c11cf9b 100644
--- a/docs/html/topic/performance/scheduling.jd
+++ b/docs/html/topic/performance/scheduling.jd
@@ -264,7 +264,7 @@
Internet-connectivity detection problems. A library or API may think the
Internet is available, but your service may not be accessible. Fail
gracefully and reschedule as few of your tasks as possible.</li>
- <li>Depending on the conditions you assign for running a task,
+ <li>Depending on the conditions you assign for running a task,
such as network availability, after the task is triggered, a
change may occur so that those conditions are no longer met.
In such a case, your operation may fail unexpectedly and repeatedly.
diff --git a/docs/html/training/accessibility/accessible-app.jd b/docs/html/training/accessibility/accessible-app.jd
index dd26feb..54c185c 100644
--- a/docs/html/training/accessibility/accessible-app.jd
+++ b/docs/html/training/accessibility/accessible-app.jd
@@ -55,7 +55,7 @@
If you have a label that's likely not to change during the lifecycle of the
application (such as "Pause" or "Purchase"), you can add it via the XML layout,
by setting a UI element's <a
-
+
href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription"
>{@code android:contentDescription}</a> attribute, like in this
example:</p>
@@ -163,7 +163,7 @@
android.view.accessibility.AccessibilityEvent} reference documentation.
<p>As an example, if you want to extend an image view such that you can write
-captions by typing on the keyboard when it has focus, it makes sense to fire an
+captions by typing on the keyboard when it has focus, it makes sense to fire an
{@link android.view.accessibility.AccessibilityEvent#TYPE_VIEW_TEXT_CHANGED}
event, even though that's not normally built into image views. The code to
generate that event would look like this:</p>
diff --git a/docs/html/training/accessibility/service.jd b/docs/html/training/accessibility/service.jd
index 5b99c46..9935c97 100755
--- a/docs/html/training/accessibility/service.jd
+++ b/docs/html/training/accessibility/service.jd
@@ -67,7 +67,7 @@
<p>Like any other service, you also declare it in the manifest file.
Remember to specify that it handles the {@code android.accessibilityservice} intent,
-so that the service is called when applications fire an
+so that the service is called when applications fire an
{@link android.view.accessibility.AccessibilityEvent}.</p>
<pre>
diff --git a/docs/html/training/animation/screen-slide.jd b/docs/html/training/animation/screen-slide.jd
index a68d475..d953c07 100644
--- a/docs/html/training/animation/screen-slide.jd
+++ b/docs/html/training/animation/screen-slide.jd
@@ -218,7 +218,7 @@
position of the page on the screen, which is obtained from the <code>position</code> parameter
of the {@link android.support.v4.view.ViewPager.PageTransformer#transformPage transformPage()} method.</p>
-<p>The <code>position</code> parameter indicates where a given page is located relative to the center of the screen.
+<p>The <code>position</code> parameter indicates where a given page is located relative to the center of the screen.
It is a dynamic property that changes as the user scrolls through the pages. When a page fills the screen, its position value is <code>0</code>.
When a page is drawn just off the right side of the screen, its position value is <code>1</code>. If the user scrolls halfway between pages one and two, page one has a position of -0.5 and page two has a position of 0.5. Based on the position of the pages on the screen, you can create custom slide animations by setting page properties with methods such as {@link android.view.View#setAlpha setAlpha()}, {@link android.view.View#setTranslationX setTranslationX()}, or
{@link android.view.View#setScaleY setScaleY()}.</p>
diff --git a/docs/html/training/animation/zoom.jd b/docs/html/training/animation/zoom.jd
index 6a38e7d..60de70e 100644
--- a/docs/html/training/animation/zoom.jd
+++ b/docs/html/training/animation/zoom.jd
@@ -297,13 +297,13 @@
set.play(ObjectAnimator
.ofFloat(expandedImageView, View.X, startBounds.left))
.with(ObjectAnimator
- .ofFloat(expandedImageView,
+ .ofFloat(expandedImageView,
View.Y,startBounds.top))
.with(ObjectAnimator
- .ofFloat(expandedImageView,
+ .ofFloat(expandedImageView,
View.SCALE_X, startScaleFinal))
.with(ObjectAnimator
- .ofFloat(expandedImageView,
+ .ofFloat(expandedImageView,
View.SCALE_Y, startScaleFinal));
set.setDuration(mShortAnimationDuration);
set.setInterpolator(new DecelerateInterpolator());
diff --git a/docs/html/training/app-indexing/deep-linking.jd b/docs/html/training/app-indexing/deep-linking.jd
index 2c4a131..a68e5a3 100644
--- a/docs/html/training/app-indexing/deep-linking.jd
+++ b/docs/html/training/app-indexing/deep-linking.jd
@@ -69,7 +69,7 @@
<!-- Accepts URIs that begin with "example://gizmos” -->
<data android:scheme="example"
android:host="gizmos" />
-
+
</intent-filter>
</activity>
</pre>
diff --git a/docs/html/training/articles/perf-anr.jd b/docs/html/training/articles/perf-anr.jd
index bbebec5..2eda4fa 100644
--- a/docs/html/training/articles/perf-anr.jd
+++ b/docs/html/training/articles/perf-anr.jd
@@ -64,10 +64,10 @@
and Window Manager system services. Android will display the ANR dialog
for a particular application when it detects one of the following
conditions:</p>
-<ul>
- <li>No response to an input event (such as key press or screen touch events)
+<ul>
+ <li>No response to an input event (such as key press or screen touch events)
within 5 seconds.</li>
- <li>A {@link android.content.BroadcastReceiver BroadcastReceiver}
+ <li>A {@link android.content.BroadcastReceiver BroadcastReceiver}
hasn't finished executing within 10 seconds.</li>
</ul>
@@ -100,7 +100,7 @@
{@link android.os.AsyncTask#onProgressUpdate onProgressUpdate()} callback method. From your
implementation of {@link android.os.AsyncTask#onProgressUpdate onProgressUpdate()} (which
runs on the UI thread), you can notify the user. For example:</p>
-
+
<pre>
private class DownloadFilesTask extends AsyncTask<URL, Integer, Long> {
// Do the long-running work in here
@@ -127,14 +127,14 @@
}
}
</pre>
-
+
<p>To execute this worker thread, simply create an instance and
call {@link android.os.AsyncTask#execute execute()}:</p>
-
+
<pre>
new DownloadFilesTask().execute(url1, url2, url3);
</pre>
-
+
<p>Although it's more complicated than {@link android.os.AsyncTask}, you might want to instead
create your own {@link java.lang.Thread} or {@link android.os.HandlerThread} class. If you do,
@@ -143,7 +143,7 @@
android.os.Process#THREAD_PRIORITY_BACKGROUND}. If you don't set the thread to a lower priority
this way, then the thread could still slow down your app because it operates at the same priority
as the UI thread by default.</p>
-
+
<p>If you implement {@link java.lang.Thread} or {@link android.os.HandlerThread},
be sure that your UI thread does not block while waiting for the worker thread to
complete—do not call {@link java.lang.Thread#wait Thread.wait()} or
@@ -183,16 +183,16 @@
<li>If your application is doing work in the background in response to
user input, show that progress is being made (such as with a {@link
android.widget.ProgressBar} in your UI).</li>
-
+
<li>For games specifically, do calculations for moves in a worker
thread.</li>
-
+
<li>If your application has a time-consuming initial setup phase, consider
showing a splash screen or rendering the main view as quickly as possible, indicate that
loading is in progress and fill the information asynchronously. In either case, you should
indicate somehow that progress is being made, lest the user perceive that
the application is frozen.</li>
-
+
<li>Use performance tools such as <a href="{@docRoot}tools/help/systrace.html">Systrace</a>
and <a href="{@docRoot}tools/help/traceview.html">Traceview</a> to determine bottlenecks
in your app's responsiveness.</li>
diff --git a/docs/html/training/articles/perf-jni.jd b/docs/html/training/articles/perf-jni.jd
index 5a9fa1e..8d2fd9b 100644
--- a/docs/html/training/articles/perf-jni.jd
+++ b/docs/html/training/articles/perf-jni.jd
@@ -564,9 +564,9 @@
that looked through the weak globals table, the arguments, the locals
table, and the globals table in that order. The first time it found your
direct pointer, it would report that your reference was of the type it
- happened to be examining. This meant, for example, that if
+ happened to be examining. This meant, for example, that if
you called <code>GetObjectRefType</code> on a global jclass that happened
- to be the same as the jclass passed as an implicit argument to your static
+ to be the same as the jclass passed as an implicit argument to your static
native method, you'd get <code>JNILocalRefType</code> rather than
<code>JNIGlobalRefType</code>.
</ul>
diff --git a/docs/html/training/articles/smp.jd b/docs/html/training/articles/smp.jd
index 0b45987..a95931b 100644
--- a/docs/html/training/articles/smp.jd
+++ b/docs/html/training/articles/smp.jd
@@ -75,7 +75,7 @@
multiprocessor architectures. This document introduces issues that
can arise when writing code for symmetric multiprocessor systems in C, C++, and the Java
programming language (hereafter referred to simply as “Java” for the sake of
-brevity). It's intended as a primer for Android app developers, not as a complete
+brevity). It's intended as a primer for Android app developers, not as a complete
discussion on the subject. The focus is on the ARM CPU architecture.</p>
<p>If you’re in a hurry, you can skip the <a href="#theory">Theory</a> section
diff --git a/docs/html/training/articles/user-data-overview.jd b/docs/html/training/articles/user-data-overview.jd
index 8715d36..dc0df20 100644
--- a/docs/html/training/articles/user-data-overview.jd
+++ b/docs/html/training/articles/user-data-overview.jd
@@ -266,4 +266,4 @@
href="http://stackoverflow.com/questions/24374701/alternative-to-read-phone-state-permission-for-getting-notified-of-call">source</a>)</em></p>
<p>[2] <em>Using Personal Examples to Improve Risk Communication for Security and Privacy Decisions</em>, by M. Harbach, M. Hettig, S. Weber, and M. Smith. In Proceedings of ACM CHI 2014.</p>
<p>[3] <em>Modeling Users’ Mobile App Privacy Preferences: Restoring Usability in a Sea of Permission Settings</em>, by J. Lin B. Liu, N. Sadeh and J. Hong. In Proceedings of SOUPS 2014.</p>
-<p>[4] <em>Teens and Mobile Apps Privacy. (<a href="http://www.pewinternet.org/files/old-media/Files/Reports/2013/PIP_Teens%20and%20Mobile%20Apps%20Privacy.pdf">source</a>)</em></p>
+<p>[4] <em>Teens and Mobile Apps Privacy. (<a href="http://www.pewinternet.org/files/old-media/Files/Reports/2013/PIP_Teens%20and%20Mobile%20Apps%20Privacy.pdf">source</a>)</em></p>
diff --git a/docs/html/training/articles/user-data-permissions.jd b/docs/html/training/articles/user-data-permissions.jd
index edc7558..ace5f7f 100644
--- a/docs/html/training/articles/user-data-permissions.jd
+++ b/docs/html/training/articles/user-data-permissions.jd
@@ -56,7 +56,7 @@
see <a href="{@docRoot}training/permissions/index.html">Working with System Permissions</a>.
For best practices for working with unique identifiers, please see <a href=
"{@docRoot}training/articles/user-data-ids.html">Best Practices for
- Unique Identifiers</a>.
+ Unique Identifiers</a>.
</p>
<h2 id="tenets_of_working_with_android_permissions">Tenets of Working
diff --git a/docs/html/training/basics/activity-lifecycle/index.jd b/docs/html/training/basics/activity-lifecycle/index.jd
index afeab86..95ed21e 100644
--- a/docs/html/training/basics/activity-lifecycle/index.jd
+++ b/docs/html/training/basics/activity-lifecycle/index.jd
@@ -41,7 +41,7 @@
lifecycle. For instance, when your
activity starts for the first time, it comes to the foreground of the system and receives user
focus. During this process, the Android system calls a series of lifecycle methods on the
-activity in which you set up the user interface and other components. If the user performs an
+activity in which you set up the user interface and other components. If the user performs an
action that starts another activity or switches to another app, the system calls another set of
lifecycle methods on your activity as it moves into the background (where the activity is no
longer visible, but the instance and its state remains intact).</p>
@@ -57,7 +57,7 @@
user expects and does not consume system resources when your activity doesn't need them.</p>
<h2>Lessons</h2>
-
+
<dl>
<dt><b><a href="starting.html">Starting an Activity</a></b></dt>
<dd>Learn the basics about the activity lifecycle, how the user can launch your app, and how
@@ -70,5 +70,5 @@
<dt><b><a href="recreating.html">Recreating an Activity</a></b></dt>
<dd>Learn what happens when your activity is destroyed and how you can rebuild the activity
state when necessary.</dd>
-</dl>
+</dl>
diff --git a/docs/html/training/basics/activity-lifecycle/pausing.jd b/docs/html/training/basics/activity-lifecycle/pausing.jd
index 223e41a..7ca97aa 100644
--- a/docs/html/training/basics/activity-lifecycle/pausing.jd
+++ b/docs/html/training/basics/activity-lifecycle/pausing.jd
@@ -8,13 +8,13 @@
<div id="tb-wrapper">
<div id="tb">
-
+
<h2>This lesson teaches you to</h2>
<ol>
<li><a href="#Pause">Pause Your Activity</a></li>
<li><a href="#Resume">Resume Your Activity</a></li>
</ol>
-
+
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/components/activities.html">Activities</a>
@@ -32,7 +32,7 @@
</div>
</div>
-<p>During normal app use, the foreground activity is sometimes obstructed by other
+<p>During normal app use, the foreground activity is sometimes obstructed by other
visual components that cause the activity to <em>pause</em>. For example, when a semi-transparent
activity opens (such as one in the style of a dialog), the previous activity pauses. As long as the
activity is still partially visible but currently not the activity in focus, it remains paused.</p>
@@ -60,7 +60,7 @@
<h2 id="Pause">Pause Your Activity</h2>
-
+
<p>When the system calls {@link android.app.Activity#onPause()} for your activity, it
technically means your activity is still partially visible, but most often is an indication that
the user is leaving the activity and it will soon enter the Stopped state. You should usually use
diff --git a/docs/html/training/basics/activity-lifecycle/recreating.jd b/docs/html/training/basics/activity-lifecycle/recreating.jd
index a52d5fd..60a33774 100644
--- a/docs/html/training/basics/activity-lifecycle/recreating.jd
+++ b/docs/html/training/basics/activity-lifecycle/recreating.jd
@@ -8,13 +8,13 @@
<div id="tb-wrapper">
<div id="tb">
-
+
<h2>This lesson teaches you to</h2>
<ol>
<li><a href="#SaveState">Save Your Activity State</a></li>
<li><a href="#RestoreState">Restore Your Activity State</a></li>
</ol>
-
+
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}training/basics/supporting-devices/screens.html">Supporting
@@ -106,7 +106,7 @@
// Save the user's current game state
savedInstanceState.putInt(STATE_SCORE, mCurrentScore);
savedInstanceState.putInt(STATE_LEVEL, mCurrentLevel);
-
+
// Always call the superclass so it can save the view hierarchy state
super.onSaveInstanceState(savedInstanceState);
}
@@ -139,7 +139,7 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); // Always call the superclass first
-
+
// Check whether we're recreating a previously destroyed instance
if (savedInstanceState != null) {
// Restore value of members from saved state
@@ -158,12 +158,12 @@
after the {@link android.app.Activity#onStart()} method. The system calls {@link
android.app.Activity#onRestoreInstanceState onRestoreInstanceState()} only if there is a saved
state to restore, so you do not need to check whether the {@link android.os.Bundle} is null:</p>
-
+
<pre>
public void onRestoreInstanceState(Bundle savedInstanceState) {
// Always call the superclass so it can restore the view hierarchy
super.onRestoreInstanceState(savedInstanceState);
-
+
// Restore state members from saved instance
mCurrentScore = savedInstanceState.getInt(STATE_SCORE);
mCurrentLevel = savedInstanceState.getInt(STATE_LEVEL);
diff --git a/docs/html/training/basics/activity-lifecycle/starting.jd b/docs/html/training/basics/activity-lifecycle/starting.jd
index 5b238b8..06f3a6c 100644
--- a/docs/html/training/basics/activity-lifecycle/starting.jd
+++ b/docs/html/training/basics/activity-lifecycle/starting.jd
@@ -9,7 +9,7 @@
<div id="tb-wrapper">
<div id="tb">
-
+
<h2>This lesson teaches you to</h2>
<ol>
<li><a href="#lifecycle-states">Understand the Lifecycle Callbacks</a></li>
@@ -17,7 +17,7 @@
<li><a href="#Create">Create a New Instance</a></li>
<li><a href="#Destroy">Destroy the Activity</a></li>
</ol>
-
+
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/components/activities.html">Activities</a></li>
@@ -84,7 +84,7 @@
</ul>
<!--
-<p class="table-caption"><strong>Table 1.</strong> Activity lifecycle state pairs and callback
+<p class="table-caption"><strong>Table 1.</strong> Activity lifecycle state pairs and callback
methods.</p>
<table>
<tr>
@@ -139,7 +139,7 @@
-<h2 id="launching-activity">Specify Your App's Launcher Activity</h2>
+<h2 id="launching-activity">Specify Your App's Launcher Activity</h2>
<p>When the user selects your app icon from the Home screen, the system calls the {@link
android.app.Activity#onCreate onCreate()} method for the {@link android.app.Activity} in your app
@@ -154,7 +154,7 @@
href="{@docRoot}guide/topics/manifest/intent-filter-element.html">{@code
<intent-filter>}</a> that includes the {@link
android.content.Intent#ACTION_MAIN MAIN} action and
-{@link android.content.Intent#CATEGORY_LAUNCHER LAUNCHER} category. For example:</p>
+{@link android.content.Intent#CATEGORY_LAUNCHER LAUNCHER} category. For example:</p>
<pre>
<activity android:name=".MainActivity" android:label="@string/app_name">
@@ -203,10 +203,10 @@
// Set the user interface layout for this Activity
// The layout file is defined in the project res/layout/main_activity.xml file
setContentView(R.layout.main_activity);
-
+
// Initialize member TextView so we can manipulate it later
mTextView = (TextView) findViewById(R.id.text_message);
-
+
// Make sure we're running on Honeycomb or higher to use ActionBar APIs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// For the main activity, make sure the app icon in the action bar
@@ -271,7 +271,7 @@
@Override
public void onDestroy() {
super.onDestroy(); // Always call the superclass
-
+
// Stop method tracing that the activity started during onCreate()
android.os.Debug.stopMethodTracing();
}
diff --git a/docs/html/training/basics/activity-lifecycle/stopping.jd b/docs/html/training/basics/activity-lifecycle/stopping.jd
index 51c95ea..3246374 100644
--- a/docs/html/training/basics/activity-lifecycle/stopping.jd
+++ b/docs/html/training/basics/activity-lifecycle/stopping.jd
@@ -8,13 +8,13 @@
<div id="tb-wrapper">
<div id="tb">
-
+
<h2>This lesson teaches you to</h2>
<ol>
<li><a href="#Stop">Stop Your Activity</a></li>
<li><a href="#Start">Start/Restart Your Activity</a></li>
</ol>
-
+
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/components/activities.html">Activities</a>
@@ -154,13 +154,13 @@
@Override
protected void onStart() {
super.onStart(); // Always call the superclass method first
-
+
// The activity is either being restarted or started for the first time
// so this is where we should make sure that GPS is enabled
- LocationManager locationManager =
+ LocationManager locationManager =
(LocationManager) getSystemService(Context.LOCATION_SERVICE);
boolean gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
-
+
if (!gpsEnabled) {
// Create a dialog here that requests the user to enable GPS, and use an intent
// with the android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS action
@@ -171,8 +171,8 @@
@Override
protected void onRestart() {
super.onRestart(); // Always call the superclass method first
-
- // Activity being restarted from stopped state
+
+ // Activity being restarted from stopped state
}
</pre>
diff --git a/docs/html/training/basics/data-storage/databases.jd b/docs/html/training/basics/data-storage/databases.jd
index 4a91d0d..f42bf65 100644
--- a/docs/html/training/basics/data-storage/databases.jd
+++ b/docs/html/training/basics/data-storage/databases.jd
@@ -119,11 +119,11 @@
accessible to other applications.</p>
<p>A useful set of APIs is available in the {@link
-android.database.sqlite.SQLiteOpenHelper} class.
+android.database.sqlite.SQLiteOpenHelper} class.
When you use this class to obtain references to your database, the system
-performs the potentially
+performs the potentially
long-running operations of creating and updating the database only when
-needed and <em>not during app startup</em>. All you need to do is call
+needed and <em>not during app startup</em>. All you need to do is call
{@link android.database.sqlite.SQLiteOpenHelper#getWritableDatabase} or
{@link android.database.sqlite.SQLiteOpenHelper#getReadableDatabase}.</p>
diff --git a/docs/html/training/basics/fragments/communicating.jd b/docs/html/training/basics/fragments/communicating.jd
index 8c1ae21a..2e12072 100644
--- a/docs/html/training/basics/fragments/communicating.jd
+++ b/docs/html/training/basics/fragments/communicating.jd
@@ -7,14 +7,14 @@
@jd:body
<div id="tb-wrapper">
- <div id="tb">
+ <div id="tb">
<h2>This lesson teaches you to</h2>
<ol>
<li><a href="#DefineInterface">Define an Interface</a></li>
<li><a href="#Implement">Implement the Interface</a></li>
<li><a href="#Deliver">Deliver a Message to a Fragment</a></li>
</ol>
-
+
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/components/fragments.html">Fragments</a></li>
@@ -31,21 +31,21 @@
</div>
</div>
-<p>In order to reuse the Fragment UI components, you should build each as a completely
-self-contained, modular component that defines its own layout and behavior. Once you
-have defined these reusable Fragments, you can associate them with an Activity and
+<p>In order to reuse the Fragment UI components, you should build each as a completely
+self-contained, modular component that defines its own layout and behavior. Once you
+have defined these reusable Fragments, you can associate them with an Activity and
connect them with the application logic to realize the overall composite UI.</p>
-<p>Often you will want one Fragment to communicate with another, for example to change
-the content based on a user event. All Fragment-to-Fragment communication is done
+<p>Often you will want one Fragment to communicate with another, for example to change
+the content based on a user event. All Fragment-to-Fragment communication is done
through the associated Activity. Two Fragments should never communicate directly.</p>
<h2 id="DefineInterface">Define an Interface</h2>
-<p>To allow a Fragment to communicate up to its Activity, you can define an interface
-in the Fragment class and implement it within the Activity. The Fragment captures
-the interface implementation during its onAttach() lifecycle method and can then call
+<p>To allow a Fragment to communicate up to its Activity, you can define an interface
+in the Fragment class and implement it within the Activity. The Fragment captures
+the interface implementation during its onAttach() lifecycle method and can then call
the Interface methods in order to communicate with the Activity.</p>
<p>Here is an example of Fragment to Activity communication:</p>
@@ -62,7 +62,7 @@
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
-
+
// This makes sure that the container activity has implemented
// the callback interface. If not, it throws an exception
try {
@@ -72,7 +72,7 @@
+ " must implement OnHeadlineSelectedListener");
}
}
-
+
...
}
</pre>
@@ -105,7 +105,7 @@
public static class MainActivity extends Activity
implements HeadlinesFragment.OnHeadlineSelectedListener{
...
-
+
public void onArticleSelected(int position) {
// The user selected the headline of an article from the HeadlinesFragment
// Do something here to display that article
@@ -118,12 +118,12 @@
<h2 id="Deliver">Deliver a Message to a Fragment</h2>
<p>The host activity can deliver messages to a fragment by capturing the {@link
-android.support.v4.app.Fragment} instance
+android.support.v4.app.Fragment} instance
with {@link android.support.v4.app.FragmentManager#findFragmentById findFragmentById()}, then
directly call the fragment's public methods.</p>
<p>For instance, imagine that the activity shown above may contain another fragment that's used to
-display the item specified by the data returned in the above callback method. In this case,
+display the item specified by the data returned in the above callback method. In this case,
the activity can pass the information received in the callback method to the other fragment that
will display the item:</p>
@@ -152,7 +152,7 @@
Bundle args = new Bundle();
args.putInt(ArticleFragment.ARG_POSITION, position);
newFragment.setArguments(args);
-
+
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// Replace whatever is in the fragment_container view with this fragment,
diff --git a/docs/html/training/basics/fragments/fragment-ui.jd b/docs/html/training/basics/fragments/fragment-ui.jd
index c0bd0a4..4cfec76 100644
--- a/docs/html/training/basics/fragments/fragment-ui.jd
+++ b/docs/html/training/basics/fragments/fragment-ui.jd
@@ -7,13 +7,13 @@
@jd:body
<div id="tb-wrapper">
- <div id="tb">
+ <div id="tb">
<h2>This lesson teaches you to</h2>
<ol>
<li><a href="#AddAtRuntime">Add a Fragment to an Activity at Runtime</a></li>
<li><a href="#Replace">Replace One Fragment with Another</a></li>
</ol>
-
+
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/components/fragments.html">Fragments</a></li>
@@ -52,14 +52,14 @@
-<h2 id="AddAtRuntime">Add a Fragment to an Activity at Runtime</h2>
+<h2 id="AddAtRuntime">Add a Fragment to an Activity at Runtime</h2>
<p>Rather than defining the fragments for an activity in the layout file—as shown in the
<a href="creating.html">previous lesson</a> with the {@code <fragment>} element—you can add
a fragment to the activity during the activity runtime. This is necessary
if you plan to change fragments during the life of the activity.</p>
-<p>To perform a transaction such as add or
+<p>To perform a transaction such as add or
remove a fragment, you must use the {@link android.support.v4.app.FragmentManager} to create a
{@link android.support.v4.app.FragmentTransaction}, which provides APIs to add, remove, replace,
and perform other fragment transactions.</p>
@@ -126,11 +126,11 @@
// Create a new Fragment to be placed in the activity layout
HeadlinesFragment firstFragment = new HeadlinesFragment();
-
+
// In case this activity was started with special instructions from an
// Intent, pass the Intent's extras to the fragment as arguments
firstFragment.setArguments(getIntent().getExtras());
-
+
// Add the fragment to the 'fragment_container' FrameLayout
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, firstFragment).commit();
diff --git a/docs/html/training/basics/fragments/index.jd b/docs/html/training/basics/fragments/index.jd
index aba6459..4fb71e4 100644
--- a/docs/html/training/basics/fragments/index.jd
+++ b/docs/html/training/basics/fragments/index.jd
@@ -56,7 +56,7 @@
devices running versions as old as Android 1.6.</p>
<h2>Lessons</h2>
-
+
<dl>
<dt><b><a href="creating.html">Creating a Fragment</a></b></dt>
<dd>Learn how to build a fragment and implement basic behaviors within its callback
@@ -67,5 +67,5 @@
<dt><b><a href="communicating.html">Communicating with Other Fragments</a></b></dt>
<dd>Learn how to set up communication paths from a fragment to the activity and other
fragments.</dd>
-</dl>
+</dl>
diff --git a/docs/html/training/basics/network-ops/connecting.jd b/docs/html/training/basics/network-ops/connecting.jd
index 798a9ee7..9651269 100644
--- a/docs/html/training/basics/network-ops/connecting.jd
+++ b/docs/html/training/basics/network-ops/connecting.jd
@@ -7,8 +7,8 @@
next.link=managing.html
@jd:body
-
-<div id="tb-wrapper">
+
+<div id="tb-wrapper">
<div id="tb">
@@ -20,7 +20,7 @@
<li><a href="#AsyncTask">Perform Network Operations on a Separate Thread</a></li>
<li><a href="#download">Connect and Download Data</a></li>
<li><a href="#stream">Convert the InputStream to a String</a></li>
-
+
</ol>
<h2>You should also read</h2>
@@ -32,7 +32,7 @@
<li><a href="{@docRoot}guide/components/fundamentals.html">Application Fundamentals</a></li>
</ul>
-</div>
+</div>
</div>
<p>This lesson shows you how to implement a simple application that connects to
@@ -57,11 +57,11 @@
<h2 id="connection">Check the Network Connection</h2>
<p>Before your app attempts to connect to the network, it should check to see whether a
-network connection is available using
+network connection is available using
{@link android.net.ConnectivityManager#getActiveNetworkInfo getActiveNetworkInfo()}
-and {@link android.net.NetworkInfo#isConnected isConnected()}.
+and {@link android.net.NetworkInfo#isConnected isConnected()}.
Remember, the device may be out of range of a
-network, or the user may have disabled both Wi-Fi and mobile data access.
+network, or the user may have disabled both Wi-Fi and mobile data access.
For more discussion of this topic, see the lesson <a
href="{@docRoot}training/basics/network-ops/managing.html">Managing Network
Usage</a>.</p>
@@ -69,7 +69,7 @@
<pre>
public void myClickHandler(View view) {
...
- ConnectivityManager connMgr = (ConnectivityManager)
+ ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
@@ -98,28 +98,28 @@
{@link android.os.AsyncTask} methods:</p>
<ul>
-
+
<li>{@link android.os.AsyncTask#doInBackground doInBackground()} executes
the method <code>downloadUrl()</code>. It passes the web page URL as a
parameter. The method <code>downloadUrl()</code> fetches and processes the web
page content. When it finishes, it passes back a result string.</li>
-
+
<li>{@link android.os.AsyncTask#onPostExecute onPostExecute()} takes the
returned string and displays it in the UI.</li>
-
-
+
+
</ul>
-
+
<pre>
public class HttpExampleActivity extends Activity {
private static final String DEBUG_TAG = "HttpExample";
private EditText urlText;
private TextView textView;
-
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
+ setContentView(R.layout.main);
urlText = (EditText) findViewById(R.id.myUrl);
textView = (TextView) findViewById(R.id.myText);
}
@@ -129,7 +129,7 @@
public void myClickHandler(View view) {
// Gets the URL from the UI's text field.
String stringUrl = urlText.getText().toString();
- ConnectivityManager connMgr = (ConnectivityManager)
+ ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
@@ -139,7 +139,7 @@
}
}
- // Uses AsyncTask to create a task away from the main UI thread. This task takes a
+ // Uses AsyncTask to create a task away from the main UI thread. This task takes a
// URL string and uses it to create an HttpUrlConnection. Once the connection
// has been established, the AsyncTask downloads the contents of the webpage as
// an InputStream. Finally, the InputStream is converted into a string, which is
@@ -147,7 +147,7 @@
private class DownloadWebpageTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
-
+
// params comes from the execute() call: params[0] is the url.
try {
return downloadUrl(urls[0]);
@@ -167,28 +167,28 @@
<p>The sequence of events in this snippet is as follows:</p>
<ol>
- <li>When users click the button that invokes {@code myClickHandler()},
+ <li>When users click the button that invokes {@code myClickHandler()},
the app passes
the specified URL to the {@link android.os.AsyncTask} subclass
<code>DownloadWebpageTask</code>.</li>
-
+
<li>The {@link android.os.AsyncTask} method {@link
-android.os.AsyncTask#doInBackground doInBackground()} calls the
+android.os.AsyncTask#doInBackground doInBackground()} calls the
<code>downloadUrl()</code> method. </li>
-
+
<li>The <code>downloadUrl()</code> method takes a URL string as a parameter
and uses it to create a {@link java.net.URL} object.</li>
-
+
<li>The {@link java.net.URL} object is used to establish an {@link
java.net.HttpURLConnection}.</li>
-
+
<li>Once the connection has been established, the {@link
java.net.HttpURLConnection} object fetches the web page content as an {@link
java.io.InputStream}.</li>
-
+
<li>The {@link java.io.InputStream} is passed to the <code>readIt()</code>
method, which converts the stream to a string.</li>
-
+
<li>Finally, the {@link android.os.AsyncTask}'s {@link
android.os.AsyncTask#onPostExecute onPostExecute()} method displays the string
in the main activity's UI.</li>
@@ -196,19 +196,19 @@
</ol>
<h2 id="download">Connect and Download Data</h2>
-
- <p>In your thread that performs your network transactions, you can use
- {@link java.net.HttpURLConnection} to perform a {@code GET} and download your data.
- After you call {@code connect()}, you can get an {@link java.io.InputStream} of the data
+
+ <p>In your thread that performs your network transactions, you can use
+ {@link java.net.HttpURLConnection} to perform a {@code GET} and download your data.
+ After you call {@code connect()}, you can get an {@link java.io.InputStream} of the data
by calling {@code getInputStream()}.
-
+
<p>In the following snippet, the {@link android.os.AsyncTask#doInBackground
doInBackground()} method calls the method <code>downloadUrl()</code>. The
<code>downloadUrl()</code> method takes the given URL and uses it to connect to
the network via {@link java.net.HttpURLConnection}. Once a connection has been
established, the app uses the method <code>getInputStream()</code> to retrieve
the data as an {@link java.io.InputStream}.</p>
-
+
<pre>
// Given a URL, establishes an HttpUrlConnection and retrieves
// the web page content as a InputStream, which it returns as
@@ -218,7 +218,7 @@
// Only display the first 500 characters of the retrieved
// web page content.
int len = 500;
-
+
try {
URL url = new URL(myurl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
@@ -235,13 +235,13 @@
// Convert the InputStream into a string
String contentAsString = readIt(is, len);
return contentAsString;
-
+
// Makes sure that the InputStream is closed after the app is
// finished using it.
} finally {
if (is != null) {
is.close();
- }
+ }
}
}</pre>
@@ -252,7 +252,7 @@
<h2 id="stream">Convert the InputStream to a String</h2>
-<p>An {@link java.io.InputStream} is a readable source of bytes. Once you get an {@link java.io.InputStream},
+<p>An {@link java.io.InputStream} is a readable source of bytes. Once you get an {@link java.io.InputStream},
it's common to decode or convert it into a
target data type. For example, if you were downloading image data, you might
decode and display it like this:</p>
@@ -271,7 +271,7 @@
<pre>// Reads an InputStream and converts it to a String.
public String readIt(InputStream stream, int len) throws IOException, UnsupportedEncodingException {
Reader reader = null;
- reader = new InputStreamReader(stream, "UTF-8");
+ reader = new InputStreamReader(stream, "UTF-8");
char[] buffer = new char[len];
reader.read(buffer);
return new String(buffer);
diff --git a/docs/html/training/basics/network-ops/index.jd b/docs/html/training/basics/network-ops/index.jd
index 1f6493f..1434562 100644
--- a/docs/html/training/basics/network-ops/index.jd
+++ b/docs/html/training/basics/network-ops/index.jd
@@ -42,7 +42,7 @@
<p>This class explains the basic tasks involved in connecting to the network,
monitoring the network connection (including connection changes), and giving
users control over an app's network usage. It also describes how to parse and
-consume XML data.</p>
+consume XML data.</p>
<p>This class includes a sample application that illustrates how to perform
common network operations. You can download the sample (to the right) and use it
@@ -66,18 +66,18 @@
<dl>
<dt><b><a href="connecting.html">Connecting to the Network</a></b></dt>
-
+
<dd>Learn how to connect to the network, choose an HTTP client, and perform
network operations outside of the UI thread.</dd>
<dt><b><a href="managing.html">Managing Network Usage</a></b></dt>
-
+
<dd>Learn how to check a
device's network connection, create a preferences UI for controlling network
usage, and respond to connection changes.</dd>
-
+
<dt><b><a href="xml.html">Parsing XML Data</a></b></dt>
<dd>Learn how to parse and consume XML data.</dd>
-</dl>
+</dl>
diff --git a/docs/html/training/basics/network-ops/managing.jd b/docs/html/training/basics/network-ops/managing.jd
index a645b3f..2609db5 100644
--- a/docs/html/training/basics/network-ops/managing.jd
+++ b/docs/html/training/basics/network-ops/managing.jd
@@ -10,8 +10,8 @@
next.link=xml.html
@jd:body
-
-<div id="tb-wrapper">
+
+<div id="tb-wrapper">
<div id="tb">
<h2>This lesson teaches you to</h2>
@@ -37,7 +37,7 @@
<p class="filename">NetworkUsage.zip</p>
</div>
-</div>
+</div>
</div>
<p>This lesson describes how to write applications that have fine-grained
@@ -50,19 +50,19 @@
limits, because they can instead precisely control how much data your app
uses.</p>
-<p>For general guidelines on how to write apps that minimize the battery life
-impact of downloads and network connections, see
-<a href="{@docRoot}training/monitoring-device-state/index.html">Optimizing Battery Life</a>
+<p>For general guidelines on how to write apps that minimize the battery life
+impact of downloads and network connections, see
+<a href="{@docRoot}training/monitoring-device-state/index.html">Optimizing Battery Life</a>
and <a href="{@docRoot}training/efficient-downloads/index.html">Transferring Data Without Draining the Battery</a>.
<h2 id="check-connection">Check a Device's Network Connection</h2>
-<p>A device can have various types of network connections. This lesson
-focuses on using either a Wi-Fi or a mobile network connection. For the full
+<p>A device can have various types of network connections. This lesson
+focuses on using either a Wi-Fi or a mobile network connection. For the full
list of possible network types, see {@link android.net.ConnectivityManager}.<p>
<p>Wi-Fi is typically faster. Also, mobile data is often metered, which can get
-expensive.
+expensive.
A common strategy for apps is to only fetch large data
if a Wi-Fi network is available.</p>
@@ -77,11 +77,11 @@
<li>{@link android.net.ConnectivityManager}: Answers queries about the state
of network connectivity. It also notifies applications when network
connectivity changes. </li>
-
+
<li>{@link android.net.NetworkInfo}: Describes the status of a network
interface of a given type (currently either Mobile or Wi-Fi).
</li>
-
+
</ul>
@@ -94,16 +94,16 @@
<pre>
private static final String DEBUG_TAG = "NetworkStatusExample";
-...
-ConnectivityManager connMgr = (ConnectivityManager)
+...
+ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
-NetworkInfo networkInfo = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
+NetworkInfo networkInfo = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
boolean isWifiConn = networkInfo.isConnected();
networkInfo = connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
boolean isMobileConn = networkInfo.isConnected();
Log.d(DEBUG_TAG, "Wifi connected: " + isWifiConn);
Log.d(DEBUG_TAG, "Mobile connected: " + isMobileConn);
-</pre>
+</pre>
<p>Note that you should not base decisions on whether a network is
"available." You should always check {@link
@@ -122,7 +122,7 @@
<pre>
public boolean isOnline() {
- ConnectivityManager connMgr = (ConnectivityManager)
+ ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
@@ -148,37 +148,37 @@
</ul>
-<p>To write an app that supports network access and managing
-network usage, your manifest must have the right permissions and
+<p>To write an app that supports network access and managing
+network usage, your manifest must have the right permissions and
intent filters.
</p>
<ul>
<li>The manifest excerpted below includes the following permissions:
<ul>
-
+
<li>{@link android.Manifest.permission#INTERNET
android.permission.INTERNET}—Allows applications to open network
sockets.</li>
-
+
<li>{@link android.Manifest.permission#ACCESS_NETWORK_STATE
android.permission.ACCESS_NETWORK_STATE}—Allows applications to access
information about networks.</li>
-
+
</ul>
</li>
-
- <li>You can declare the intent filter for the
+
+ <li>You can declare the intent filter for the
{@link android.content.Intent#ACTION_MANAGE_NETWORK_USAGE} action (introduced in
Android 4.0) to indicate that your application defines an activity that offers
options to control data usage. {@link
android.content.Intent#ACTION_MANAGE_NETWORK_USAGE} shows settings for managing
-the network data usage of a specific application. When your app has a settings activity
-that allows users to control network usage, you should declare this intent filter for that activity.
+the network data usage of a specific application. When your app has a settings activity
+that allows users to control network usage, you should declare this intent filter for that activity.
In the sample application, this action is handled by the class
<code>SettingsActivity</code>, which displays a preferences UI to let users
decide when to download a feed.</li>
-
+
</ul>
@@ -188,9 +188,9 @@
package="com.example.android.networkusage"
...>
- <uses-sdk android:minSdkVersion="4"
+ <uses-sdk android:minSdkVersion="4"
android:targetSdkVersion="14" />
-
+
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@@ -213,7 +213,7 @@
<code>SettingsActivity</code> has an intent filter for the {@link
android.content.Intent#ACTION_MANAGE_NETWORK_USAGE} action.
<code>SettingsActivity</code> is a subclass of {@link
-android.preference.PreferenceActivity}. It displays a preferences screen
+android.preference.PreferenceActivity}. It displays a preferences screen
(shown in figure 1) that
lets users specify the following:</p>
@@ -221,10 +221,10 @@
<li>Whether to display summaries for each XML feed entry, or just a link for
each entry.</li>
-
+
<li>Whether to download the XML feed if any network connection is available,
or only if Wi-Fi is available.</li>
-
+
</ul>
<img src="{@docRoot}images/training/basics/network-settings1.png" alt="Preferences panel" />
@@ -232,49 +232,49 @@
<img src="{@docRoot}images/training/basics/network-settings2.png" alt="Setting a network preference" />
<p class="img-caption"><strong>Figure 1.</strong> Preferences activity.</p>
-<p>Here is <code>SettingsActivity</code>. Note that it implements
-{@link android.content.SharedPreferences.OnSharedPreferenceChangeListener OnSharedPreferenceChangeListener}.
+<p>Here is <code>SettingsActivity</code>. Note that it implements
+{@link android.content.SharedPreferences.OnSharedPreferenceChangeListener OnSharedPreferenceChangeListener}.
When a user changes a preference, it fires
-{@link android.content.SharedPreferences.OnSharedPreferenceChangeListener#onSharedPreferenceChanged onSharedPreferenceChanged()},
-which sets {@code refreshDisplay} to true. This causes the display to refresh when the user
+{@link android.content.SharedPreferences.OnSharedPreferenceChangeListener#onSharedPreferenceChanged onSharedPreferenceChanged()},
+which sets {@code refreshDisplay} to true. This causes the display to refresh when the user
returns to the main activity:</p>
<pre>public class SettingsActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener {
-
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
+
// Loads the XML preferences file
addPreferencesFromResource(R.xml.preferences);
}
-
+
@Override
protected void onResume() {
super.onResume();
- // Registers a listener whenever a key changes
+ // Registers a listener whenever a key changes
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
}
-
+
@Override
protected void onPause() {
super.onPause();
// Unregisters the listener set in onResume().
- // It's best practice to unregister listeners when your app isn't using them to cut down on
- // unnecessary system overhead. You do this in onPause().
- getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
+ // It's best practice to unregister listeners when your app isn't using them to cut down on
+ // unnecessary system overhead. You do this in onPause().
+ getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
}
-
- // When the user changes the preferences selection,
+
+ // When the user changes the preferences selection,
// onSharedPreferenceChanged() restarts the main activity as a new
// task. Sets the refreshDisplay flag to "true" to indicate that
// the main activity should update its display.
// The main activity queries the PreferenceManager to get the latest settings.
-
+
@Override
- public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
// Sets refreshDisplay to true so that when the user returns to the main
// activity, the display refreshes to reflect the new settings.
NetworkActivity.refreshDisplay = true;
@@ -295,31 +295,31 @@
public static final String WIFI = "Wi-Fi";
public static final String ANY = "Any";
private static final String URL = "http://stackoverflow.com/feeds/tag?tagnames=android&sort=newest";
-
+
// Whether there is a Wi-Fi connection.
- private static boolean wifiConnected = false;
+ private static boolean wifiConnected = false;
// Whether there is a mobile connection.
private static boolean mobileConnected = false;
// Whether the display should be refreshed.
public static boolean refreshDisplay = true;
-
+
// The user's current network preference setting.
public static String sPref = null;
-
+
// The BroadcastReceiver that tracks network connectivity changes.
private NetworkReceiver receiver = new NetworkReceiver();
-
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
+
// Registers BroadcastReceiver to track network connection changes.
IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
receiver = new NetworkReceiver();
this.registerReceiver(receiver, filter);
}
-
- @Override
+
+ @Override
public void onDestroy() {
super.onDestroy();
// Unregisters BroadcastReceiver when app is destroyed.
@@ -327,34 +327,34 @@
this.unregisterReceiver(receiver);
}
}
-
+
// Refreshes the display if the network connection and the
// pref settings allow it.
-
+
@Override
public void onStart () {
- super.onStart();
-
+ super.onStart();
+
// Gets the user's network preference settings
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
-
+
// Retrieves a string value for the preferences. The second parameter
// is the default value to use if a preference value is not found.
sPref = sharedPrefs.getString("listPref", "Wi-Fi");
- updateConnectedFlags();
-
+ updateConnectedFlags();
+
if(refreshDisplay){
- loadPage();
+ loadPage();
}
}
-
+
// Checks the network connection and sets the wifiConnected and mobileConnected
- // variables accordingly.
+ // variables accordingly.
public void updateConnectedFlags() {
- ConnectivityManager connMgr = (ConnectivityManager)
+ ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
-
+
NetworkInfo activeInfo = connMgr.getActiveNetworkInfo();
if (activeInfo != null && activeInfo.isConnected()) {
wifiConnected = activeInfo.getType() == ConnectivityManager.TYPE_WIFI;
@@ -362,9 +362,9 @@
} else {
wifiConnected = false;
mobileConnected = false;
- }
+ }
}
-
+
// Uses AsyncTask subclass to download the XML feed from stackoverflow.com.
public void loadPage() {
if (((sPref.equals(ANY)) && (wifiConnected || mobileConnected))
@@ -376,7 +376,7 @@
}
}
...
-
+
}</pre>
<h2 id="detect-changes">Detect Connection Changes</h2>
@@ -388,36 +388,36 @@
determines what the network connection status is, and sets the flags
<code>wifiConnected</code> and <code>mobileConnected</code> to true/false
accordingly. The upshot is that the next time the user returns to the app, the
-app will only download the latest feed and update the display if
+app will only download the latest feed and update the display if
<code>NetworkActivity.refreshDisplay</code> is set to <code>true</code>.</p>
-<p>Setting up a BroadcastReceiver that gets called unnecessarily can be a
+<p>Setting up a BroadcastReceiver that gets called unnecessarily can be a
drain on system resources.
-The sample application registers the
-{@link android.content.BroadcastReceiver} {@code NetworkReceiver} in
-{@link android.app.Activity#onCreate(android.os.Bundle) onCreate()},
-and it unregisters it in
-{@link android.app.Activity#onDestroy onDestroy()}. This is more lightweight
+The sample application registers the
+{@link android.content.BroadcastReceiver} {@code NetworkReceiver} in
+{@link android.app.Activity#onCreate(android.os.Bundle) onCreate()},
+and it unregisters it in
+{@link android.app.Activity#onDestroy onDestroy()}. This is more lightweight
than declaring a {@code <receiver>} in the manifest. When you declare a
{@code <receiver>} in the manifest, it can wake up your app at any time,
-even if you haven't run it for weeks. By registering and unregistering
-{@code NetworkReceiver} within the main activity, you ensure that the app won't
-be woken up after the user leaves the app.
+even if you haven't run it for weeks. By registering and unregistering
+{@code NetworkReceiver} within the main activity, you ensure that the app won't
+be woken up after the user leaves the app.
If you do declare a {@code <receiver>} in the manifest and you know exactly
-where you need it, you can use
+where you need it, you can use
{@link android.content.pm.PackageManager#setComponentEnabledSetting setComponentEnabledSetting()}
to enable and disable it as appropriate.</p>
<p>Here is <code>NetworkReceiver</code>:</p>
-<pre>public class NetworkReceiver extends BroadcastReceiver {
-
+<pre>public class NetworkReceiver extends BroadcastReceiver {
+
@Override
public void onReceive(Context context, Intent intent) {
ConnectivityManager conn = (ConnectivityManager)
context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = conn.getActiveNetworkInfo();
-
+
// Checks the user prefs and the network connection. Based on the result, decides whether
// to refresh the display or keep the current display.
// If the userpref is Wi-Fi only, checks to see if the device has a Wi-Fi connection.
@@ -432,9 +432,9 @@
// (which by process of elimination would be mobile), sets refreshDisplay to true.
} else if (ANY.equals(sPref) && networkInfo != null) {
refreshDisplay = true;
-
+
// Otherwise, the app can't download content--either because there is no network
- // connection (mobile or Wi-Fi), or because the pref setting is WIFI, and there
+ // connection (mobile or Wi-Fi), or because the pref setting is WIFI, and there
// is no Wi-Fi connection.
// Sets refreshDisplay to false.
} else {
diff --git a/docs/html/training/basics/network-ops/xml.jd b/docs/html/training/basics/network-ops/xml.jd
index 0ea696d..3385a63 100644
--- a/docs/html/training/basics/network-ops/xml.jd
+++ b/docs/html/training/basics/network-ops/xml.jd
@@ -9,7 +9,7 @@
@jd:body
-<div id="tb-wrapper">
+<div id="tb-wrapper">
<div id="tb">
@@ -38,7 +38,7 @@
<p class="filename">NetworkUsage.zip</p>
</div>
-</div>
+</div>
</div>
<p>Extensible Markup Language (XML) is a set of rules for encoding documents in
@@ -55,11 +55,11 @@
implementations of this interface:</p>
<ul>
- <li><a href="http://kxml.sourceforge.net/"><code>KXmlParser</code></a>
- via {@link org.xmlpull.v1.XmlPullParserFactory#newPullParser XmlPullParserFactory.newPullParser()}.
+ <li><a href="http://kxml.sourceforge.net/"><code>KXmlParser</code></a>
+ via {@link org.xmlpull.v1.XmlPullParserFactory#newPullParser XmlPullParserFactory.newPullParser()}.
</li>
- <li><code>ExpatPullParser</code>, via
- {@link android.util.Xml#newPullParser Xml.newPullParser()}.
+ <li><code>ExpatPullParser</code>, via
+ {@link android.util.Xml#newPullParser Xml.newPullParser()}.
</li>
</ul>
@@ -69,15 +69,15 @@
<h2 id="analyze">Analyze the Feed</h2>
-<p>The first step in parsing a feed is to decide which fields you're interested in.
+<p>The first step in parsing a feed is to decide which fields you're interested in.
The parser extracts data for those fields and ignores the rest.</p>
<p>Here is an excerpt from the feed that's being parsed in the sample app. Each
post to <a href="http://stackoverflow.com">StackOverflow.com</a> appears in the
feed as an <code>entry</code> tag that contains several nested tags:</p>
-<pre><?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" ...">
+<pre><?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" ...">
<title type="text">newest questions tagged android - Stack Overflow</title>
...
<entry>
@@ -107,7 +107,7 @@
...
</feed></pre>
-<p>The sample app
+<p>The sample app
extracts data for the <code>entry</code> tag and its nested tags
<code>title</code>, <code>link</code>, and <code>summary</code>.</p>
@@ -125,7 +125,7 @@
<pre>public class StackOverflowXmlParser {
// We don't use namespaces
private static final String ns = null;
-
+
public List<Entry> parse(InputStream in) throws XmlPullParserException, IOException {
try {
XmlPullParser parser = Xml.newPullParser();
@@ -137,7 +137,7 @@
in.close();
}
}
- ...
+ ...
}</pre>
<h2 id="read">Read the Feed</h2>
@@ -166,7 +166,7 @@
} else {
skip(parser);
}
- }
+ }
return entries;
}</pre>
@@ -187,7 +187,7 @@
<li>A "read" method for each tag you're interested in. For example,
<code>readEntry()</code>, <code>readTitle()</code>, and so on. The parser reads
-tags from the input stream. When it encounters a tag named <code>entry</code>,
+tags from the input stream. When it encounters a tag named <code>entry</code>,
<code>title</code>,
<code>link</code> or <code>summary</code>, it calls the appropriate method
for that tag. Otherwise, it skips the tag.
@@ -201,7 +201,7 @@
<code>readText()</code>. This method extracts data for these tags by calling
<code>parser.getText()</code>.</li>
-<li>For the <code>link</code> tag, the parser extracts data for links by first
+<li>For the <code>link</code> tag, the parser extracts data for links by first
determining if the link is the kind
it's interested in. Then it uses <code>parser.getAttributeValue()</code> to
extract the link's value.</li>
@@ -215,7 +215,7 @@
</li>
<li>A helper <code>skip()</code> method that's recursive. For more discussion of this topic, see <a href="#skip">Skip Tags You Don't Care About</a>.</li>
</ul>
-
+
</li>
</ol>
@@ -231,7 +231,7 @@
this.link = link;
}
}
-
+
// Parses the contents of an entry. If it encounters a title, summary, or link tag, hands them off
// to their respective "read" methods for processing. Otherwise, skips the tag.
private Entry readEntry(XmlPullParser parser) throws XmlPullParserException, IOException {
@@ -264,18 +264,18 @@
parser.require(XmlPullParser.END_TAG, ns, "title");
return title;
}
-
+
// Processes link tags in the feed.
private String readLink(XmlPullParser parser) throws IOException, XmlPullParserException {
String link = "";
parser.require(XmlPullParser.START_TAG, ns, "link");
String tag = parser.getName();
- String relType = parser.getAttributeValue(null, "rel");
+ String relType = parser.getAttributeValue(null, "rel");
if (tag.equals("link")) {
if (relType.equals("alternate")){
link = parser.getAttributeValue(null, "href");
parser.nextTag();
- }
+ }
}
parser.require(XmlPullParser.END_TAG, ns, "link");
return link;
@@ -350,7 +350,7 @@
<ul>
<li>The first time through the <code>while</code> loop, the next tag the parser
-encounters after <code><author></code> is the <code>START_TAG</code> for
+encounters after <code><author></code> is the <code>START_TAG</code> for
<code><name></code>. The value for <code>depth</code> is incremented to
2.</li>
@@ -367,7 +367,7 @@
<code>depth</code> is decremented to 1.</li>
<li>The fifth time and final time through the <code>while</code> loop, the next
-tag the parser encounters is the <code>END_TAG</code>
+tag the parser encounters is the <code>END_TAG</code>
<code></author></code>. The value for <code>depth</code> is decremented to
0, indicating that the <code><author></code> element has been successfully
skipped.</li>
@@ -377,7 +377,7 @@
<h2 id="consume">Consume XML Data</h2>
<p>The example application fetches and parses the XML feed within an {@link
-android.os.AsyncTask}. This takes the processing off the main UI thread. When
+android.os.AsyncTask}. This takes the processing off the main UI thread. When
processing is complete, the app updates the UI in the main activity
(<code>NetworkActivity</code>).</p>
<p>In the excerpt shown below, the <code>loadPage()</code> method does the
@@ -386,33 +386,33 @@
<ul>
<li>Initializes a string variable with the URL for the XML feed.</li>
-
+
<li>If the user's settings and the network connection allow it, invokes
-<code>new DownloadXmlTask().execute(url)</code>. This instantiates a new
+<code>new DownloadXmlTask().execute(url)</code>. This instantiates a new
<code>DownloadXmlTask</code> object ({@link android.os.AsyncTask} subclass) and
runs its {@link android.os.AsyncTask#execute execute()} method, which downloads
and parses the feed and returns a string result to be displayed in the UI.</li>
-
+
</ul>
<pre>
public class NetworkActivity extends Activity {
public static final String WIFI = "Wi-Fi";
public static final String ANY = "Any";
private static final String URL = "http://stackoverflow.com/feeds/tag?tagnames=android&sort=newest";
-
+
// Whether there is a Wi-Fi connection.
- private static boolean wifiConnected = false;
+ private static boolean wifiConnected = false;
// Whether there is a mobile connection.
private static boolean mobileConnected = false;
// Whether the display should be refreshed.
- public static boolean refreshDisplay = true;
+ public static boolean refreshDisplay = true;
public static String sPref = null;
...
-
+
// Uses AsyncTask to download the XML feed from stackoverflow.com.
- public void loadPage() {
-
+ public void loadPage() {
+
if((sPref.equals(ANY)) && (wifiConnected || mobileConnected)) {
new DownloadXmlTask().execute(URL);
}
@@ -420,25 +420,25 @@
new DownloadXmlTask().execute(URL);
} else {
// show error
- }
+ }
}</pre>
-
+
<p>The {@link android.os.AsyncTask} subclass shown below,
<code>DownloadXmlTask</code>, implements the following {@link
android.os.AsyncTask} methods:</p>
<ul>
-
+
<li>{@link android.os.AsyncTask#doInBackground doInBackground()} executes
the method <code>loadXmlFromNetwork()</code>. It passes the feed URL as a
parameter. The method <code>loadXmlFromNetwork()</code> fetches and processes
the feed. When it finishes, it passes back a result string.</li>
-
+
<li>{@link android.os.AsyncTask#onPostExecute onPostExecute()} takes the
returned string and displays it in the UI.</li>
-
+
</ul>
-
+
<pre>
// Implementation of AsyncTask used to download XML feed from stackoverflow.com.
private class DownloadXmlTask extends AsyncTask<String, Void, String> {
@@ -454,7 +454,7 @@
}
@Override
- protected void onPostExecute(String result) {
+ protected void onPostExecute(String result) {
setContentView(R.layout.main);
// Displays the HTML string in the UI via a WebView
WebView myWebView = (WebView) findViewById(R.id.webview);
@@ -464,28 +464,28 @@
<p>Below is the method <code>loadXmlFromNetwork()</code> that is invoked from
<code>DownloadXmlTask</code>. It does the following:</p>
-
+
<ol>
-
+
<li>Instantiates a <code>StackOverflowXmlParser</code>. It also creates variables for
-a {@link java.util.List} of <code>Entry</code> objects (<code>entries</code>), and
+a {@link java.util.List} of <code>Entry</code> objects (<code>entries</code>), and
<code>title</code>, <code>url</code>, and <code>summary</code>, to hold the
values extracted from the XML feed for those fields.</li>
-
- <li>Calls <code>downloadUrl()</code>, which fetches the feed and returns it as
+
+ <li>Calls <code>downloadUrl()</code>, which fetches the feed and returns it as
an {@link java.io.InputStream}.</li>
-
- <li>Uses <code>StackOverflowXmlParser</code> to parse the {@link java.io.InputStream}.
- <code>StackOverflowXmlParser</code> populates a
+
+ <li>Uses <code>StackOverflowXmlParser</code> to parse the {@link java.io.InputStream}.
+ <code>StackOverflowXmlParser</code> populates a
{@link java.util.List} of <code>entries</code> with data from the feed.</li>
-
- <li>Processes the <code>entries</code> {@link java.util.List},
+
+ <li>Processes the <code>entries</code> {@link java.util.List},
and combines the feed data with HTML markup.</li>
-
+
<li>Returns an HTML string that is displayed in the main activity
UI by the {@link android.os.AsyncTask} method {@link
android.os.AsyncTask#onPostExecute onPostExecute()}.</li>
-
+
</ol>
<pre>
@@ -499,35 +499,35 @@
String title = null;
String url = null;
String summary = null;
- Calendar rightNow = Calendar.getInstance();
+ Calendar rightNow = Calendar.getInstance();
DateFormat formatter = new SimpleDateFormat("MMM dd h:mmaa");
-
+
// Checks whether the user set the preference to include summary text
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean pref = sharedPrefs.getBoolean("summaryPref", false);
-
+
StringBuilder htmlString = new StringBuilder();
htmlString.append("<h3>" + getResources().getString(R.string.page_title) + "</h3>");
- htmlString.append("<em>" + getResources().getString(R.string.updated) + " " +
+ htmlString.append("<em>" + getResources().getString(R.string.updated) + " " +
formatter.format(rightNow.getTime()) + "</em>");
-
+
try {
- stream = downloadUrl(urlString);
+ stream = downloadUrl(urlString);
entries = stackOverflowXmlParser.parse(stream);
// Makes sure that the InputStream is closed after the app is
// finished using it.
} finally {
if (stream != null) {
stream.close();
- }
+ }
}
-
+
// StackOverflowXmlParser returns a List (called "entries") of Entry objects.
// Each Entry object represents a single post in the XML feed.
// This section processes the entries list to combine each entry with HTML markup.
// Each entry is displayed in the UI as a link that optionally includes
// a text summary.
- for (Entry entry : entries) {
+ for (Entry entry : entries) {
htmlString.append("<p><a href='");
htmlString.append(entry.link);
htmlString.append("'>" + entry.title + "</a></p>");
diff --git a/docs/html/training/basics/supporting-devices/index.jd b/docs/html/training/basics/supporting-devices/index.jd
index 4644c31..c9f2e6c 100644
--- a/docs/html/training/basics/supporting-devices/index.jd
+++ b/docs/html/training/basics/supporting-devices/index.jd
@@ -35,7 +35,7 @@
variety of Android-compatible devices, using a single application package (APK).</p>
<h2>Lessons</h2>
-
+
<dl>
<dt><b><a href="languages.html">Supporting Different Languages</a></b></dt>
<dd>Learn how to support multiple languages with alternative string resources.</dd>
@@ -44,5 +44,5 @@
<dt><b><a href="platforms.html">Supporting Different Platform Versions</a></b></dt>
<dd>Learn how to use APIs available in new versions of Android while continuing to support
older versions of Android.</dd>
-</dl>
+</dl>
diff --git a/docs/html/training/basics/supporting-devices/languages.jd b/docs/html/training/basics/supporting-devices/languages.jd
index ba7c016..0ad1faf 100644
--- a/docs/html/training/basics/supporting-devices/languages.jd
+++ b/docs/html/training/basics/supporting-devices/languages.jd
@@ -36,7 +36,7 @@
your string values.</p>
-<h2 id="CreateDirs">Create Locale Directories and String Files</h2>
+<h2 id="CreateDirs">Create Locale Directories and String Files</h2>
<p>To add support for more languages, create additional <code>values</code> directories inside
<code>res/</code> that include a hyphen and the ISO language code at the end of the
@@ -63,7 +63,7 @@
<p>At runtime, the Android system uses the appropriate set of string resources based on the
locale currently set for the user's device.</p>
-
+
<p>For example, the following are some different string resource files for different languages.</p>
@@ -112,7 +112,7 @@
<p>In your source code, you can refer to a string resource with the syntax {@code
R.string.<string_name>}. There are a variety of methods that accept a string resource this
way.</p>
-
+
<p>For example:</p>
<pre>
diff --git a/docs/html/training/basics/supporting-devices/platforms.jd b/docs/html/training/basics/supporting-devices/platforms.jd
index eecb356..6712029 100644
--- a/docs/html/training/basics/supporting-devices/platforms.jd
+++ b/docs/html/training/basics/supporting-devices/platforms.jd
@@ -10,14 +10,14 @@
<div id="tb-wrapper">
<div id="tb">
-
+
<h2>This lesson teaches you to</h2>
<ol>
<li><a href="#sdk-versions">Specify Minimum and Target API Levels</a></li>
<li><a href="#version-codes">Check System Version at Runtime</a></li>
<li><a href="#style-themes">Use Platform Styles and Themes</a></li>
</ol>
-
+
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API Levels</a></li>
@@ -27,19 +27,19 @@
</div>
</div>
-<p>While the latest versions of Android often provide great APIs for your app, you should continue
-to support older versions of Android until more devices get updated. This
-lesson shows you how to take advantage of the latest APIs while continuing to support older
+<p>While the latest versions of Android often provide great APIs for your app, you should continue
+to support older versions of Android until more devices get updated. This
+lesson shows you how to take advantage of the latest APIs while continuing to support older
versions as well.</p>
<p>The dashboard for <a
href="http://developer.android.com/about/dashboards/index.html">Platform Versions</a>
-is updated regularly to show the distribution of active
-devices running each version of Android, based on the number of devices that visit the Google Play
-Store. Generally, it’s a good practice to support about 90% of the active devices, while
+is updated regularly to show the distribution of active
+devices running each version of Android, based on the number of devices that visit the Google Play
+Store. Generally, it’s a good practice to support about 90% of the active devices, while
targeting your app to the latest version.</p>
-<p class="note"><strong>Tip:</strong> In order to provide the best features and
+<p class="note"><strong>Tip:</strong> In order to provide the best features and
functionality across several Android versions, you should use the <a
href="{@docRoot}tools/support-library/index.html">Android Support Library</a> in your app,
which allows you to use several recent platform APIs on older versions.</p>
@@ -49,8 +49,8 @@
<h2 id="sdk-versions">Specify Minimum and Target API Levels</h2>
<p>The <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a> file
-describes details about your app and
-identifies which versions of Android it supports. Specifically, the <code>minSdkVersion</code>
+describes details about your app and
+identifies which versions of Android it supports. Specifically, the <code>minSdkVersion</code>
and <code>targetSdkVersion</code> attributes for the <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element
identify the lowest API level with which your app is compatible and the highest API level against
@@ -65,9 +65,9 @@
</manifest>
</pre>
-<p>As new versions of Android are released, some style and behaviors may change.
+<p>As new versions of Android are released, some style and behaviors may change.
To allow your app to take advantage of these changes and ensure that your app fits the style of
-each user's device, you should set the
+each user's device, you should set the
<a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a>
value to match the latest Android version
@@ -93,24 +93,24 @@
-<p class="note"><strong>Note:</strong> When parsing XML resources, Android ignores XML
+<p class="note"><strong>Note:</strong> When parsing XML resources, Android ignores XML
attributes that aren’t supported by the current device. So you can safely use XML attributes that
are only supported by newer versions without worrying about older versions breaking when they
-encounter that code. For example, if you set the
+encounter that code. For example, if you set the
<code>targetSdkVersion="11"</code>, your app includes the {@link android.app.ActionBar} by default
-on Android 3.0 and higher. To then add menu items to the action bar, you need to set
-<code>android:showAsAction="ifRoom"</code> in your menu resource XML. It's safe to do this
-in a cross-version XML file, because the older versions of Android simply ignore the
-<code>showAsAction</code> attribute (that is, you <em>do not</em> need a separate
+on Android 3.0 and higher. To then add menu items to the action bar, you need to set
+<code>android:showAsAction="ifRoom"</code> in your menu resource XML. It's safe to do this
+in a cross-version XML file, because the older versions of Android simply ignore the
+<code>showAsAction</code> attribute (that is, you <em>do not</em> need a separate
version in <code>res/menu-v11/</code>).</p>
-<h2 id="style-themes">Use Platform Styles and Themes</h2>
+<h2 id="style-themes">Use Platform Styles and Themes</h2>
-<p>Android provides user experience themes that give apps the look and feel of the
-underlying operating system. These themes can be applied to your app within the
-manifest file. By using these built in styles and themes, your app will
+<p>Android provides user experience themes that give apps the look and feel of the
+underlying operating system. These themes can be applied to your app within the
+manifest file. By using these built in styles and themes, your app will
naturally follow the latest look and feel of Android with each new release.</p>
<p>To make your activity look like a dialog box:</p>
@@ -126,7 +126,7 @@
<pre><activity android:theme="@style/CustomTheme"></pre>
<p>To apply a theme to your entire app (all activities), add the <code>android:theme</code>
-attribute
+attribute
to the <a href="{@docRoot}guide/topics/manifest/application-element.html">{@code
<application>}</a> element:</p>
diff --git a/docs/html/training/basics/supporting-devices/screens.jd b/docs/html/training/basics/supporting-devices/screens.jd
index 4b54de8..9d5e7c1 100644
--- a/docs/html/training/basics/supporting-devices/screens.jd
+++ b/docs/html/training/basics/supporting-devices/screens.jd
@@ -8,13 +8,13 @@
<div id="tb-wrapper">
<div id="tb">
-
+
<h2>This lesson teaches you to</h2>
<ol>
<li><a href="#create-layouts">Create Different Layouts</a></li>
<li><a href="#create-bitmaps">Create Different Bitmaps</a></li>
</ol>
-
+
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}training/multiscreen/index.html">Designing for Multiple
@@ -26,9 +26,9 @@
</div>
</div>
-<p>Android categorizes device screens using two general properties: size and density. You should
-expect that your app will be installed on devices with screens that range in both size
-and density. As such, you should include some alternative resources that optimize your app’s
+<p>Android categorizes device screens using two general properties: size and density. You should
+expect that your app will be installed on devices with screens that range in both size
+and density. As such, you should include some alternative resources that optimize your app’s
appearance for different screen sizes and densities.</p>
<ul>
@@ -46,12 +46,12 @@
orientation.</p>
-<h2 id="create-layouts">Create Different Layouts</h2>
+<h2 id="create-layouts">Create Different Layouts</h2>
<p>To optimize your user experience on different screen sizes, you should create a unique layout XML
-file for each screen size you want to support. Each layout should be
-saved into the appropriate resources directory, named with a <code>-<screen_size></code>
-suffix. For example, a unique layout for large screens should be saved under
+file for each screen size you want to support. Each layout should be
+saved into the appropriate resources directory, named with a <code>-<screen_size></code>
+suffix. For example, a unique layout for large screens should be saved under
<code>res/layout-large/</code>.</p>
<p class="note"><strong>Note:</strong> Android automatically scales your layout in order to
@@ -85,7 +85,7 @@
}
</pre>
-<p>The system loads the layout file from the appropriate layout directory based on screen size of
+<p>The system loads the layout file from the appropriate layout directory based on screen size of
the device on which your app is running. More information about how Android selects the
appropriate resource is available in the <a
href="{@docRoot}guide/topics/resources/providing-resources.html#BestMatch">Providing Resources</a>
@@ -120,7 +120,7 @@
main.xml
</pre>
-<p class="note"><strong>Note:</strong> Android 3.2 and above supports an advanced method of
+<p class="note"><strong>Note:</strong> Android 3.2 and above supports an advanced method of
defining screen sizes that allows you to specify resources for screen sizes based on
the minimum width and height in terms of density-independent pixels. This lesson does not cover
this new technique. For more information, read <a
@@ -128,14 +128,14 @@
Screens</a>.</p>
-
+
<h2 id="create-bitmaps">Create Different Bitmaps</h2>
<p>You should always provide bitmap resources that are properly scaled to each of the generalized
density buckets: low, medium, high and extra-high density. This helps you achieve good graphical
quality and performance on all screen densities.</p>
-<p>To generate these images, you should start with your raw resource in vector format and generate
+<p>To generate these images, you should start with your raw resource in vector format and generate
the images for each density using the following size scale:</p>
<ul>
<li>xhdpi: 2.0</li>
@@ -144,7 +144,7 @@
<li>ldpi: 0.75</li>
</ul>
-<p>This means that if you generate a 200x200 image for xhdpi devices, you should generate the same
+<p>This means that if you generate a 200x200 image for xhdpi devices, you should generate the same
resource in 150x150 for hdpi, 100x100 for mdpi, and 75x75 for ldpi devices.</p>
<p>Then, place the files in the appropriate drawable resource directory:</p>
@@ -162,14 +162,14 @@
awesomeimage.png
</pre>
-<p>Any time you reference <code>@drawable/awesomeimage</code>, the system selects the
+<p>Any time you reference <code>@drawable/awesomeimage</code>, the system selects the
appropriate bitmap based on the screen's density.</p>
<p class="note"><strong>Note:</strong> Low-density (ldpi) resources aren’t always necessary. When
you provide hdpi assets, the system scales them down by one half to properly fit ldpi
screens.</p>
-<p>For more tips and guidelines about creating icon assets for your app, see the
+<p>For more tips and guidelines about creating icon assets for your app, see the
<a href="{@docRoot}design/style/iconography.html">Iconography design guide</a>.</p>
diff --git a/docs/html/training/building-userinfo.jd b/docs/html/training/building-userinfo.jd
index 40e5b94..a08899d 100644
--- a/docs/html/training/building-userinfo.jd
+++ b/docs/html/training/building-userinfo.jd
@@ -4,6 +4,6 @@
@jd:body
-<p>These lessons teach you how to include contact information and authenticate users with the same
-credentials they use for Google. These features allow your app to connect users with people they
+<p>These lessons teach you how to include contact information and authenticate users with the same
+credentials they use for Google. These features allow your app to connect users with people they
care about and provide a personalized experience without creating new user accounts.</p>
diff --git a/docs/html/training/camera/cameradirect.jd b/docs/html/training/camera/cameradirect.jd
index 6f358a5..851c7db 100644
--- a/docs/html/training/camera/cameradirect.jd
+++ b/docs/html/training/camera/cameradirect.jd
@@ -11,7 +11,7 @@
<div id="tb-wrapper">
<div id="tb">
-
+
<h2>This lesson teaches you to</h2>
<ol>
<li><a href="#TaskOpenCamera">Open the Camera Object</a></li>
@@ -22,7 +22,7 @@
<li><a href="#TaskRestartPreview">Restart the Preview</a></li>
<li><a href="#TaskReleaseCamera">Stop the Preview and Release the Camera</a></li>
</ol>
-
+
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/topics/media/camera.html#custom-camera">Building
@@ -57,7 +57,7 @@
<pre>
private boolean safeCameraOpen(int id) {
boolean qOpened = false;
-
+
try {
releaseCameraAndPreview();
mCamera = Camera.open(id);
@@ -67,7 +67,7 @@
e.printStackTrace();
}
- return qOpened;
+ return qOpened;
}
private void releaseCameraAndPreview() {
@@ -136,22 +136,22 @@
<pre>
public void setCamera(Camera camera) {
if (mCamera == camera) { return; }
-
+
stopPreviewAndFreeCamera();
-
+
mCamera = camera;
-
+
if (mCamera != null) {
List<Size> localSizes = mCamera.getParameters().getSupportedPreviewSizes();
mSupportedPreviewSizes = localSizes;
requestLayout();
-
+
try {
mCamera.setPreviewDisplay(mHolder);
} catch (IOException e) {
e.printStackTrace();
}
-
+
// Important: Call startPreview() to start updating the preview
// surface. Preview must be started before you can take a picture.
mCamera.startPreview();
@@ -260,12 +260,12 @@
if (mCamera != null) {
// Call stopPreview() to stop updating the preview surface.
mCamera.stopPreview();
-
+
// Important: Call release() to release the camera for use by other
// applications. Applications should release the camera immediately
// during onPause() and re-open() it during onResume()).
mCamera.release();
-
+
mCamera = null;
}
}
diff --git a/docs/html/training/contacts-provider/display-contact-badge.jd b/docs/html/training/contacts-provider/display-contact-badge.jd
index b00ce0e..6c9616b 100644
--- a/docs/html/training/contacts-provider/display-contact-badge.jd
+++ b/docs/html/training/contacts-provider/display-contact-badge.jd
@@ -268,7 +268,7 @@
Uri.withAppendedPath(
contactUri, Photo.CONTENT_DIRECTORY);
}
-
+
/*
* Retrieves an AssetFileDescriptor object for the thumbnail
* URI
diff --git a/docs/html/training/contacts-provider/index.jd b/docs/html/training/contacts-provider/index.jd
index f380d95..9562977 100644
--- a/docs/html/training/contacts-provider/index.jd
+++ b/docs/html/training/contacts-provider/index.jd
@@ -55,7 +55,7 @@
<a href="{@docRoot}guide/topics/providers/contacts-provider.html">Contacts Provider</a>.
</p>
<h2>Lessons</h2>
-
+
<dl>
<dt>
<b><a href="retrieve-names.html">Retrieving a List of Contacts</a></b>
diff --git a/docs/html/training/custom-views/index.jd b/docs/html/training/custom-views/index.jd
index 447da94..d249fbd 100755
--- a/docs/html/training/custom-views/index.jd
+++ b/docs/html/training/custom-views/index.jd
@@ -67,7 +67,7 @@
custom drawings run faster.
</dd>
-</dl>
+</dl>
diff --git a/docs/html/training/displaying-bitmaps/cache-bitmap.jd b/docs/html/training/displaying-bitmaps/cache-bitmap.jd
index 7b9216e..d9622bc 100644
--- a/docs/html/training/displaying-bitmaps/cache-bitmap.jd
+++ b/docs/html/training/displaying-bitmaps/cache-bitmap.jd
@@ -187,7 +187,7 @@
appropriate place to store cached images if they are accessed more frequently, for example in an
image gallery application.</p>
-<p>The sample code of this class uses a {@code DiskLruCache} implementation that is pulled from the
+<p>The sample code of this class uses a {@code DiskLruCache} implementation that is pulled from the
<a href="https://android.googlesource.com/platform/libcore/+/jb-mr2-release/luni/src/main/java/libcore/io/DiskLruCache.java">Android source</a>.
Here’s updated example code that adds a disk cache in addition to the existing memory cache:</p>
diff --git a/docs/html/training/displaying-bitmaps/index.jd b/docs/html/training/displaying-bitmaps/index.jd
index 831c64d..aea473f 100644
--- a/docs/html/training/displaying-bitmaps/index.jd
+++ b/docs/html/training/displaying-bitmaps/index.jd
@@ -56,7 +56,7 @@
perform under this minimum memory limit. However, keep in mind many devices are configured with
higher limits.</li>
<li>Bitmaps take up a lot of memory, especially for rich images like photographs. For example, the
- camera on the <a href="http://www.android.com/devices/detail/galaxy-nexus">Galaxy Nexus</a> takes
+ camera on the <a href="http://www.android.com/devices/detail/galaxy-nexus">Galaxy Nexus</a> takes
photos up to 2592x1936 pixels (5 megapixels). If the bitmap configuration used is {@link
android.graphics.Bitmap.Config ARGB_8888} (the default from the Android 2.3 onward) then loading
this image into memory takes about 19MB of memory (2592*1936*4 bytes), immediately exhausting the
diff --git a/docs/html/training/displaying-bitmaps/manage-memory.jd b/docs/html/training/displaying-bitmaps/manage-memory.jd
index b7c72bc..ef3bd6c 100644
--- a/docs/html/training/displaying-bitmaps/manage-memory.jd
+++ b/docs/html/training/displaying-bitmaps/manage-memory.jd
@@ -42,11 +42,11 @@
<p>To set the stage for this lesson, here is how Android's management of
bitmap memory has evolved:</p>
-<ul>
+<ul>
<li>
-On Android Android 2.2 (API level 8) and lower, when garbage
+On Android Android 2.2 (API level 8) and lower, when garbage
collection occurs, your app's threads get stopped. This causes a lag that
-can degrade performance.
+can degrade performance.
<strong>Android 2.3 adds concurrent garbage collection, which means that
the memory is reclaimed soon after a bitmap is no longer referenced.</strong>
</li>
@@ -66,7 +66,7 @@
<h2 id="recycle">Manage Memory on Android 2.3.3 and Lower</h2>
-<p>On Android 2.3.3 (API level 10) and lower, using
+<p>On Android 2.3.3 (API level 10) and lower, using
{@link android.graphics.Bitmap#recycle recycle()}
is recommended. If you're displaying large amounts of bitmap data in your app,
you're likely to run into
@@ -82,12 +82,12 @@
<p>The following code snippet gives an example of calling
{@link android.graphics.Bitmap#recycle recycle()}. It uses reference counting
-(in the variables {@code mDisplayRefCount} and {@code mCacheRefCount}) to track
+(in the variables {@code mDisplayRefCount} and {@code mCacheRefCount}) to track
whether a bitmap is currently being displayed or in the cache. The
code recycles the bitmap when these conditions are met:</p>
<ul>
-<li>The reference count for both {@code mDisplayRefCount} and
+<li>The reference count for both {@code mDisplayRefCount} and
{@code mCacheRefCount} is 0.</li>
<li>The bitmap is not {@code null}, and it hasn't been recycled yet.</li>
</ul>
@@ -142,7 +142,7 @@
<p>Android 3.0 (API level 11) introduces the
{@link android.graphics.BitmapFactory.Options#inBitmap BitmapFactory.Options.inBitmap}
-field. If this option is set, decode methods that take the
+field. If this option is set, decode methods that take the
{@link android.graphics.BitmapFactory.Options Options} object
will attempt to reuse an existing bitmap when loading content. This means
that the bitmap's memory is reused, resulting in improved performance, and
@@ -154,7 +154,7 @@
<h3>Save a bitmap for later use</h3>
<p>The following snippet demonstrates how an existing bitmap is stored for possible
-later use in the sample app. When an app is running on Android 3.0 or higher and
+later use in the sample app. When an app is running on Android 3.0 or higher and
a bitmap is evicted from the {@link android.util.LruCache},
a soft reference to the bitmap is placed
in a {@link java.util.HashSet}, for possible reuse later with
@@ -238,7 +238,7 @@
}
}
-// This method iterates through the reusable bitmaps, looking for one
+// This method iterates through the reusable bitmaps, looking for one
// to use for inBitmap:
protected Bitmap getBitmapFromReusableSet(BitmapFactory.Options options) {
Bitmap bitmap = null;
diff --git a/docs/html/training/efficient-downloads/connectivity_patterns.jd b/docs/html/training/efficient-downloads/connectivity_patterns.jd
index 81f1540..079e967 100644
--- a/docs/html/training/efficient-downloads/connectivity_patterns.jd
+++ b/docs/html/training/efficient-downloads/connectivity_patterns.jd
@@ -26,7 +26,7 @@
</div>
<p>When it comes to impact on battery life, not all connection types are created equal. Not only does the Wi-Fi radio use significantly less battery than its wireless radio counterparts, but the radios used in different wireless radio technologies have different battery implications.</p>
-
+
<h2 id="WiFi">Use Wi-Fi</h2>
<p>In most cases a Wi-Fi radio will offer greater bandwidth at a significantly lower battery cost. As a result, you should endeavor to perform data transfers when connected over Wi-Fi whenever possible.</p>
@@ -50,22 +50,22 @@
TelephonyManager tm =
(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
-
+
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
-
+
int PrefetchCacheSize = DEFAULT_PREFETCH_CACHE;
-
+
switch (activeNetwork.getType()) {
- case (ConnectivityManager.TYPE_WIFI):
+ case (ConnectivityManager.TYPE_WIFI):
PrefetchCacheSize = MAX_PREFETCH_CACHE; break;
case (ConnectivityManager.TYPE_MOBILE): {
switch (tm.getNetworkType()) {
- case (TelephonyManager.NETWORK_TYPE_LTE |
- TelephonyManager.NETWORK_TYPE_HSPAP):
+ case (TelephonyManager.NETWORK_TYPE_LTE |
+ TelephonyManager.NETWORK_TYPE_HSPAP):
PrefetchCacheSize *= 4;
break;
- case (TelephonyManager.NETWORK_TYPE_EDGE |
- TelephonyManager.NETWORK_TYPE_GPRS):
+ case (TelephonyManager.NETWORK_TYPE_EDGE |
+ TelephonyManager.NETWORK_TYPE_GPRS):
PrefetchCacheSize /= 2;
break;
default: break;
diff --git a/docs/html/training/efficient-downloads/efficient-network-access.jd b/docs/html/training/efficient-downloads/efficient-network-access.jd
index 1d3a8a5..7f061ca 100644
--- a/docs/html/training/efficient-downloads/efficient-network-access.jd
+++ b/docs/html/training/efficient-downloads/efficient-network-access.jd
@@ -32,9 +32,9 @@
<p>Using the wireless radio to transfer data is potentially one of your app's most significant sources of battery drain. To minimize the battery drain associated with network activity, it's critical that you understand how your connectivity model will affect the underlying radio hardware.</p>
<p>This lesson introduces the wireless radio state machine and explains how your app's connectivity model interacts with it. It goes on to propose ways to minimize your data connections, use prefetching, and bundle your transfers in order to minimize the battery drain associated with your data transfers.</p>
-
-<h2 id="RadioStateMachine">The Radio State Machine</h2>
-
+
+<h2 id="RadioStateMachine">The Radio State Machine</h2>
+
<p>A fully active wireless radio consumes significant power, so it transitions between different energy states in order to conserve power when not in use, while attempting to minimize latency associated with "powering up" the radio when it's required.</p>
<p>The state machine for a typical 3G network radio consists of three energy states:
@@ -57,9 +57,9 @@
<p>This approach is particularly effective for typical web browsing as it prevents unwelcome latency while users browse the web. The relatively low tail-time also ensures that once a browsing session has finished, the radio can move to a lower energy state.</p>
<p>Unfortunately, this approach can lead to inefficient apps on modern smartphone OSs like Android, where apps run both in the foreground (where latency is important) and in the background (where battery life should be prioritized).</p>
-
-<h2 id="AppsStateMachine">How Apps Impact the Radio State Machine</h2>
-
+
+<h2 id="AppsStateMachine">How Apps Impact the Radio State Machine</h2>
+
<p>Every time you create a new network connection, the radio transitions to the full power state. In the case of the typical 3G radio state machine described above, it will remain at full power for the duration of your transfer—plus an additional 5 seconds of tail time—followed by 12 seconds at the low energy state. So for a typical 3G device, every data transfer session will cause the radio to draw energy for almost 20 seconds.</p>
<p>In practice, this means an app that transfers unbundled data for 1 second every 18 seconds will keep the wireless radio perpetually active, moving it back to high power just as it was about to become idle. As a result, every minute it will consume battery at the high power state for 18 seconds, and at the low power state for the remaining 42 seconds.</p>
@@ -71,7 +71,7 @@
<img src="{@docRoot}images/efficient-downloads/graphs.png" />
<p class="img-caption"><strong>Figure 2.</strong> Relative wireless radio power use for bundled versus unbundled transfers.</p>
-<h2 id="PrefetchData">Prefetch Data</h2>
+<h2 id="PrefetchData">Prefetch Data</h2>
<p>Prefetching data is an effective way to reduce the number of independent data transfer sessions. Prefetching allows you to download all the data you are likely to need for a given time period in a single burst, over a single connection, at full capacity.</p>
@@ -135,7 +135,7 @@
<p>Rather than creating multiple simultaneous connections to download data, or chaining multiple consecutive GET requests, where possible you should bundle those requests into a single GET.</p>
-<p>For example, it would be more efficient to make a single request for every news article to be returned in a single request / response than to make multiple queries for several news categories.
+<p>For example, it would be more efficient to make a single request for every news article to be returned in a single request / response than to make multiple queries for several news categories.
The wireless radio needs to become active in order to transmit the termination / termination acknowledgement packets associated with server and client timeout, so it's also good practice to close your connections when they aren't in use, rather than waiting for these timeouts.</p>
<p>That said, closing a connection too early can prevent it from being reused, which then requires additional overhead for establishing a new connection. A useful compromise is not to close the connection immediately, but to still close it before the inherent timeout expires.</p>
diff --git a/docs/html/training/efficient-downloads/index.jd b/docs/html/training/efficient-downloads/index.jd
index d9d7ef0..a4c2aa1 100644
--- a/docs/html/training/efficient-downloads/index.jd
+++ b/docs/html/training/efficient-downloads/index.jd
@@ -26,18 +26,18 @@
<p>In this class you will learn to minimize the battery life impact of downloads and network connections, particularly in relation to the wireless radio.</P
-<p>This class demonstrates the best practices for scheduling and executing downloads using techniques such as caching, polling, and prefetching. You will learn how the power-use profile of the wireless radio can affect your choices on when, what, and how to transfer data in order to minimize impact on battery life.</p>
+<p>This class demonstrates the best practices for scheduling and executing downloads using techniques such as caching, polling, and prefetching. You will learn how the power-use profile of the wireless radio can affect your choices on when, what, and how to transfer data in order to minimize impact on battery life.</p>
-<h2>Lessons</h2>
-
+<h2>Lessons</h2>
+
<!-- Create a list of the lessons in this class along with a short description of each lesson.
These should be short and to the point. It should be clear from reading the summary whether someone
-will want to jump to a lesson or not.-->
-
-<dl>
+will want to jump to a lesson or not.-->
+
+<dl>
<dt><b><a href="efficient-network-access.html">Optimizing Downloads for Efficient Network Access</a></b></dt>
<dd>This lesson introduces the wireless radio state machine, explains how your app’s connectivity model interacts with it, and how you can minimize your data connection and use prefetching and bundling to minimize the battery drain associated with your data transfers.</dd>
-
+
<dt><b><a href="regular_updates.html">Minimizing the Effect of Regular Updates</a></b></dt>
<dd>This lesson will examine how your refresh frequency can be varied to best mitigate the effect of background updates on the underlying wireless radio state machine.</dd>
@@ -47,4 +47,4 @@
<dt><b><a href="connectivity_patterns.html">Modifying your Download Patterns Based on the Connectivity Type</a></b></dt>
<dd>When it comes to impact on battery life, not all connection types are created equal. Not only does the Wi-Fi radio use significantly less battery than its wireless radio counterparts, but the radios used in different wireless radio technologies have different battery implications.</dd>
-</dl>
+</dl>
diff --git a/docs/html/training/efficient-downloads/regular_updates.jd b/docs/html/training/efficient-downloads/regular_updates.jd
index 8e3842a..b87c512 100644
--- a/docs/html/training/efficient-downloads/regular_updates.jd
+++ b/docs/html/training/efficient-downloads/regular_updates.jd
@@ -33,9 +33,9 @@
<p><a href="{@docRoot}training/monitoring-device-state/index.html">Optimizing Battery Life</a> discusses how to build battery-efficient apps that modify their refresh frequency based on the state of the host device. That includes disabling background service updates when you lose connectivity and reducing the rate of updates when the battery level is low.</p>
<p>This lesson will examine how your refresh frequency can be varied to best mitigate the effect of background updates on the underlying wireless radio state machine.</p>
-
-<h2 id="GCM">Use Google Cloud Messaging as an Alternative to Polling</h2>
-
+
+<h2 id="GCM">Use Google Cloud Messaging as an Alternative to Polling</h2>
+
<p>Every time your app polls your server to check if an update is required, you activate the wireless radio, drawing power unnecessarily, for up to 20 seconds on a typical 3G connection.</p>
<p><a href="{@docRoot}google/gcm/index.html">Google Cloud Messaging for Android (GCM)</a> is a lightweight mechanism used to transmit data from a server to a particular app instance. Using GCM, your server can notify your app running on a particular device that there is new data available for it.</p>
@@ -46,7 +46,7 @@
<p>GCM is implemented using a persistent TCP/IP connection. While it's possible to implement your own push service, it's best practice to use GCM. This minimizes the number of persistent connections and allows the platform to optimize bandwidth and minimize the associated impact on battery life.</p>
-<h2 id="OptimizedPolling">Optimize Polling with Inexact Repeating Alarms and Exponential Backoffs</h2>
+<h2 id="OptimizedPolling">Optimize Polling with Inexact Repeating Alarms and Exponential Backoffs</h2>
<p>Where polling is required, it's good practice to set the default data refresh frequency of your app as low as possible without detracting from the user experience.</p>
@@ -68,14 +68,14 @@
<p>One approach is to implement an exponential back-off pattern to reduce the frequency of your updates (and / or the degree of prefetching you perform) if the app hasn't been used since the previous update. It's often useful to assert a minimum update frequency and to reset the frequency whenever the app is used, for example:</p>
-<pre>SharedPreferences sp =
+<pre>SharedPreferences sp =
context.getSharedPreferences(PREFS, Context.MODE_WORLD_READABLE);
boolean appUsed = sp.getBoolean(PREFS_APPUSED, false);
long updateInterval = sp.getLong(PREFS_INTERVAL, DEFAULT_REFRESH_INTERVAL);
if (!appUsed)
- if ((updateInterval *= 2) > MAX_REFRESH_INTERVAL)
+ if ((updateInterval *= 2) > MAX_REFRESH_INTERVAL)
updateInterval = MAX_REFRESH_INTERVAL;
Editor spEdit = sp.edit();
@@ -92,10 +92,10 @@
<pre>private void retryIn(long interval) {
boolean success = attemptTransfer();
-
+
if (!success) {
- retryIn(interval*2 < MAX_RETRY_INTERVAL ?
- interval*2 : MAX_RETRY_INTERVAL);
+ retryIn(interval*2 < MAX_RETRY_INTERVAL ?
+ interval*2 : MAX_RETRY_INTERVAL);
}
}</pre>
diff --git a/docs/html/training/gestures/detector.jd b/docs/html/training/gestures/detector.jd
index 97f039c..0624e86 100644
--- a/docs/html/training/gestures/detector.jd
+++ b/docs/html/training/gestures/detector.jd
@@ -48,48 +48,48 @@
<ol>
<li>Gathering data about touch events.</li>
-
+
<li>Interpreting the data to see if it meets the criteria for any of the
-gestures your app supports. </li>
+gestures your app supports. </li>
</ol>
<h4>Support Library Classes</h4>
<p>The examples in this lesson use the {@link android.support.v4.view.GestureDetectorCompat}
-and {@link android.support.v4.view.MotionEventCompat} classes. These classes are in the
+and {@link android.support.v4.view.MotionEventCompat} classes. These classes are in the
<a href="{@docRoot}tools/support-library/index.html">Support Library</a>. You should use
-Support Library classes where possible to provide compatibility with devices
-running Android 1.6 and higher. Note that {@link android.support.v4.view.MotionEventCompat} is <em>not</em> a
-replacement for the {@link android.view.MotionEvent} class. Rather, it provides static utility
-methods to which you pass your {@link android.view.MotionEvent} object in order to receive
+Support Library classes where possible to provide compatibility with devices
+running Android 1.6 and higher. Note that {@link android.support.v4.view.MotionEventCompat} is <em>not</em> a
+replacement for the {@link android.view.MotionEvent} class. Rather, it provides static utility
+methods to which you pass your {@link android.view.MotionEvent} object in order to receive
the desired action associated with that event.</p>
<h2 id="data">Gather Data</h2>
<p>When a user places one or more fingers on the screen, this triggers the
-callback {@link android.view.View#onTouchEvent onTouchEvent()}
+callback {@link android.view.View#onTouchEvent onTouchEvent()}
on the View that received the touch events.
-For each sequence of touch events (position, pressure, size, addition of another finger, etc.)
+For each sequence of touch events (position, pressure, size, addition of another finger, etc.)
that is ultimately identified as a gesture,
{@link android.view.View#onTouchEvent onTouchEvent()} is fired several times.</p>
<p>The gesture starts when the user first touches the screen, continues as the system tracks
the position of the user's finger(s), and ends by capturing the final event of
-the user's fingers leaving the screen. Throughout this interaction,
-the {@link android.view.MotionEvent} delivered to {@link android.view.View#onTouchEvent onTouchEvent()}
-provides the details of every interaction. Your app can use the data provided by the {@link android.view.MotionEvent}
+the user's fingers leaving the screen. Throughout this interaction,
+the {@link android.view.MotionEvent} delivered to {@link android.view.View#onTouchEvent onTouchEvent()}
+provides the details of every interaction. Your app can use the data provided by the {@link android.view.MotionEvent}
to determine if a gesture it cares
about happened.</p>
<h3>Capturing touch events for an Activity or View</h3>
-<p><p>To intercept touch events in an Activity or View, override
+<p><p>To intercept touch events in an Activity or View, override
the {@link android.view.View#onTouchEvent onTouchEvent()} callback.</p>
-<p>The following snippet uses
+<p>The following snippet uses
{@link android.support.v4.view.MotionEventCompat#getActionMasked getActionMasked()}
-to extract the action the user performed from the {@code event} parameter. This gives you the raw
+to extract the action the user performed from the {@code event} parameter. This gives you the raw
data you need to determine if a gesture you care about occurred:</p>
<pre>
@@ -98,10 +98,10 @@
// This example shows an Activity, but you would use the same approach if
// you were subclassing a View.
@Override
-public boolean onTouchEvent(MotionEvent event){
-
+public boolean onTouchEvent(MotionEvent event){
+
int action = MotionEventCompat.getActionMasked(event);
-
+
switch(action) {
case (MotionEvent.ACTION_DOWN) :
Log.d(DEBUG_TAG,"Action was DOWN");
@@ -118,10 +118,10 @@
case (MotionEvent.ACTION_OUTSIDE) :
Log.d(DEBUG_TAG,"Movement occurred outside bounds " +
"of current screen element");
- return true;
- default :
+ return true;
+ default :
return super.onTouchEvent(event);
- }
+ }
}</pre>
<p>You can then do your own processing on these events to determine if a
@@ -143,22 +143,22 @@
events without subclassing an existing {@link android.view.View}. For
example:</p>
-<pre>View myView = findViewById(R.id.my_view);
+<pre>View myView = findViewById(R.id.my_view);
myView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
- // ... Respond to touch events
+ // ... Respond to touch events
return true;
}
});</pre>
-<p>Beware of creating a listener that returns {@code false} for the
-{@link android.view.MotionEvent#ACTION_DOWN} event. If you do this, the listener will
-not be called for the subsequent {@link android.view.MotionEvent#ACTION_MOVE}
+<p>Beware of creating a listener that returns {@code false} for the
+{@link android.view.MotionEvent#ACTION_DOWN} event. If you do this, the listener will
+not be called for the subsequent {@link android.view.MotionEvent#ACTION_MOVE}
and {@link android.view.MotionEvent#ACTION_UP} string of events. This is because
{@link android.view.MotionEvent#ACTION_DOWN} is the starting point for all touch events.</p>
-<p>If you are creating a custom View, you can override
-{@link android.view.View#onTouchEvent onTouchEvent()},
+<p>If you are creating a custom View, you can override
+{@link android.view.View#onTouchEvent onTouchEvent()},
as described above.</p>
<h2 id="detect">Detect Gestures</h2>
@@ -168,24 +168,24 @@
android.view.GestureDetector.OnGestureListener#onDown onDown()}, {@link
android.view.GestureDetector.OnGestureListener#onLongPress onLongPress()},
{@link android.view.GestureDetector.OnGestureListener#onFling onFling()}, and so
-on. You can use {@link android.view.GestureDetector} in conjunction with the
+on. You can use {@link android.view.GestureDetector} in conjunction with the
{@link android.view.View#onTouchEvent onTouchEvent()}
method described above.</p>
<h3>Detecting All Supported Gestures</h3>
-<p>When you instantiate a {@link android.support.v4.view.GestureDetectorCompat}
-object, one of the parameters it takes is a class that implements the
-{@link android.view.GestureDetector.OnGestureListener} interface.
-{@link android.view.GestureDetector.OnGestureListener} notifies users when
-a particular touch event has occurred. To make it possible for your
-{@link android.view.GestureDetector} object to receive events, you override
-the View or Activity's {@link android.view.View#onTouchEvent onTouchEvent()} method,
+<p>When you instantiate a {@link android.support.v4.view.GestureDetectorCompat}
+object, one of the parameters it takes is a class that implements the
+{@link android.view.GestureDetector.OnGestureListener} interface.
+{@link android.view.GestureDetector.OnGestureListener} notifies users when
+a particular touch event has occurred. To make it possible for your
+{@link android.view.GestureDetector} object to receive events, you override
+the View or Activity's {@link android.view.View#onTouchEvent onTouchEvent()} method,
and pass along all observed events to the detector instance.</p>
-<p>In the following snippet, a return value of {@code true} from the individual
+<p>In the following snippet, a return value of {@code true} from the individual
<code>on<em><TouchEvent></em></code> methods indicates that you
have handled the touch event. A return value of {@code false} passes events down
through the view stack until the touch has been successfully handled.</p>
@@ -195,14 +195,14 @@
android.view.MotionEvent} are for each touch event. You will realize how much
data is being generated for even simple interactions.</p>
-<pre>public class MainActivity extends Activity implements
+<pre>public class MainActivity extends Activity implements
GestureDetector.OnGestureListener,
GestureDetector.OnDoubleTapListener{
-
- private static final String DEBUG_TAG = "Gestures";
- private GestureDetectorCompat mDetector;
- // Called when the activity is first created.
+ private static final String DEBUG_TAG = "Gestures";
+ private GestureDetectorCompat mDetector;
+
+ // Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -216,21 +216,21 @@
mDetector.setOnDoubleTapListener(this);
}
- @Override
- public boolean onTouchEvent(MotionEvent event){
+ @Override
+ public boolean onTouchEvent(MotionEvent event){
this.mDetector.onTouchEvent(event);
// Be sure to call the superclass implementation
return super.onTouchEvent(event);
}
@Override
- public boolean onDown(MotionEvent event) {
- Log.d(DEBUG_TAG,"onDown: " + event.toString());
+ public boolean onDown(MotionEvent event) {
+ Log.d(DEBUG_TAG,"onDown: " + event.toString());
return true;
}
@Override
- public boolean onFling(MotionEvent event1, MotionEvent event2,
+ public boolean onFling(MotionEvent event1, MotionEvent event2,
float velocityX, float velocityY) {
Log.d(DEBUG_TAG, "onFling: " + event1.toString()+event2.toString());
return true;
@@ -238,7 +238,7 @@
@Override
public void onLongPress(MotionEvent event) {
- Log.d(DEBUG_TAG, "onLongPress: " + event.toString());
+ Log.d(DEBUG_TAG, "onLongPress: " + event.toString());
}
@Override
@@ -294,23 +294,23 @@
android.view.GestureDetector.OnGestureListener#onFling onFling()} and {@link
android.view.GestureDetector.OnGestureListener#onDown onDown()}.</p>
-<p>Whether or not you use {@link android.view.GestureDetector.OnGestureListener},
-it's best practice to implement an
-{@link android.view.GestureDetector.OnGestureListener#onDown onDown()}
-method that returns {@code true}. This is because all gestures begin with an
-{@link android.view.GestureDetector.OnGestureListener#onDown onDown()} message. If you return
-{@code false} from {@link android.view.GestureDetector.OnGestureListener#onDown onDown()},
-as {@link android.view.GestureDetector.SimpleOnGestureListener} does by default,
-the system assumes that you want to ignore the rest of the gesture, and the other methods of
-{@link android.view.GestureDetector.OnGestureListener} never get called.
-This has the potential to cause unexpected problems in your app.
-The only time you should return {@code false} from
-{@link android.view.GestureDetector.OnGestureListener#onDown onDown()}
+<p>Whether or not you use {@link android.view.GestureDetector.OnGestureListener},
+it's best practice to implement an
+{@link android.view.GestureDetector.OnGestureListener#onDown onDown()}
+method that returns {@code true}. This is because all gestures begin with an
+{@link android.view.GestureDetector.OnGestureListener#onDown onDown()} message. If you return
+{@code false} from {@link android.view.GestureDetector.OnGestureListener#onDown onDown()},
+as {@link android.view.GestureDetector.SimpleOnGestureListener} does by default,
+the system assumes that you want to ignore the rest of the gesture, and the other methods of
+{@link android.view.GestureDetector.OnGestureListener} never get called.
+This has the potential to cause unexpected problems in your app.
+The only time you should return {@code false} from
+{@link android.view.GestureDetector.OnGestureListener#onDown onDown()}
is if you truly want to ignore an entire gesture. </p>
-<pre>public class MainActivity extends Activity {
-
- private GestureDetectorCompat mDetector;
+<pre>public class MainActivity extends Activity {
+
+ private GestureDetectorCompat mDetector;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -319,23 +319,23 @@
mDetector = new GestureDetectorCompat(this, new MyGestureListener());
}
- @Override
- public boolean onTouchEvent(MotionEvent event){
+ @Override
+ public boolean onTouchEvent(MotionEvent event){
this.mDetector.onTouchEvent(event);
return super.onTouchEvent(event);
}
-
+
class MyGestureListener extends GestureDetector.SimpleOnGestureListener {
- private static final String DEBUG_TAG = "Gestures";
-
+ private static final String DEBUG_TAG = "Gestures";
+
@Override
- public boolean onDown(MotionEvent event) {
- Log.d(DEBUG_TAG,"onDown: " + event.toString());
+ public boolean onDown(MotionEvent event) {
+ Log.d(DEBUG_TAG,"onDown: " + event.toString());
return true;
}
@Override
- public boolean onFling(MotionEvent event1, MotionEvent event2,
+ public boolean onFling(MotionEvent event1, MotionEvent event2,
float velocityX, float velocityY) {
Log.d(DEBUG_TAG, "onFling: " + event1.toString()+event2.toString());
return true;
diff --git a/docs/html/training/gestures/index.jd b/docs/html/training/gestures/index.jd
index 260cfff..fad1afa 100644
--- a/docs/html/training/gestures/index.jd
+++ b/docs/html/training/gestures/index.jd
@@ -60,7 +60,7 @@
<strong><a href="detector.html">Detecting Common Gestures</a></strong>
</dt>
<dd>
- Learn how to detect basic touch gestures such as scrolling, flinging, and double-tapping, using
+ Learn how to detect basic touch gestures such as scrolling, flinging, and double-tapping, using
{@link android.view.GestureDetector}.
</dd>
@@ -84,7 +84,7 @@
</dt>
<dd>
Learn how to detect multi-pointer (finger) gestures.
- </dd>
+ </dd>
<dt>
<strong><a href="scale.html">Dragging and Scaling</a></strong>
</dt>
diff --git a/docs/html/training/gestures/movement.jd b/docs/html/training/gestures/movement.jd
index ed4928e..0a611b3 100644
--- a/docs/html/training/gestures/movement.jd
+++ b/docs/html/training/gestures/movement.jd
@@ -55,13 +55,13 @@
To help apps distinguish between movement-based gestures (such as a swipe) and
non-movement gestures (such as a single tap), Android includes the notion of
"touch slop." Touch slop refers to the distance in pixels a user's touch can wander
-before the gesture is interpreted as a movement-based gesture. For more discussion of this
+before the gesture is interpreted as a movement-based gesture. For more discussion of this
topic, see <a href="viewgroup.html#vc">Managing Touch Events in a ViewGroup</a>.</p>
<p>There are several different ways to track movement in a gesture, depending on
-the needs of your application. For example:</p>
+the needs of your application. For example:</p>
<ul>
@@ -89,8 +89,8 @@
<p> You could have a movement-based gesture that is simply based on the distance and/or direction the pointer traveled. But velocity often is a
determining factor in tracking a gesture's characteristics or even deciding
whether the gesture occurred. To make velocity calculation easier, Android
-provides the {@link android.view.VelocityTracker} class and the
-{@link android.support.v4.view.VelocityTrackerCompat} class in the
+provides the {@link android.view.VelocityTracker} class and the
+{@link android.support.v4.view.VelocityTrackerCompat} class in the
<a href="{@docRoot}tools/support-library/index.html">Support Library</a>.
{@link
android.view.VelocityTracker} helps you track the velocity of touch events. This
@@ -98,7 +98,7 @@
gesture, such as a fling.</p>
-<p>Here is a simple example that illustrates the purpose of the methods in the
+<p>Here is a simple example that illustrates the purpose of the methods in the
{@link android.view.VelocityTracker} API:</p>
<pre>public class MainActivity extends Activity {
@@ -126,16 +126,16 @@
break;
case MotionEvent.ACTION_MOVE:
mVelocityTracker.addMovement(event);
- // When you want to determine the velocity, call
- // computeCurrentVelocity(). Then call getXVelocity()
- // and getYVelocity() to retrieve the velocity for each pointer ID.
+ // When you want to determine the velocity, call
+ // computeCurrentVelocity(). Then call getXVelocity()
+ // and getYVelocity() to retrieve the velocity for each pointer ID.
mVelocityTracker.computeCurrentVelocity(1000);
// Log velocity of pixels per second
// Best practice to use VelocityTrackerCompat where possible.
- Log.d("", "X velocity: " +
- VelocityTrackerCompat.getXVelocity(mVelocityTracker,
+ Log.d("", "X velocity: " +
+ VelocityTrackerCompat.getXVelocity(mVelocityTracker,
pointerId));
- Log.d("", "Y velocity: " +
+ Log.d("", "Y velocity: " +
VelocityTrackerCompat.getYVelocity(mVelocityTracker,
pointerId));
break;
@@ -150,8 +150,8 @@
}
</pre>
-<p class="note"><strong>Note:</strong> Note that you should calculate velocity after an
-{@link android.view.MotionEvent#ACTION_MOVE} event,
-not after {@link android.view.MotionEvent#ACTION_UP}. After an {@link android.view.MotionEvent#ACTION_UP},
+<p class="note"><strong>Note:</strong> Note that you should calculate velocity after an
+{@link android.view.MotionEvent#ACTION_MOVE} event,
+not after {@link android.view.MotionEvent#ACTION_UP}. After an {@link android.view.MotionEvent#ACTION_UP},
the X and Y velocities will be 0.
</p>
diff --git a/docs/html/training/gestures/multi.jd b/docs/html/training/gestures/multi.jd
index 5840482..21860fc 100644
--- a/docs/html/training/gestures/multi.jd
+++ b/docs/html/training/gestures/multi.jd
@@ -47,15 +47,15 @@
<h2 id="track">Track Multiple Pointers</h2>
-<p>When multiple pointers touch the screen at the same time, the system generates the
+<p>When multiple pointers touch the screen at the same time, the system generates the
following touch events:</p>
<ul>
- <li>{@link android.view.MotionEvent#ACTION_DOWN}—For the first pointer that
-touches the screen. This starts the gesture. The pointer data for this pointer is
+ <li>{@link android.view.MotionEvent#ACTION_DOWN}—For the first pointer that
+touches the screen. This starts the gesture. The pointer data for this pointer is
always at index 0 in the {@link android.view.MotionEvent}.</li>
- <li>{@link android.support.v4.view.MotionEventCompat#ACTION_POINTER_DOWN}—For
-extra pointers that enter the screen beyond the first. The pointer data for this
+ <li>{@link android.support.v4.view.MotionEventCompat#ACTION_POINTER_DOWN}—For
+extra pointers that enter the screen beyond the first. The pointer data for this
pointer is at the index returned by {@link android.support.v4.view.MotionEventCompat#getActionIndex getActionIndex()}.</li>
<li>{@link android.view.MotionEvent#ACTION_MOVE}—A change has happened during a press gesture.</li>
<li>{@link android.support.v4.view.MotionEventCompat#ACTION_POINTER_UP}—Sent when a non-primary pointer goes up.</li>
@@ -66,20 +66,20 @@
android.view.MotionEvent} via each pointer's index and ID:</p>
<ul>
-<li><strong>Index</strong>: A {@link android.view.MotionEvent} effectively
-stores information about each pointer in an array. The index of a pointer is its position
+<li><strong>Index</strong>: A {@link android.view.MotionEvent} effectively
+stores information about each pointer in an array. The index of a pointer is its position
within this array. Most of the {@link
android.view.MotionEvent} methods you use to interact with pointers take the
pointer index as a parameter, not the pointer ID. </li>
-
-
+
+
<li><strong>ID</strong>: Each pointer also has an ID mapping that stays
-persistent across touch events to allow tracking an individual pointer across
+persistent across touch events to allow tracking an individual pointer across
the entire gesture.</li>
-
+
</ul>
-<p>The order in which individual pointers appear within a motion event is
+<p>The order in which individual pointers appear within a motion event is
undefined. Thus the index of a pointer can change from one event to the
next, but the pointer ID of a pointer is guaranteed to remain constant as long
as the pointer remains active. Use the {@link
@@ -91,7 +91,7 @@
<pre>private int mActivePointerId;
-
+
public boolean onTouchEvent(MotionEvent event) {
....
// Get the pointer ID
@@ -99,7 +99,7 @@
// ... Many touch events later...
- // Use the pointer ID to find the index of the active pointer
+ // Use the pointer ID to find the index of the active pointer
// and fetch its position
int pointerIndex = event.findPointerIndex(mActivePointerId);
// Get the pointer's current position
@@ -109,25 +109,25 @@
<h2 id="action">Get a MotionEvent's Action</h2>
-<p>You should always use the method
-{@link android.view.MotionEvent#getActionMasked getActionMasked()} (or better yet, the compatability version
-{@link android.support.v4.view.MotionEventCompat#getActionMasked MotionEventCompat.getActionMasked()}) to retrieve
+<p>You should always use the method
+{@link android.view.MotionEvent#getActionMasked getActionMasked()} (or better yet, the compatability version
+{@link android.support.v4.view.MotionEventCompat#getActionMasked MotionEventCompat.getActionMasked()}) to retrieve
the action of a
-{@link android.view.MotionEvent}. Unlike the older {@link android.view.MotionEvent#getAction getAction()}
-method, {@link android.support.v4.view.MotionEventCompat#getActionMasked getActionMasked()} is designed to work with
-multiple pointers. It returns the masked action
-being performed, without including the pointer index bits. You can then use
-{@link android.support.v4.view.MotionEventCompat#getActionIndex getActionIndex()} to return the index of
+{@link android.view.MotionEvent}. Unlike the older {@link android.view.MotionEvent#getAction getAction()}
+method, {@link android.support.v4.view.MotionEventCompat#getActionMasked getActionMasked()} is designed to work with
+multiple pointers. It returns the masked action
+being performed, without including the pointer index bits. You can then use
+{@link android.support.v4.view.MotionEventCompat#getActionIndex getActionIndex()} to return the index of
the pointer associated with the action. This is illustrated in the snippet below.</p>
-<p class="note"><strong>Note:</strong> This example uses the
+<p class="note"><strong>Note:</strong> This example uses the
{@link android.support.v4.view.MotionEventCompat}
-class. This class is in the
+class. This class is in the
<a href="{@docRoot}tools/support-library/index.html">Support Library</a>. You should use
{@link android.support.v4.view.MotionEventCompat} to provide the best support for a wide range of
-platforms. Note that {@link android.support.v4.view.MotionEventCompat} is <em>not</em> a
-replacement for the {@link android.view.MotionEvent} class. Rather, it provides static utility
-methods to which you pass your {@link android.view.MotionEvent} object in order to receive
+platforms. Note that {@link android.support.v4.view.MotionEventCompat} is <em>not</em> a
+replacement for the {@link android.view.MotionEvent} class. Rather, it provides static utility
+methods to which you pass your {@link android.view.MotionEvent} object in order to receive
the desired action associated with that event.</p>
<pre>int action = MotionEventCompat.getActionMasked(event);
@@ -137,17 +137,17 @@
int yPos = -1;
Log.d(DEBUG_TAG,"The action is " + actionToString(action));
-
+
if (event.getPointerCount() > 1) {
- Log.d(DEBUG_TAG,"Multitouch event");
- // The coordinates of the current screen contact, relative to
- // the responding View or Activity.
+ Log.d(DEBUG_TAG,"Multitouch event");
+ // The coordinates of the current screen contact, relative to
+ // the responding View or Activity.
xPos = (int)MotionEventCompat.getX(event, index);
yPos = (int)MotionEventCompat.getY(event, index);
} else {
// Single touch event
- Log.d(DEBUG_TAG,"Single touch event");
+ Log.d(DEBUG_TAG,"Single touch event");
xPos = (int)MotionEventCompat.getX(event, index);
yPos = (int)MotionEventCompat.getY(event, index);
}
@@ -156,7 +156,7 @@
// Given an action int, returns a string description
public static String actionToString(int action) {
switch (action) {
-
+
case MotionEvent.ACTION_DOWN: return "Down";
case MotionEvent.ACTION_MOVE: return "Move";
case MotionEvent.ACTION_POINTER_DOWN: return "Pointer Down";
@@ -168,7 +168,7 @@
return "";
}</pre>
-
+
<p>For more discussion of multi-touch and some examples, see the lesson <a href="scale.html">Dragging and Scaling</a>.
diff --git a/docs/html/training/gestures/scale.jd b/docs/html/training/gestures/scale.jd
index f2e4eb8..d4aa916 100644
--- a/docs/html/training/gestures/scale.jd
+++ b/docs/html/training/gestures/scale.jd
@@ -44,13 +44,13 @@
<p>This lesson describes how to use touch gestures to drag and scale on-screen
objects, using {@link android.view.View#onTouchEvent onTouchEvent()} to intercept
-touch events.
+touch events.
</p>
<h2 id="drag">Drag an Object</h2>
-<p class="note">If you are targeting Android 3.0 or higher, you can use the built-in drag-and-drop event
-listeners with {@link android.view.View.OnDragListener}, as described in
+<p class="note">If you are targeting Android 3.0 or higher, you can use the built-in drag-and-drop event
+listeners with {@link android.view.View.OnDragListener}, as described in
<a href="{@docRoot}guide/topics/ui/drag-drop.html">Drag and Drop</a>.
<p>A common operation for a touch gesture is to use it to drag an object across
@@ -66,14 +66,14 @@
individual pointers, it will regard the second pointer as the default and move
the image to that location.</li>
-<li>To prevent this from happening, your app needs to distinguish between the
-original pointer and any follow-on pointers. To do this, it tracks the
-{@link android.view.MotionEvent#ACTION_POINTER_DOWN} and
-{@link android.view.MotionEvent#ACTION_POINTER_UP} events described in
-<a href="multi.html">Handling Multi-Touch Gestures</a>.
-{@link android.view.MotionEvent#ACTION_POINTER_DOWN} and
-{@link android.view.MotionEvent#ACTION_POINTER_UP} are
-passed to the {@link android.view.View#onTouchEvent onTouchEvent()} callback
+<li>To prevent this from happening, your app needs to distinguish between the
+original pointer and any follow-on pointers. To do this, it tracks the
+{@link android.view.MotionEvent#ACTION_POINTER_DOWN} and
+{@link android.view.MotionEvent#ACTION_POINTER_UP} events described in
+<a href="multi.html">Handling Multi-Touch Gestures</a>.
+{@link android.view.MotionEvent#ACTION_POINTER_DOWN} and
+{@link android.view.MotionEvent#ACTION_POINTER_UP} are
+passed to the {@link android.view.View#onTouchEvent onTouchEvent()} callback
whenever a secondary pointer goes down or up. </li>
@@ -90,16 +90,16 @@
<p>The following snippet enables a user to drag an object around on the screen. It records the initial
position of the active pointer, calculates the distance the pointer traveled, and moves the object to the
new position. It correctly manages the possibility of additional pointers, as described
-above.</p>
+above.</p>
-<p>Notice that the snippet uses the {@link android.view.MotionEvent#getActionMasked getActionMasked()} method.
-You should always use this method (or better yet, the compatability version
-{@link android.support.v4.view.MotionEventCompat#getActionMasked MotionEventCompat.getActionMasked()})
+<p>Notice that the snippet uses the {@link android.view.MotionEvent#getActionMasked getActionMasked()} method.
+You should always use this method (or better yet, the compatability version
+{@link android.support.v4.view.MotionEventCompat#getActionMasked MotionEventCompat.getActionMasked()})
to retrieve the action of a
-{@link android.view.MotionEvent}. Unlike the older
-{@link android.view.MotionEvent#getAction getAction()}
-method, {@link android.support.v4.view.MotionEventCompat#getActionMasked getActionMasked()}
-is designed to work with multiple pointers. It returns the masked action
+{@link android.view.MotionEvent}. Unlike the older
+{@link android.view.MotionEvent#getAction getAction()}
+method, {@link android.support.v4.view.MotionEventCompat#getActionMasked getActionMasked()}
+is designed to work with multiple pointers. It returns the masked action
being performed, without including the pointer index bits.</p>
<pre>// The ‘active pointer’ is the one currently moving our object.
@@ -109,15 +109,15 @@
public boolean onTouchEvent(MotionEvent ev) {
// Let the ScaleGestureDetector inspect all events.
mScaleDetector.onTouchEvent(ev);
-
- final int action = MotionEventCompat.getActionMasked(ev);
-
- switch (action) {
+
+ final int action = MotionEventCompat.getActionMasked(ev);
+
+ switch (action) {
case MotionEvent.ACTION_DOWN: {
- final int pointerIndex = MotionEventCompat.getActionIndex(ev);
- final float x = MotionEventCompat.getX(ev, pointerIndex);
- final float y = MotionEventCompat.getY(ev, pointerIndex);
-
+ final int pointerIndex = MotionEventCompat.getActionIndex(ev);
+ final float x = MotionEventCompat.getX(ev, pointerIndex);
+ final float y = MotionEventCompat.getY(ev, pointerIndex);
+
// Remember where we started (for dragging)
mLastTouchX = x;
mLastTouchY = y;
@@ -125,15 +125,15 @@
mActivePointerId = MotionEventCompat.getPointerId(ev, 0);
break;
}
-
+
case MotionEvent.ACTION_MOVE: {
// Find the index of the active pointer and fetch its position
- final int pointerIndex =
- MotionEventCompat.findPointerIndex(ev, mActivePointerId);
-
+ final int pointerIndex =
+ MotionEventCompat.findPointerIndex(ev, mActivePointerId);
+
final float x = MotionEventCompat.getX(ev, pointerIndex);
final float y = MotionEventCompat.getY(ev, pointerIndex);
-
+
// Calculate the distance moved
final float dx = x - mLastTouchX;
final float dy = y - mLastTouchY;
@@ -149,62 +149,62 @@
break;
}
-
+
case MotionEvent.ACTION_UP: {
mActivePointerId = INVALID_POINTER_ID;
break;
}
-
+
case MotionEvent.ACTION_CANCEL: {
mActivePointerId = INVALID_POINTER_ID;
break;
}
-
+
case MotionEvent.ACTION_POINTER_UP: {
-
- final int pointerIndex = MotionEventCompat.getActionIndex(ev);
- final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex);
+
+ final int pointerIndex = MotionEventCompat.getActionIndex(ev);
+ final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex);
if (pointerId == mActivePointerId) {
// This was our active pointer going up. Choose a new
// active pointer and adjust accordingly.
final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
- mLastTouchX = MotionEventCompat.getX(ev, newPointerIndex);
- mLastTouchY = MotionEventCompat.getY(ev, newPointerIndex);
+ mLastTouchX = MotionEventCompat.getX(ev, newPointerIndex);
+ mLastTouchY = MotionEventCompat.getY(ev, newPointerIndex);
mActivePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex);
}
break;
}
- }
+ }
return true;
}</pre>
<h2 id="pan">Drag to Pan</h2>
-<p>The previous section showed an example of dragging an object around the screen. Another
-common scenario is <em>panning</em>, which is when a user's dragging motion causes scrolling
-in both the x and y axes. The above snippet directly intercepted the {@link android.view.MotionEvent}
-actions to implement dragging. The snippet in this section takes advantage of the platform's
-built-in support for common gestures. It overrides
-{@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()} in
+<p>The previous section showed an example of dragging an object around the screen. Another
+common scenario is <em>panning</em>, which is when a user's dragging motion causes scrolling
+in both the x and y axes. The above snippet directly intercepted the {@link android.view.MotionEvent}
+actions to implement dragging. The snippet in this section takes advantage of the platform's
+built-in support for common gestures. It overrides
+{@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()} in
{@link android.view.GestureDetector.SimpleOnGestureListener}.</p>
-<p>To provide a little more context, {@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()}
-is called when a user is dragging his finger to pan the content.
-{@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()} is only called when
-a finger is down; as soon as the finger is lifted from the screen, the gesture either ends,
-or a fling gesture is started (if the finger was moving with some speed just before it was lifted).
+<p>To provide a little more context, {@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()}
+is called when a user is dragging his finger to pan the content.
+{@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()} is only called when
+a finger is down; as soon as the finger is lifted from the screen, the gesture either ends,
+or a fling gesture is started (if the finger was moving with some speed just before it was lifted).
For more discussion of scrolling vs. flinging, see <a href="scroll.html">Animating a Scroll Gesture</a>.</p>
<p>Here is the snippet for {@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()}:
-<pre>// The current viewport. This rectangle represents the currently visible
-// chart domain and range.
-private RectF mCurrentViewport =
+<pre>// The current viewport. This rectangle represents the currently visible
+// chart domain and range.
+private RectF mCurrentViewport =
new RectF(AXIS_X_MIN, AXIS_Y_MIN, AXIS_X_MAX, AXIS_Y_MAX);
-// The current destination rectangle (in pixel coordinates) into which the
+// The current destination rectangle (in pixel coordinates) into which the
// chart data should be drawn.
private Rect mContentRect;
@@ -213,18 +213,18 @@
...
@Override
-public boolean onScroll(MotionEvent e1, MotionEvent e2,
+public boolean onScroll(MotionEvent e1, MotionEvent e2,
float distanceX, float distanceY) {
// Scrolling uses math based on the viewport (as opposed to math using pixels).
-
+
// Pixel offset is the offset in screen pixels, while viewport offset is the
- // offset within the current viewport.
- float viewportOffsetX = distanceX * mCurrentViewport.width()
+ // offset within the current viewport.
+ float viewportOffsetX = distanceX * mCurrentViewport.width()
/ mContentRect.width();
- float viewportOffsetY = -distanceY * mCurrentViewport.height()
+ float viewportOffsetY = -distanceY * mCurrentViewport.height()
/ mContentRect.height();
...
- // Updates the viewport, refreshes the display.
+ // Updates the viewport, refreshes the display.
setViewportBottomLeft(
mCurrentViewport.left + viewportOffsetX,
mCurrentViewport.bottom + viewportOffsetY);
@@ -232,20 +232,20 @@
return true;
}</pre>
-<p>The implementation of {@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()}
+<p>The implementation of {@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()}
scrolls the viewport in response to the touch gesture:</p>
<pre>
/**
* Sets the current viewport (defined by mCurrentViewport) to the given
- * X and Y positions. Note that the Y value represents the topmost pixel position,
+ * X and Y positions. Note that the Y value represents the topmost pixel position,
* and thus the bottom of the mCurrentViewport rectangle.
*/
private void setViewportBottomLeft(float x, float y) {
/*
- * Constrains within the scroll range. The scroll range is simply the viewport
- * extremes (AXIS_X_MAX, etc.) minus the viewport size. For example, if the
- * extremes were 0 and 10, and the viewport size was 2, the scroll range would
+ * Constrains within the scroll range. The scroll range is simply the viewport
+ * extremes (AXIS_X_MAX, etc.) minus the viewport size. For example, if the
+ * extremes were 0 and 10, and the viewport size was 2, the scroll range would
* be 0 to 8.
*/
@@ -270,11 +270,11 @@
android.view.GestureDetector} and {@link android.view.ScaleGestureDetector} can
be used together when you want a view to recognize additional gestures.</p>
-<p>To report detected gesture events, gesture detectors use listener objects
-passed to their constructors. {@link android.view.ScaleGestureDetector} uses
-{@link android.view.ScaleGestureDetector.OnScaleGestureListener}.
-Android provides
-{@link android.view.ScaleGestureDetector.SimpleOnScaleGestureListener}
+<p>To report detected gesture events, gesture detectors use listener objects
+passed to their constructors. {@link android.view.ScaleGestureDetector} uses
+{@link android.view.ScaleGestureDetector.OnScaleGestureListener}.
+Android provides
+{@link android.view.ScaleGestureDetector.SimpleOnScaleGestureListener}
as a helper class that you can extend if you don’t care about all of the reported events.</p>
@@ -311,7 +311,7 @@
canvas.restore();
}
-private class ScaleListener
+private class ScaleListener
extends ScaleGestureDetector.SimpleOnScaleGestureListener {
@Override
public boolean onScale(ScaleGestureDetector detector) {
@@ -329,14 +329,14 @@
<h3>More complex scaling example</h3>
-<p>Here is a more complex example from the {@code InteractiveChart} sample provided with this class.
+<p>Here is a more complex example from the {@code InteractiveChart} sample provided with this class.
The {@code InteractiveChart} sample supports both scrolling (panning) and scaling with multiple fingers,
-using the {@link android.view.ScaleGestureDetector} "span"
-({@link android.view.ScaleGestureDetector#getCurrentSpanX getCurrentSpanX/Y}) and
+using the {@link android.view.ScaleGestureDetector} "span"
+({@link android.view.ScaleGestureDetector#getCurrentSpanX getCurrentSpanX/Y}) and
"focus" ({@link android.view.ScaleGestureDetector#getFocusX getFocusX/Y}) features:</p>
<pre>@Override
-private RectF mCurrentViewport =
+private RectF mCurrentViewport =
new RectF(AXIS_X_MIN, AXIS_Y_MIN, AXIS_X_MAX, AXIS_Y_MAX);
private Rect mContentRect;
private ScaleGestureDetector mScaleGestureDetector;
@@ -399,7 +399,7 @@
0,
0);
mCurrentViewport.right = mCurrentViewport.left + newWidth;
- mCurrentViewport.bottom = mCurrentViewport.top + newHeight;
+ mCurrentViewport.bottom = mCurrentViewport.top + newHeight;
...
// Invalidates the View to update the display.
ViewCompat.postInvalidateOnAnimation(InteractiveLineGraphView.this);
diff --git a/docs/html/training/gestures/scroll.jd b/docs/html/training/gestures/scroll.jd
index 4b82d69..374ceff 100644
--- a/docs/html/training/gestures/scroll.jd
+++ b/docs/html/training/gestures/scroll.jd
@@ -41,12 +41,12 @@
</div>
</div>
-<p>In Android, scrolling is typically achieved by using the
+<p>In Android, scrolling is typically achieved by using the
{@link android.widget.ScrollView}
-class. Any standard layout that might extend beyond the bounds of its container should be
-nested in a {@link android.widget.ScrollView} to provide a scrollable view that's
-managed by the framework. Implementing a custom scroller should only be
-necessary for special scenarios. This lesson describes such a scenario: displaying
+class. Any standard layout that might extend beyond the bounds of its container should be
+nested in a {@link android.widget.ScrollView} to provide a scrollable view that's
+managed by the framework. Implementing a custom scroller should only be
+necessary for special scenarios. This lesson describes such a scenario: displaying
a scrolling effect in response to touch gestures using <em>scrollers</em>.
@@ -54,8 +54,8 @@
android.widget.OverScroller}) to collect the data you need to produce a
scrolling animation in response to a touch event. They are similar, but
{@link android.widget.OverScroller}
-includes methods for indicating to users that they've reached the content edges
-after a pan or fling gesture. The {@code InteractiveChart} sample
+includes methods for indicating to users that they've reached the content edges
+after a pan or fling gesture. The {@code InteractiveChart} sample
uses the {@link android.widget.EdgeEffect} class
(actually the {@link android.support.v4.widget.EdgeEffectCompat} class)
to display a "glow" effect when users reach the content edges.</p>
@@ -68,7 +68,7 @@
<br />
Also note that you generally only need to use scrollers
when implementing scrolling yourself. {@link android.widget.ScrollView} and
-{@link android.widget.HorizontalScrollView} do all of this for you if you nest your
+{@link android.widget.HorizontalScrollView} do all of this for you if you nest your
layout within them.
</p>
@@ -86,71 +86,71 @@
<p>"Scrolling" is a word that can take on different meanings in Android, depending on the context.</p>
-<p><strong>Scrolling</strong> is the general process of moving the viewport (that is, the 'window'
-of content you're looking at). When scrolling is in both the x and y axes, it's called
-<em>panning</em>. The sample application provided with this class, {@code InteractiveChart}, illustrates
+<p><strong>Scrolling</strong> is the general process of moving the viewport (that is, the 'window'
+of content you're looking at). When scrolling is in both the x and y axes, it's called
+<em>panning</em>. The sample application provided with this class, {@code InteractiveChart}, illustrates
two different types of scrolling, dragging and flinging:</p>
<ul>
- <li><strong>Dragging</strong> is the type of scrolling that occurs when a user drags her
-finger across the touch screen. Simple dragging is often implemented by overriding
-{@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()} in
-{@link android.view.GestureDetector.OnGestureListener}. For more discussion of dragging, see
+ <li><strong>Dragging</strong> is the type of scrolling that occurs when a user drags her
+finger across the touch screen. Simple dragging is often implemented by overriding
+{@link android.view.GestureDetector.OnGestureListener#onScroll onScroll()} in
+{@link android.view.GestureDetector.OnGestureListener}. For more discussion of dragging, see
<a href="scale.html">Dragging and Scaling</a>.</li>
- <li><strong>Flinging</strong> is the type of scrolling that occurs when a user
-drags and lifts her finger quickly. After the user lifts her finger, you generally
-want to keep scrolling (moving the viewport), but decelerate until the viewport stops moving.
-Flinging can be implemented by overriding
-{@link android.view.GestureDetector.OnGestureListener#onFling onFling()}
-in {@link android.view.GestureDetector.OnGestureListener}, and by using
-a scroller object. This is the use
+ <li><strong>Flinging</strong> is the type of scrolling that occurs when a user
+drags and lifts her finger quickly. After the user lifts her finger, you generally
+want to keep scrolling (moving the viewport), but decelerate until the viewport stops moving.
+Flinging can be implemented by overriding
+{@link android.view.GestureDetector.OnGestureListener#onFling onFling()}
+in {@link android.view.GestureDetector.OnGestureListener}, and by using
+a scroller object. This is the use
case that is the topic of this lesson.</li>
</ul>
-<p>It's common to use scroller objects
+<p>It's common to use scroller objects
in conjunction with a fling gesture, but they
can be used in pretty much any context where you want the UI to display
-scrolling in response to a touch event. For example, you could override
-{@link android.view.View#onTouchEvent onTouchEvent()} to process touch
-events directly, and produce a scrolling effect or a "snapping to page" animation
+scrolling in response to a touch event. For example, you could override
+{@link android.view.View#onTouchEvent onTouchEvent()} to process touch
+events directly, and produce a scrolling effect or a "snapping to page" animation
in response to those touch events.</p>
-<h2 id="#scroll">Implement Touch-Based Scrolling</h2>
+<h2 id="#scroll">Implement Touch-Based Scrolling</h2>
<p>This section describes how to use a scroller.
-The snippet shown below comes from the {@code InteractiveChart} sample
+The snippet shown below comes from the {@code InteractiveChart} sample
provided with this class.
-It uses a
-{@link android.view.GestureDetector}, and overrides the
-{@link android.view.GestureDetector.SimpleOnGestureListener} method
+It uses a
+{@link android.view.GestureDetector}, and overrides the
+{@link android.view.GestureDetector.SimpleOnGestureListener} method
{@link android.view.GestureDetector.OnGestureListener#onFling onFling()}.
It uses {@link android.widget.OverScroller} to track the fling gesture.
-If the user reaches the content edges
+If the user reaches the content edges
after the fling gesture, the app displays a "glow" effect.
</p>
-<p class="note"><strong>Note:</strong> The {@code InteractiveChart} sample app displays a
-chart that you can zoom, pan, scroll, and so on. In the following snippet,
-{@code mContentRect} represents the rectangle coordinates within the view that the chart
-will be drawn into. At any given time, a subset of the total chart domain and range are drawn
-into this rectangular area.
-{@code mCurrentViewport} represents the portion of the chart that is currently
-visible in the screen. Because pixel offsets are generally treated as integers,
-{@code mContentRect} is of the type {@link android.graphics.Rect}. Because the
-graph domain and range are decimal/float values, {@code mCurrentViewport} is of
+<p class="note"><strong>Note:</strong> The {@code InteractiveChart} sample app displays a
+chart that you can zoom, pan, scroll, and so on. In the following snippet,
+{@code mContentRect} represents the rectangle coordinates within the view that the chart
+will be drawn into. At any given time, a subset of the total chart domain and range are drawn
+into this rectangular area.
+{@code mCurrentViewport} represents the portion of the chart that is currently
+visible in the screen. Because pixel offsets are generally treated as integers,
+{@code mContentRect} is of the type {@link android.graphics.Rect}. Because the
+graph domain and range are decimal/float values, {@code mCurrentViewport} is of
the type {@link android.graphics.RectF}.</p>
-<p>The first part of the snippet shows the implementation of
+<p>The first part of the snippet shows the implementation of
{@link android.view.GestureDetector.OnGestureListener#onFling onFling()}:</p>
-<pre>// The current viewport. This rectangle represents the currently visible
+<pre>// The current viewport. This rectangle represents the currently visible
// chart domain and range. The viewport is the part of the app that the
// user manipulates via touch gestures.
-private RectF mCurrentViewport =
+private RectF mCurrentViewport =
new RectF(AXIS_X_MIN, AXIS_Y_MIN, AXIS_X_MAX, AXIS_Y_MAX);
-// The current destination rectangle (in pixel coordinates) into which the
+// The current destination rectangle (in pixel coordinates) into which the
// chart data should be drawn.
private Rect mContentRect;
@@ -171,7 +171,7 @@
}
...
@Override
- public boolean onFling(MotionEvent e1, MotionEvent e2,
+ public boolean onFling(MotionEvent e1, MotionEvent e2,
float velocityX, float velocityY) {
fling((int) -velocityX, (int) -velocityY);
return true;
@@ -184,10 +184,10 @@
// Flings use math in pixels (as opposed to math based on the viewport).
Point surfaceSize = computeScrollSurfaceSize();
mScrollerStartViewport.set(mCurrentViewport);
- int startX = (int) (surfaceSize.x * (mScrollerStartViewport.left -
+ int startX = (int) (surfaceSize.x * (mScrollerStartViewport.left -
AXIS_X_MIN) / (
AXIS_X_MAX - AXIS_X_MIN));
- int startY = (int) (surfaceSize.y * (AXIS_Y_MAX -
+ int startY = (int) (surfaceSize.y * (AXIS_Y_MAX -
mScrollerStartViewport.bottom) / (
AXIS_Y_MAX - AXIS_Y_MIN));
// Before flinging, aborts the current animation.
@@ -200,10 +200,10 @@
velocityX,
velocityY,
/*
- * Minimum and maximum scroll positions. The minimum scroll
- * position is generally zero and the maximum scroll position
- * is generally the content size less the screen size. So if the
- * content width is 1000 pixels and the screen width is 200
+ * Minimum and maximum scroll positions. The minimum scroll
+ * position is generally zero and the maximum scroll position
+ * is generally the content size less the screen size. So if the
+ * content width is 1000 pixels and the screen width is 200
* pixels, the maximum scroll offset should be 800 pixels.
*/
0, surfaceSize.x - mContentRect.width(),
@@ -216,21 +216,21 @@
ViewCompat.postInvalidateOnAnimation(this);
}</pre>
-<p>When {@link android.view.GestureDetector.OnGestureListener#onFling onFling()} calls
-{@link android.support.v4.view.ViewCompat#postInvalidateOnAnimation postInvalidateOnAnimation()},
-it triggers
-{@link android.view.View#computeScroll computeScroll()} to update the values for x and y.
+<p>When {@link android.view.GestureDetector.OnGestureListener#onFling onFling()} calls
+{@link android.support.v4.view.ViewCompat#postInvalidateOnAnimation postInvalidateOnAnimation()},
+it triggers
+{@link android.view.View#computeScroll computeScroll()} to update the values for x and y.
This is typically be done when a view child is animating a scroll using a scroller object, as in this example. </p>
-<p>Most views pass the scroller object's x and y position directly to
-{@link android.view.View#scrollTo scrollTo()}.
-The following implementation of {@link android.view.View#computeScroll computeScroll()}
-takes a different approach—it calls
-{@link android.widget.OverScroller#computeScrollOffset computeScrollOffset()} to get the current
-location of x and y. When the criteria for displaying an overscroll "glow" edge effect are met
-(the display is zoomed in, x or y is out of bounds, and the app isn't already showing an overscroll),
-the code sets up the overscroll glow effect and calls
-{@link android.support.v4.view.ViewCompat#postInvalidateOnAnimation postInvalidateOnAnimation()}
+<p>Most views pass the scroller object's x and y position directly to
+{@link android.view.View#scrollTo scrollTo()}.
+The following implementation of {@link android.view.View#computeScroll computeScroll()}
+takes a different approach—it calls
+{@link android.widget.OverScroller#computeScrollOffset computeScrollOffset()} to get the current
+location of x and y. When the criteria for displaying an overscroll "glow" edge effect are met
+(the display is zoomed in, x or y is out of bounds, and the app isn't already showing an overscroll),
+the code sets up the overscroll glow effect and calls
+{@link android.support.v4.view.ViewCompat#postInvalidateOnAnimation postInvalidateOnAnimation()}
to trigger an invalidate on the view:</p>
<pre>// Edge effect / overscroll tracking objects.
@@ -250,7 +250,7 @@
boolean needsInvalidate = false;
- // The scroller isn't finished, meaning a fling or programmatic pan
+ // The scroller isn't finished, meaning a fling or programmatic pan
// operation is currently active.
if (mScroller.computeScrollOffset()) {
Point surfaceSize = computeScrollSurfaceSize();
@@ -262,7 +262,7 @@
boolean canScrollY = (mCurrentViewport.top > AXIS_Y_MIN
|| mCurrentViewport.bottom < AXIS_Y_MAX);
- /*
+ /*
* If you are zoomed in and currX or currY is
* outside of bounds and you're not already
* showing overscroll, then render the overscroll
@@ -272,7 +272,7 @@
&& currX < 0
&& mEdgeEffectLeft.isFinished()
&& !mEdgeEffectLeftActive) {
- mEdgeEffectLeft.onAbsorb((int)
+ mEdgeEffectLeft.onAbsorb((int)
OverScrollerCompat.getCurrVelocity(mScroller));
mEdgeEffectLeftActive = true;
needsInvalidate = true;
@@ -280,7 +280,7 @@
&& currX > (surfaceSize.x - mContentRect.width())
&& mEdgeEffectRight.isFinished()
&& !mEdgeEffectRightActive) {
- mEdgeEffectRight.onAbsorb((int)
+ mEdgeEffectRight.onAbsorb((int)
OverScrollerCompat.getCurrVelocity(mScroller));
mEdgeEffectRightActive = true;
needsInvalidate = true;
@@ -290,7 +290,7 @@
&& currY < 0
&& mEdgeEffectTop.isFinished()
&& !mEdgeEffectTopActive) {
- mEdgeEffectTop.onAbsorb((int)
+ mEdgeEffectTop.onAbsorb((int)
OverScrollerCompat.getCurrVelocity(mScroller));
mEdgeEffectTopActive = true;
needsInvalidate = true;
@@ -298,7 +298,7 @@
&& currY > (surfaceSize.y - mContentRect.height())
&& mEdgeEffectBottom.isFinished()
&& !mEdgeEffectBottomActive) {
- mEdgeEffectBottom.onAbsorb((int)
+ mEdgeEffectBottom.onAbsorb((int)
OverScrollerCompat.getCurrVelocity(mScroller));
mEdgeEffectBottomActive = true;
needsInvalidate = true;
@@ -316,14 +316,14 @@
// If a zoom is in progress (either programmatically or via double
// touch), performs the zoom.
if (mZoomer.computeZoom()) {
- float newWidth = (1f - mZoomer.getCurrZoom()) *
+ float newWidth = (1f - mZoomer.getCurrZoom()) *
mScrollerStartViewport.width();
- float newHeight = (1f - mZoomer.getCurrZoom()) *
+ float newHeight = (1f - mZoomer.getCurrZoom()) *
mScrollerStartViewport.height();
- float pointWithinViewportX = (mZoomFocalPoint.x -
+ float pointWithinViewportX = (mZoomFocalPoint.x -
mScrollerStartViewport.left)
/ mScrollerStartViewport.width();
- float pointWithinViewportY = (mZoomFocalPoint.y -
+ float pointWithinViewportY = (mZoomFocalPoint.y -
mScrollerStartViewport.top)
/ mScrollerStartViewport.height();
mCurrentViewport.set(
@@ -339,9 +339,9 @@
}
</pre>
-<p>This is the {@code computeScrollSurfaceSize()} method that's called in the above snippet. It
-computes the current scrollable surface size, in pixels. For example, if the entire chart area is visible,
-this is simply the current size of {@code mContentRect}. If the chart is zoomed in 200% in both directions,
+<p>This is the {@code computeScrollSurfaceSize()} method that's called in the above snippet. It
+computes the current scrollable surface size, in pixels. For example, if the entire chart area is visible,
+this is simply the current size of {@code mContentRect}. If the chart is zoomed in 200% in both directions,
the returned size will be twice as large horizontally and vertically.</p>
<pre>private Point computeScrollSurfaceSize() {
@@ -352,8 +352,8 @@
/ mCurrentViewport.height()));
}</pre>
-<p>For another example of scroller usage, see the
-<a href="http://github.com/android/platform_frameworks_support/blob/master/v4/java/android/support/v4/view/ViewPager.java">source code</a> for the
-{@link android.support.v4.view.ViewPager} class. It scrolls in response to flings,
+<p>For another example of scroller usage, see the
+<a href="http://github.com/android/platform_frameworks_support/blob/master/v4/java/android/support/v4/view/ViewPager.java">source code</a> for the
+{@link android.support.v4.view.ViewPager} class. It scrolls in response to flings,
and uses scrolling to implement the "snapping to page" animation.</p>
diff --git a/docs/html/training/gestures/viewgroup.jd b/docs/html/training/gestures/viewgroup.jd
index 5b32300..7b5b24e 100644
--- a/docs/html/training/gestures/viewgroup.jd
+++ b/docs/html/training/gestures/viewgroup.jd
@@ -52,38 +52,38 @@
<h2 id="intercept">Intercept Touch Events in a ViewGroup</h2>
-<p>The {@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()}
-method is called whenever a touch event is detected on the surface of a
-{@link android.view.ViewGroup}, including on the surface of its children. If
-{@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()}
-returns {@code true}, the {@link android.view.MotionEvent} is intercepted,
-meaning it will be not be passed on to the child, but rather to the
+<p>The {@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()}
+method is called whenever a touch event is detected on the surface of a
+{@link android.view.ViewGroup}, including on the surface of its children. If
+{@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()}
+returns {@code true}, the {@link android.view.MotionEvent} is intercepted,
+meaning it will be not be passed on to the child, but rather to the
{@link android.view.View#onTouchEvent onTouchEvent()} method of the parent.</p>
-<p>The {@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()}
-method gives a parent the chance to see any touch event before its children do.
-If you return {@code true} from
-{@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()},
-the child view that was previously handling touch events
-receives an {@link android.view.MotionEvent#ACTION_CANCEL}, and the events from that
-point forward are sent to the parent's
-{@link android.view.View#onTouchEvent onTouchEvent()} method for the usual handling.
-{@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()} can also
-return {@code false} and simply spy on events as they travel down the view hierarchy
+<p>The {@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()}
+method gives a parent the chance to see any touch event before its children do.
+If you return {@code true} from
+{@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()},
+the child view that was previously handling touch events
+receives an {@link android.view.MotionEvent#ACTION_CANCEL}, and the events from that
+point forward are sent to the parent's
+{@link android.view.View#onTouchEvent onTouchEvent()} method for the usual handling.
+{@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()} can also
+return {@code false} and simply spy on events as they travel down the view hierarchy
to their usual targets, which will handle the events with their own
{@link android.view.View#onTouchEvent onTouchEvent()}.
-<p>In the following snippet, the class {@code MyViewGroup} extends
-{@link android.view.ViewGroup}.
-{@code MyViewGroup} contains multiple child views. If you drag your finger across
-a child view horizontally, the child view should no longer get touch events, and
-{@code MyViewGroup} should handle touch events by scrolling its contents. However,
-if you press buttons in the child view, or scroll the child view vertically,
-the parent shouldn't intercept those touch events, because the child is the
-intended target. In those cases,
+<p>In the following snippet, the class {@code MyViewGroup} extends
+{@link android.view.ViewGroup}.
+{@code MyViewGroup} contains multiple child views. If you drag your finger across
+a child view horizontally, the child view should no longer get touch events, and
+{@code MyViewGroup} should handle touch events by scrolling its contents. However,
+if you press buttons in the child view, or scroll the child view vertically,
+the parent shouldn't intercept those touch events, because the child is the
+intended target. In those cases,
{@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()} should
-return {@code false}, and {@code MyViewGroup}'s
+return {@code false}, and {@code MyViewGroup}'s
{@link android.view.View#onTouchEvent onTouchEvent()} won't be called.</p>
<pre>public class MyViewGroup extends ViewGroup {
@@ -118,20 +118,20 @@
switch (action) {
case MotionEvent.ACTION_MOVE: {
if (mIsScrolling) {
- // We're currently scrolling, so yes, intercept the
+ // We're currently scrolling, so yes, intercept the
// touch event!
return true;
}
- // If the user has dragged her finger horizontally more than
+ // If the user has dragged her finger horizontally more than
// the touch slop, start the scroll
// left as an exercise for the reader
- final int xDiff = calculateDistanceX(ev);
+ final int xDiff = calculateDistanceX(ev);
- // Touch slop should be calculated using ViewConfiguration
+ // Touch slop should be calculated using ViewConfiguration
// constants.
- if (xDiff > mTouchSlop) {
+ if (xDiff > mTouchSlop) {
// Start scrolling!
mIsScrolling = true;
return true;
@@ -141,26 +141,26 @@
...
}
- // In general, we don't want to intercept touch events. They should be
+ // In general, we don't want to intercept touch events. They should be
// handled by the child view.
return false;
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
- // Here we actually handle the touch event (e.g. if the action is ACTION_MOVE,
+ // Here we actually handle the touch event (e.g. if the action is ACTION_MOVE,
// scroll this container).
- // This method will only be called if the touch event was intercepted in
+ // This method will only be called if the touch event was intercepted in
// onInterceptTouchEvent
...
}
}</pre>
-<p>Note that {@link android.view.ViewGroup} also provides a
-{@link android.view.ViewGroup#requestDisallowInterceptTouchEvent requestDisallowInterceptTouchEvent()} method.
-The {@link android.view.ViewGroup} calls this method when a child does not want the parent and its
-ancestors to intercept touch events with
-{@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()}.
+<p>Note that {@link android.view.ViewGroup} also provides a
+{@link android.view.ViewGroup#requestDisallowInterceptTouchEvent requestDisallowInterceptTouchEvent()} method.
+The {@link android.view.ViewGroup} calls this method when a child does not want the parent and its
+ancestors to intercept touch events with
+{@link android.view.ViewGroup#onInterceptTouchEvent onInterceptTouchEvent()}.
</p>
<h2 id="vc">Use ViewConfiguration Constants</h2>
@@ -176,10 +176,10 @@
prevent accidental scrolling when the user is performing some other touch
operation, such as touching on-screen elements.</p>
-<p>Two other commonly used {@link android.view.ViewConfiguration} methods are
-{@link android.view.ViewConfiguration#getScaledMinimumFlingVelocity getScaledMinimumFlingVelocity()}
+<p>Two other commonly used {@link android.view.ViewConfiguration} methods are
+{@link android.view.ViewConfiguration#getScaledMinimumFlingVelocity getScaledMinimumFlingVelocity()}
and {@link android.view.ViewConfiguration#getScaledMaximumFlingVelocity getScaledMaximumFlingVelocity()}.
-These methods return the minimum and maximum velocity (respectively) to initiate a fling,
+These methods return the minimum and maximum velocity (respectively) to initiate a fling,
as measured in pixels per second. For example:</p>
<pre>ViewConfiguration vc = ViewConfiguration.get(view.getContext());
@@ -209,14 +209,14 @@
<h2 id="delegate">Extend a Child View's Touchable Area</h2>
-<p>Android provides the {@link android.view.TouchDelegate} class to make it possible
-for a parent to extend the touchable area of a child view beyond the child's bounds.
+<p>Android provides the {@link android.view.TouchDelegate} class to make it possible
+for a parent to extend the touchable area of a child view beyond the child's bounds.
This is useful when the child has to be small, but should have a larger touch region. You can
also use this approach to shrink the child's touch region if need be.</p>
-<p>In the following example, an {@link android.widget.ImageButton} is the
-"delegate view" (that is, the child whose touch area the parent will extend).
+<p>In the following example, an {@link android.widget.ImageButton} is the
+"delegate view" (that is, the child whose touch area the parent will extend).
Here is the layout file:</p>
<pre>
@@ -225,7 +225,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
-
+
<ImageButton android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -245,9 +245,9 @@
</ul>
-In its capacity as touch delegate for the {@link android.widget.ImageButton} child view, the
+In its capacity as touch delegate for the {@link android.widget.ImageButton} child view, the
parent view will receive all touch events. If the touch event occurred within the child's hit
-rectangle, the parent will pass the touch
+rectangle, the parent will pass the touch
event to the child for handling.</p>
@@ -261,7 +261,7 @@
setContentView(R.layout.activity_main);
// Get the parent view
View parentView = findViewById(R.id.parent_layout);
-
+
parentView.post(new Runnable() {
// Post in the parent's message queue to make sure the parent
// lays out its children before you call getHitRect()
@@ -275,29 +275,29 @@
myButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- Toast.makeText(MainActivity.this,
- "Touch occurred within ImageButton touch region.",
+ Toast.makeText(MainActivity.this,
+ "Touch occurred within ImageButton touch region.",
Toast.LENGTH_SHORT).show();
}
});
-
+
// The hit rectangle for the ImageButton
myButton.getHitRect(delegateArea);
-
+
// Extend the touch area of the ImageButton beyond its bounds
// on the right and bottom.
delegateArea.right += 100;
delegateArea.bottom += 100;
-
+
// Instantiate a TouchDelegate.
- // "delegateArea" is the bounds in local coordinates of
+ // "delegateArea" is the bounds in local coordinates of
// the containing view to be mapped to the delegate view.
// "myButton" is the child view that should receive motion
// events.
- TouchDelegate touchDelegate = new TouchDelegate(delegateArea,
+ TouchDelegate touchDelegate = new TouchDelegate(delegateArea,
myButton);
-
- // Sets the TouchDelegate on the parent view, such that touches
+
+ // Sets the TouchDelegate on the parent view, such that touches
// within the touch delegate bounds are routed to the child.
if (View.class.isInstance(myButton.getParent())) {
((View) myButton.getParent()).setTouchDelegate(touchDelegate);
diff --git a/docs/html/training/id-auth/authenticate.jd b/docs/html/training/id-auth/authenticate.jd
index 65dbc39..bf32e8e 100644
--- a/docs/html/training/id-auth/authenticate.jd
+++ b/docs/html/training/id-auth/authenticate.jd
@@ -129,7 +129,7 @@
public void run(AccountManagerFuture<Bundle> result) {
// Get the result of the operation from the AccountManagerFuture.
Bundle bundle = result.getResult();
-
+
// The token is a named value in the bundle. The name of the value
// is stored in the constant AccountManager.KEY_AUTHTOKEN.
token = bundle.getString(AccountManager.KEY_AUTHTOKEN);
diff --git a/docs/html/training/id-auth/custom_auth.jd b/docs/html/training/id-auth/custom_auth.jd
index def9b51..3c106a9 100644
--- a/docs/html/training/id-auth/custom_auth.jd
+++ b/docs/html/training/id-auth/custom_auth.jd
@@ -81,7 +81,7 @@
credentials would be readable by anyone with {@code adb} access to the device.</p>
<p>With this in mind, you shouldn't pass the user's actual
-password to {@link android.accounts.AccountManager#addAccountExplicitly
+password to {@link android.accounts.AccountManager#addAccountExplicitly
AccountManager.addAccountExplicitly()}. Instead, you should store a
cryptographically secure token that would be of limited use to an attacker. If your
user credentials are protecting something valuable, you should carefully
diff --git a/docs/html/training/id-auth/index.jd b/docs/html/training/id-auth/index.jd
index f15ee29..45c6309 100644
--- a/docs/html/training/id-auth/index.jd
+++ b/docs/html/training/id-auth/index.jd
@@ -15,7 +15,7 @@
<li>Android 2.0 (API level 5) or higher</li>
<li>Experience with <a href="{@docRoot}guide/components/services.html">Services</a></li>
<li>Experience with <a href="http://oauth.net/2/">OAuth 2.0</a></li>
-</ul>
+</ul>
<h2>You should also read</h2>
<ul>
diff --git a/docs/html/training/improving-layouts/optimizing-layout.jd b/docs/html/training/improving-layouts/optimizing-layout.jd
index e0baedf..2f9f32d 100644
--- a/docs/html/training/improving-layouts/optimizing-layout.jd
+++ b/docs/html/training/improving-layouts/optimizing-layout.jd
@@ -145,7 +145,7 @@
<li>Deep layouts - Layouts with too much nesting are bad for performance. Consider using flatter layouts such as {@link android.widget.RelativeLayout} or {@link android.widget.GridLayout} to improve performance. The default maximum depth is 10.</li>
</ul>
-<p>Another benefit of Lint is that it is integrated into Android Studio. Lint automatically runs
+<p>Another benefit of Lint is that it is integrated into Android Studio. Lint automatically runs
whenever you compile your program. With Android Studio, you can also run lint inspections for a
specific build variant, or for all build variants. </p>
@@ -153,7 +153,7 @@
<strong>File>Settings>Project Settings</strong> option. The Inspection Configuration page
appears with the supported inspections.</p>
<p><img src="{@docRoot}images/tools/studio-inspections-config.png" alt="" /> </p>
-<p class="img-caption"><strong>Figure 5.</strong> Inspection Configuration</p>
+<p class="img-caption"><strong>Figure 5.</strong> Inspection Configuration</p>
<p>Lint has the ability to automatically fix some issues, provide suggestions for others and jump
directly to the offending code for review.</p>
diff --git a/docs/html/training/in-app-billing/list-iab-products.jd b/docs/html/training/in-app-billing/list-iab-products.jd
index c423fc1..c8de823 100644
--- a/docs/html/training/in-app-billing/list-iab-products.jd
+++ b/docs/html/training/in-app-billing/list-iab-products.jd
@@ -36,7 +36,7 @@
<p>To add new in-app products to your product list:</p>
<ol>
-<li>Build a signed APK file for your In-app Billing application. To learn how to build and sign your APK, see <a href="{@docRoot}tools/publishing/preparing.html#publishing-build">Building Your Application for Release</a>. Make sure that you are using your final (not debug) certificate and private key to sign your application.
+<li>Build a signed APK file for your In-app Billing application. To learn how to build and sign your APK, see <a href="{@docRoot}tools/publishing/preparing.html#publishing-build">Building Your Application for Release</a>. Make sure that you are using your final (not debug) certificate and private key to sign your application.
</li>
<li>In the Developer Console, open the application entry that you created earlier.</li>
<li>Click on the APK tab then click on Upload new APK. Upload the signed APK file to the Developer Console. Don’t publish the app yet!</li>
@@ -48,9 +48,9 @@
<h2 id="QueryDetails">Query Items Available for Purchase</h2>
<p>You can query Google Play to programmatically retrieve details of the in-app products that are associated with your application (such as the product’s price, title, description, and type). This is useful, for example, when you want to display a listing of unowned items that are still available for purchase to users.</p>
<p class="note"><strong>Note:</strong> When making the query, you will need to specify the product IDs for the products explicitly. You can manually find the product IDs from the Developer Console by opening the <strong>In-app Products</strong> tab for your application. The product IDs are listed under the column labeled <strong>Name/ID</strong>.</p>
-<p>To retrieve the product details, call {@code queryInventoryAsync(boolean, List, QueryInventoryFinishedListener)} on your IabHelper instance.
+<p>To retrieve the product details, call {@code queryInventoryAsync(boolean, List, QueryInventoryFinishedListener)} on your IabHelper instance.
<ul>
-<li>The first input argument indicates whether product details should be retrieved (should be set to {@code true}).</li>
+<li>The first input argument indicates whether product details should be retrieved (should be set to {@code true}).</li>
<li>The {@code List} argument consists of one or more product IDs (also called SKUs) for the products that you want to query.</li>
<li>Finally, the {@code QueryInventoryFinishedListener} argument specifies a listener is notified when the query operation has completed and handles the query response.</li>
</ul>
@@ -70,9 +70,9 @@
<p>The following code shows how you can retrieve the item prices from the result set.</p>
<pre>
-IabHelper.QueryInventoryFinishedListener
+IabHelper.QueryInventoryFinishedListener
mQueryFinishedListener = new IabHelper.QueryInventoryFinishedListener() {
- public void onQueryInventoryFinished(IabResult result, Inventory inventory)
+ public void onQueryInventoryFinished(IabResult result, Inventory inventory)
{
if (result.isFailure()) {
// handle error
@@ -84,7 +84,7 @@
String bananaPrice =
inventory.getSkuDetails(SKU_BANANA).getPrice();
- // update the UI
+ // update the UI
}
}
</pre>
diff --git a/docs/html/training/in-app-billing/purchase-iab-products.jd b/docs/html/training/in-app-billing/purchase-iab-products.jd
index 4e6e035..165e311 100644
--- a/docs/html/training/in-app-billing/purchase-iab-products.jd
+++ b/docs/html/training/in-app-billing/purchase-iab-products.jd
@@ -45,7 +45,7 @@
<p>The following example shows how you can make a purchase request for a product with ID {@code SKU_GAS}, using an arbitrary value of 10001 for the request code, and an encoded developer payload string.</p>
<pre>
-mHelper.launchPurchaseFlow(this, SKU_GAS, 10001,
+mHelper.launchPurchaseFlow(this, SKU_GAS, 10001,
mPurchaseFinishedListener, "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
</pre>
@@ -54,14 +54,14 @@
<p>The following example shows how you can handle the purchase response in the listener, depending on whether the purchase order was completed successfully, and whether the user purchased gas or a premium upgrade. In this example, gas is an in-app product that can be purchased multiple times, so you should consume the purchase to allow the user to buy it again. To learn how to consume purchases, see the <a href="{@docRoot}training/in-app-billing/purchase-iab-products.html#Consume">Consuming Products</a> section. The premium upgrade is a one-time purchase so you don’t need to consume it. It is good practice to update the UI immediately so that your users can see their newly purchased items.</p>
<pre>
-IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener
+IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener
= new IabHelper.OnIabPurchaseFinishedListener() {
- public void onIabPurchaseFinished(IabResult result, Purchase purchase)
+ public void onIabPurchaseFinished(IabResult result, Purchase purchase)
{
if (result.isFailure()) {
Log.d(TAG, "Error purchasing: " + result);
return;
- }
+ }
else if (purchase.getSku().equals(SKU_GAS)) {
// consume the gas and update the UI
}
@@ -86,7 +86,7 @@
<p>If the query is successful, the query results are stored in an {@code Inventory} object that is passed back to the listener. The In-app Billing service returns only the purchases made by the user account that is currently logged in to the device.</p>
<pre>
-IabHelper.QueryInventoryFinishedListener mGotInventoryListener
+IabHelper.QueryInventoryFinishedListener mGotInventoryListener
= new IabHelper.QueryInventoryFinishedListener() {
public void onQueryInventoryFinished(IabResult result,
Inventory inventory) {
@@ -96,7 +96,7 @@
}
else {
// does the user have the premium upgrade?
- mIsPremium = inventory.hasPurchase(SKU_PREMIUM);
+ mIsPremium = inventory.hasPurchase(SKU_PREMIUM);
// update UI accordingly
}
}
@@ -111,7 +111,7 @@
<p>In this example, you want to consume the gas item that the user has previously purchased in your app.</p>
<pre>
-mHelper.consumeAsync(inventory.getPurchase(SKU_GAS),
+mHelper.consumeAsync(inventory.getPurchase(SKU_GAS),
mConsumeFinishedListener);
</pre>
diff --git a/docs/html/training/in-app-billing/test-iab-app.jd b/docs/html/training/in-app-billing/test-iab-app.jd
index 9d47a96..fc7fe1a 100644
--- a/docs/html/training/in-app-billing/test-iab-app.jd
+++ b/docs/html/training/in-app-billing/test-iab-app.jd
@@ -39,7 +39,7 @@
<li>Login to the <a href="https://play.google.com/apps/publish/" target="_blank">Developer Console</a> with your developer account.</li>
<li>Click <strong>Settings</strong> > <strong>Account</strong> details, then in the <strong>License Testing</strong> section, add the Google email addresses for your tester accounts.</li>
</ol>
-<li>Build a signed APK file for your In-app Billing application. To learn how to build and sign your APK, see <a href="{@docRoot}tools/publishing/preparing.html#publishing-build">Building Your Application for Release</a>. Make sure that you are using your final (not debug) certificate and private key to sign your application.
+<li>Build a signed APK file for your In-app Billing application. To learn how to build and sign your APK, see <a href="{@docRoot}tools/publishing/preparing.html#publishing-build">Building Your Application for Release</a>. Make sure that you are using your final (not debug) certificate and private key to sign your application.
</li>
<li>Make sure that you have uploaded the signed APK for your application to the Developer Console, and associated one or more in-app products with your application. You don't need to publish the application on Google Play to test it. <p class="note"><strong>Warning:</strong> It may take up to 2-3 hours after uploading the APK for Google Play to recognize your updated APK version. If you try to test your application before your uploaded APK is recognized by Google Play, your application will receive a ‘purchase cancelled’ response with an error message “This version of the application is not enabled for In-app Billing.”</p></li>
<li>Install the APK file to your physical test device by using the {@code adb} tool. To learn how to install the application, see <a href="{@docRoot}tools/building/building-cmdline.html#RunningOnDevice">Running on a Device</a>. Make sure that:
diff --git a/docs/html/training/keyboard-input/index.jd b/docs/html/training/keyboard-input/index.jd
index 46795c4..bd7ad18 100644
--- a/docs/html/training/keyboard-input/index.jd
+++ b/docs/html/training/keyboard-input/index.jd
@@ -32,9 +32,9 @@
<p>These topics and more are discussed in the following lessons.</p>
-<h2>Lessons</h2>
-
-<dl>
+<h2>Lessons</h2>
+
+<dl>
<dt><b><a href="style.html">Specifying the Input Method Type</a></b></dt>
<dd>Learn how to show certain soft input methods, such as those designed for phone numbers, web
addresses, or other formats. Also learn how to specify characteristics such
@@ -51,5 +51,5 @@
<dt><b><a href="commands.html">Handling Keyboard Actions</a></b></dt>
<dd>Learn how to respond directly to keyboard input for user actions.
</dd>
-
-</dl>
+
+</dl>
diff --git a/docs/html/training/keyboard-input/style.jd b/docs/html/training/keyboard-input/style.jd
index b0e506c..714c8b3 100644
--- a/docs/html/training/keyboard-input/style.jd
+++ b/docs/html/training/keyboard-input/style.jd
@@ -71,7 +71,7 @@
android:id="@+id/password"
android:hint="@string/password_hint"
android:inputType="textPassword"
- ... />
+ ... />
</pre>
<p>There are several possible values documented with the
diff --git a/docs/html/training/load-data-background/handle-results.jd b/docs/html/training/load-data-background/handle-results.jd
index ce0024f..7439d3e 100644
--- a/docs/html/training/load-data-background/handle-results.jd
+++ b/docs/html/training/load-data-background/handle-results.jd
@@ -127,7 +127,7 @@
*/
@Override
public void onLoaderReset(Loader<Cursor> loader) {
-
+
/*
* Clears out the adapter's reference to the Cursor.
* This prevents memory leaks.
diff --git a/docs/html/training/location/display-address.jd b/docs/html/training/location/display-address.jd
index 8606629..daa6fd3 100644
--- a/docs/html/training/location/display-address.jd
+++ b/docs/html/training/location/display-address.jd
@@ -324,7 +324,7 @@
process if needed. If the service is already running then it remains running.
Because the service extends {@link android.app.IntentService IntentService},
it shuts down automatically when all intents have been processed.</p>
-
+
<p>Start the service from your app's main activity,
and create an {@link android.content.Intent} to pass data to the service. You
need an <em>explicit</em> intent, because you want only your service
diff --git a/docs/html/training/location/geofencing.jd b/docs/html/training/location/geofencing.jd
index 1cf89fd..ce6ad55 100644
--- a/docs/html/training/location/geofencing.jd
+++ b/docs/html/training/location/geofencing.jd
@@ -369,7 +369,7 @@
GEOFENCE_TRANSITION_DWELL</a></code> instead of <code>
<a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_ENTER">
GEOFENCE_TRANSITION_ENTER</a></code>. This way, the dwelling alert is sent only when the user stops
-inside a geofence for a given period of time. You can choose the duration by setting a
+inside a geofence for a given period of time. You can choose the duration by setting a
<a href="{@docRoot}reference/com/google/android/gms/location/Geofence.Builder.html#setLoiteringDelay(int)">
loitering delay</a>.</p>
diff --git a/docs/html/training/managing-audio/audio-output.jd b/docs/html/training/managing-audio/audio-output.jd
index 416e519..ed1623b 100644
--- a/docs/html/training/managing-audio/audio-output.jd
+++ b/docs/html/training/managing-audio/audio-output.jd
@@ -8,8 +8,8 @@
@jd:body
-
-<div id="tb-wrapper">
+
+<div id="tb-wrapper">
<div id="tb">
<h2>This lesson teaches you to</h2>
@@ -25,16 +25,16 @@
</ul>
-</div>
+</div>
</div>
<p>Users have a number of alternatives when it comes to enjoying the audio from their Android
devices. Most devices have a built-in speaker, headphone jacks for wired headsets, and many also
feature Bluetooth connectivity and support for A2DP audio. </p>
-
-<h2 id="CheckHardware">Check What Hardware is Being Used</h2>
-
+
+<h2 id="CheckHardware">Check What Hardware is Being Used</h2>
+
<p>How your app behaves might be affected by which hardware its output is being routed to.</p>
<p>You can query the {@link android.media.AudioManager} to determine if the audio is currently
@@ -48,13 +48,13 @@
// Adjust output for Speakerphone.
} else if (isWiredHeadsetOn()) {
// Adjust output for headsets
-} else {
+} else {
// If audio plays and noone can hear it, is it still playing?
}
</pre>
-<h2 id="HandleChanges">Handle Changes in the Audio Output Hardware</h2>
+<h2 id="HandleChanges">Handle Changes in the Audio Output Hardware</h2>
<p>When a headset is unplugged, or a Bluetooth device disconnected, the audio stream
automatically reroutes to the built in speaker. If you listen to your music at as high a volume as I
@@ -65,7 +65,7 @@
that listens for this intent whenever you’re playing audio. In the case of music players, users
typically expect the playback to be paused—while for games you may choose to significantly
lower the volume.</p>
-
+
<pre>
private class NoisyAudioStreamReceiver extends BroadcastReceiver {
@Override
diff --git a/docs/html/training/managing-audio/index.jd b/docs/html/training/managing-audio/index.jd
index 9391449..55b91c2 100644
--- a/docs/html/training/managing-audio/index.jd
+++ b/docs/html/training/managing-audio/index.jd
@@ -6,10 +6,10 @@
@jd:body
-<div id="tb-wrapper">
+<div id="tb-wrapper">
<div id="tb">
-<h2>Dependencies and prerequisites</h2>
+<h2>Dependencies and prerequisites</h2>
<ul>
<li>Android 2.0 (API level 5) or higher</li>
<li>Experience with <a href="{@docRoot}guide/topics/media/mediaplayer.html">Media
@@ -21,41 +21,41 @@
<li><a href="{@docRoot}guide/components/services.html">Services</a></li>
</ul>
-</div>
+</div>
</div>
<p>If your app plays audio, it’s important that your users can control the audio in a predictable
manner. To ensure a great user experience, it’s also important that your app manages the audio focus
-to ensure multiple apps aren’t playing audio at the same time.</p>
+to ensure multiple apps aren’t playing audio at the same time.</p>
-<p>After this class, you will be able to build apps that respond to hardware audio key presses,
+<p>After this class, you will be able to build apps that respond to hardware audio key presses,
which request audio focus when playing audio, and which respond appropriately to changes in audio
-focus caused by the system or other applications.</p>
+focus caused by the system or other applications.</p>
-<h2>Lessons</h2>
-
+<h2>Lessons</h2>
+
<!-- Create a list of the lessons in this class along with a short description of each lesson.
These should be short and to the point. It should be clear from reading the summary whether someone
-will want to jump to a lesson or not.-->
-
+will want to jump to a lesson or not.-->
+
<dl>
<dt><b><a href="volume-playback.html">Controlling Your App’s Volume and
Playback</a></b></dt>
<dd>Learn how to ensure your users can control the volume of your app using the hardware or
software volume controls and where available the play, stop, pause, skip, and previous media
-playback keys.</dd>
-
+playback keys.</dd>
+
<dt><b><a href="audio-focus.html">Managing Audio Focus</a></b></dt>
<dd>With multiple apps potentially playing audio it's important to think about how they should
interact. To avoid every music app playing at the same time, Android uses audio focus to moderate
audio playback. Learn how to request the audio focus, listen for a loss of audio focus, and how to
-respond when that happens.</dd>
-
+respond when that happens.</dd>
+
<dt><b><a href="audio-output.html">Dealing with Audio Output Hardware</a></b></dt>
<dd>Audio can be played from a number of sources. Learn how to find out where the audio is being
-played and how to handle a headset being disconnected during playback.</dd>
- </dl>
+played and how to handle a headset being disconnected during playback.</dd>
+ </dl>
diff --git a/docs/html/training/managing-audio/volume-playback.jd b/docs/html/training/managing-audio/volume-playback.jd
index be0f583..7e28893 100644
--- a/docs/html/training/managing-audio/volume-playback.jd
+++ b/docs/html/training/managing-audio/volume-playback.jd
@@ -8,8 +8,8 @@
@jd:body
-
-<div id="tb-wrapper">
+
+<div id="tb-wrapper">
<div id="tb">
<h2>This lesson teaches you to</h2>
@@ -26,11 +26,11 @@
<li><a href="{@docRoot}guide/topics/media/mediaplayer.html">Media Playback</a></li>
</ul>
-</div>
+</div>
</div>
-
+
<p>A good user experience is a predictable one. If your app plays media it’s important that your
users can control the volume of your app using the hardware or software volume controls of their
device, bluetooth headset, or headphones.</p>
@@ -38,9 +38,9 @@
<p>Similarly, where appropriate and available, the play, stop, pause, skip, and previous media
playback keys should perform their respective actions on the audio stream used by your app.</p>
-
-<h2 id="IdentifyStream">Identify Which Audio Stream to Use</h2>
-
+
+<h2 id="IdentifyStream">Identify Which Audio Stream to Use</h2>
+
<p>The first step to creating a predictable audio experience is understanding which audio stream
your app will use.</p>
@@ -53,11 +53,11 @@
android.media.AudioManager#STREAM_MUSIC} stream.</p>
-<h2 id="HardwareVolumeKeys">Use Hardware Volume Keys to Control Your App’s Audio Volume</h2>
+<h2 id="HardwareVolumeKeys">Use Hardware Volume Keys to Control Your App’s Audio Volume</h2>
<p>By default, pressing the volume controls modify the volume of the active audio stream. If your
app isn't currently playing anything, hitting the volume keys adjusts the ringer volume.<p>
-
+
<p>If you've got a game or music app, then chances are good that when the user hits the volume keys
they want to control the volume of the game or music, even if they’re currently between songs or
there’s no music in the current game location.</p>
@@ -65,8 +65,8 @@
<p>You may be tempted to try and listen for volume key presses and modify the volume of your
audio stream that way. Resist the urge. Android provides the handy {@link
android.app.Activity#setVolumeControlStream setVolumeControlStream()} method to direct volume key
-presses to the audio stream you specify.<p>
-
+presses to the audio stream you specify.<p>
+
<p>Having identified the audio stream your application
will be using, you should set it as the volume stream target. You should make this call early in
your app’s lifecycle—because you only need to call it once during the activity lifecycle, you
@@ -85,7 +85,7 @@
<h2 id="PlaybackControls">Use Hardware Playback Control Keys to Control Your App’s Audio
-Playback</h2>
+Playback</h2>
<p>Media playback buttons such as play, pause, stop, skip, and previous are available on some
handsets and many connected or wireless headsets. Whenever a user presses one of these hardware
diff --git a/docs/html/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html/training/monitoring-device-state/connectivity-monitoring.jd
index d5e7a85..2dd904f 100644
--- a/docs/html/training/monitoring-device-state/connectivity-monitoring.jd
+++ b/docs/html/training/monitoring-device-state/connectivity-monitoring.jd
@@ -11,7 +11,7 @@
@jd:body
-<div id="tb-wrapper">
+<div id="tb-wrapper">
<div id="tb">
<h2>This lesson teaches you to</h2>
@@ -27,7 +27,7 @@
<li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
</ul>
-</div>
+</div>
</div>
<p>Some of the most common uses for repeating alarms and background services is to schedule regular
@@ -39,21 +39,21 @@
connected to the Internet, and if so, what type of connection is in place.</p>
-<h2 id="DetermineConnection">Determine if You Have an Internet Connection</h2>
-
+<h2 id="DetermineConnection">Determine if You Have an Internet Connection</h2>
+
<p>There's no need to schedule an update based on an Internet resource if you aren't connected to
-the Internet. The following snippet shows how to use the {@link android.net.ConnectivityManager}
+the Internet. The following snippet shows how to use the {@link android.net.ConnectivityManager}
to query the active network and determine if it has Internet connectivity.</p>
<pre>ConnectivityManager cm =
(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
-
+
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
boolean isConnected = activeNetwork != null &&
activeNetwork.isConnectedOrConnecting();</pre>
-<h2 id="DetermineType">Determine the Type of your Internet Connection</h2>
+<h2 id="DetermineType">Determine the Type of your Internet Connection</h2>
<p>It's also possible to determine the type of Internet connection currently available.</p>
@@ -71,7 +71,7 @@
to resume them once an Internet connection has been established.</p>
-<h2 id="MonitorChanges">Monitor for Changes in Connectivity</h2>
+<h2 id="MonitorChanges">Monitor for Changes in Connectivity</h2>
<p>The {@link android.net.ConnectivityManager} broadcasts the {@link
android.net.ConnectivityManager#CONNECTIVITY_ACTION} ({@code
diff --git a/docs/html/training/monitoring-device-state/manifest-receivers.jd b/docs/html/training/monitoring-device-state/manifest-receivers.jd
index ca184aa5..3e36dba 100644
--- a/docs/html/training/monitoring-device-state/manifest-receivers.jd
+++ b/docs/html/training/monitoring-device-state/manifest-receivers.jd
@@ -9,7 +9,7 @@
@jd:body
-<div id="tb-wrapper">
+<div id="tb-wrapper">
<div id="tb">
<h2>This lesson teaches you to</h2>
@@ -24,7 +24,7 @@
<li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
</ul>
-</div>
+</div>
</div>
<p>The simplest way to monitor device state changes is to create a {@link
@@ -38,10 +38,10 @@
<p>A better approach is to disable or enable the broadcast receivers at runtime. That way you can
use the receivers you declared in the manifest as passive alarms that are triggered by system events
only when necessary.</p>
-
-<h2 id="ToggleReceivers">Toggle and Cascade State Change Receivers to Improve Efficiency </h2>
-
+
+<h2 id="ToggleReceivers">Toggle and Cascade State Change Receivers to Improve Efficiency </h2>
+
<p>You can use the {@link android.content.pm.PackageManager} to toggle the enabled state on any
component defined in the manifest, including whichever broadcast receivers you wish to enable or
disable as shown in the snippet below:</p>
@@ -59,6 +59,6 @@
stop listening for connectivity changes and simply check to see if you're online immediately before
performing an update and rescheduling a recurring update alarm.</p>
-<p>You can use the same technique to delay a download that requires higher bandwidth to complete.
+<p>You can use the same technique to delay a download that requires higher bandwidth to complete.
Simply enable a broadcast receiver that listens for connectivity changes and initiates the
download only after you are connected to Wi-Fi.</p>
diff --git a/docs/html/training/multiple-threads/create-threadpool.jd b/docs/html/training/multiple-threads/create-threadpool.jd
index e22afd3..df28833 100644
--- a/docs/html/training/multiple-threads/create-threadpool.jd
+++ b/docs/html/training/multiple-threads/create-threadpool.jd
@@ -48,7 +48,7 @@
also occurs in any object that is only instantiated once. To learn more about this, read the
<a href="{@docRoot}guide/components/processes-and-threads.html">
Processes and Threads</a> API guide.
-
+
</p>
<h2 id="ClassStructure">Define the Thread Pool Class</h2>
<p>
diff --git a/docs/html/training/multiscreen/adaptui.jd b/docs/html/training/multiscreen/adaptui.jd
index 34e9d7d..469012b 100644
--- a/docs/html/training/multiscreen/adaptui.jd
+++ b/docs/html/training/multiscreen/adaptui.jd
@@ -10,9 +10,9 @@
<!-- This is the training bar -->
-<div id="tb-wrapper">
-<div id="tb">
-
+<div id="tb-wrapper">
+<div id="tb">
+
<h2>This lesson teaches you to</h2>
<ol>
@@ -28,18 +28,18 @@
<li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets and
Handsets</a></li>
</ul>
-
+
<h2>Try it out</h2>
-
+
<div class="download-box">
<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Download
the sample app</a>
-<p class="filename">NewsReader.zip</p>
-</div>
-
-
-</div>
-</div>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
<p>Depending on the layout that your application is currently showing, the UI
flow may be different. For example, if your application is in the dual-pane
@@ -66,7 +66,7 @@
setContentView(R.layout.main_layout);
View articleView = findViewById(R.id.article);
- mIsDualPane = articleView != null &&
+ mIsDualPane = articleView != null &&
articleView.getVisibility() == View.VISIBLE;
}
}
@@ -139,7 +139,7 @@
else {
/* use list navigation (spinner) */
actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_LIST);
- SpinnerAdapter adap = new ArrayAdapter<String>(this,
+ SpinnerAdapter adap = new ArrayAdapter<String>(this,
R.layout.headline_item, CATEGORIES);
actionBar.setListNavigationCallbacks(adap, handler);
}
@@ -157,7 +157,7 @@
<p>In cases like this, you can usually avoid code duplication by reusing the
same {@link android.app.Fragment} subclass in several activities. For example,
-<code>ArticleFragment</code>
+<code>ArticleFragment</code>
is used in the dual-pane layout:</p>
{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
@@ -206,7 +206,7 @@
public class HeadlinesFragment extends ListFragment {
...
@Override
- public void onItemClick(AdapterView<?> parent,
+ public void onItemClick(AdapterView<?> parent,
View view, int position, long id) {
if (null != mHeadlineSelectedListener) {
mHeadlineSelectedListener.onHeadlineSelected(position);
diff --git a/docs/html/training/multiscreen/index.jd b/docs/html/training/multiscreen/index.jd
index 8eff246..2c59fac 100644
--- a/docs/html/training/multiscreen/index.jd
+++ b/docs/html/training/multiscreen/index.jd
@@ -7,10 +7,10 @@
@jd:body
-<div id="tb-wrapper">
-<div id="tb">
-
-<h2>Dependencies and prerequisites</h2>
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Dependencies and prerequisites</h2>
<ul>
<li>Android 1.6 or higher (2.1+ for the sample app)</li>
@@ -28,18 +28,18 @@
<ul>
<li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
</ul>
-
-<h2>Try it out</h2>
-
-<div class="download-box">
+
+<h2>Try it out</h2>
+
+<div class="download-box">
<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Download
the sample app</a>
-<p class="filename">NewsReader.zip</p>
-</div>
-
-</div>
-</div>
-
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
<p>Android powers hundreds of device types with several different screen sizes,
ranging from small phones to large TV sets. Therefore, it’s important
that you design your application to be compatible with all screen sizes so it’s available to as many
@@ -62,26 +62,26 @@
href="{@docRoot}tools/support-library/index.html">support library</a> in order to use the {@link
android.app.Fragment} APIs on versions lower than Android 3.0. You must download and add the
library to your application in order to use all APIs in this class.</p>
-
-<h2>Lessons</h2>
-
-<dl>
- <dt><b><a href="screensizes.html">Supporting Different Screen Sizes</a></b></dt>
+
+<h2>Lessons</h2>
+
+<dl>
+ <dt><b><a href="screensizes.html">Supporting Different Screen Sizes</a></b></dt>
<dd>This lesson walks you through how to design layouts that adapts
several different screen sizes (using flexible dimensions for
views, {@link android.widget.RelativeLayout}, screen size and orientation qualifiers,
- alias filters, and nine-patch bitmaps).</dd>
-
+ alias filters, and nine-patch bitmaps).</dd>
+
<dt><b><a href="screendensities.html">Supporting Different Screen
- Densities</a></b></dt>
+ Densities</a></b></dt>
<dd>This lesson shows you how to support screens that have different
pixel densities (using density-independent pixels and providing
- bitmaps appropriate for each density).</dd>
-
- <dt><b><a href="adaptui.html">Implementing Adaptative UI Flows</a></b></dt>
+ bitmaps appropriate for each density).</dd>
+
+ <dt><b><a href="adaptui.html">Implementing Adaptative UI Flows</a></b></dt>
<dd>This lesson shows you how to implement your UI flow in a way
that adapts to several screen size/density combinations
(run-time detection of active layout, reacting according to
- current layout, handling screen configuration changes).</dd>
-</dl>
+ current layout, handling screen configuration changes).</dd>
+</dl>
diff --git a/docs/html/training/multiscreen/screensizes.jd b/docs/html/training/multiscreen/screensizes.jd
index 2cd59ee..040bb85 100755
--- a/docs/html/training/multiscreen/screensizes.jd
+++ b/docs/html/training/multiscreen/screensizes.jd
@@ -10,8 +10,8 @@
<!-- This is the training bar -->
-<div id="tb-wrapper">
-<div id="tb">
+<div id="tb-wrapper">
+<div id="tb">
<h2>This lesson teaches you to</h2>
<ol>
@@ -30,27 +30,27 @@
<li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
</ul>
-<h2>Try it out</h2>
-
-<div class="download-box">
+<h2>Try it out</h2>
+
+<div class="download-box">
<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Download
the sample app</a>
-<p class="filename">NewsReader.zip</p>
-</div>
-
-</div>
-</div>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
<p>This lesson shows you how to support different screen sizes by:</p>
-<ul>
- <li>Ensuring your layout can be adequately resized to fit the screen</li>
- <li>Providing appropriate UI layout according to screen configuration</li>
+<ul>
+ <li>Ensuring your layout can be adequately resized to fit the screen</li>
+ <li>Providing appropriate UI layout according to screen configuration</li>
<li>Ensuring the correct layout is applied to the correct screen</li>
- <li>Providing bitmaps that scale correctly</li>
-</ul>
+ <li>Providing bitmaps that scale correctly</li>
+</ul>
-<h2 id="TaskUseWrapMatchPar">Use "wrap_content" and "match_parent"</h2>
+<h2 id="TaskUseWrapMatchPar">Use "wrap_content" and "match_parent"</h2>
<p>To ensure that your layout is flexible and adapts to different screen sizes,
you should use <code>"wrap_content"</code> and <code>"match_parent"</code> for the width
@@ -78,11 +78,11 @@
and landscape (right).</p>
-<h2 id="TaskUseRelativeLayout">Use RelativeLayout</h2>
+<h2 id="TaskUseRelativeLayout">Use RelativeLayout</h2>
<p>You can construct fairly complex layouts using nested instances of {@link
android.widget.LinearLayout} and
-combinations of <code>"wrap_content"</code> and <code>"match_parent"</code> sizes.
+combinations of <code>"wrap_content"</code> and <code>"match_parent"</code> sizes.
However, {@link android.widget.LinearLayout} does not allow you to precisely control the
spacial relationships of child views; views in a {@link android.widget.LinearLayout} simply line up
side-by-side. If you need child views to be oriented in variations other than a straight line, a
@@ -139,8 +139,8 @@
spatial relationships are preserved as specified by the {@link
android.widget.RelativeLayout.LayoutParams}.</p>
-
-<h2 id="TaskUseSizeQuali">Use Size Qualifiers</h2>
+
+<h2 id="TaskUseSizeQuali">Use Size Qualifiers</h2>
<p>There's only so much mileage you can get from a flexible layout or relative layout
like the one in the previous sections. While those layouts adapt to
@@ -148,7 +148,7 @@
may not provide the best user experience for each screen size. Therefore, your
application should not only implement flexible layouts, but should also provide
several alternative layouts to target different screen configurations. You do
-so by using <a href="http://developer.android.com/guide/practices/screens_support.html#qualifiers">configuration qualifiers</a>, which allows the runtime
+so by using <a href="http://developer.android.com/guide/practices/screens_support.html#qualifiers">configuration qualifiers</a>, which allows the runtime
to automatically select the appropriate resource based on the current device’s
configuration (such as a different layout design for different screen sizes).</p>
@@ -209,13 +209,13 @@
<p>However, this won't work well on pre-3.2 devices, because they don't
recognize <code>sw600dp</code> as a size qualifier, so you still have to use the <code>large</code>
-qualifier as well. So, you should have a file named
+qualifier as well. So, you should have a file named
<code>res/layout-large/main.xml</code>
which is identical to <code>res/layout-sw600dp/main.xml</code>. In the next section
you'll see a technique that allows you to avoid duplicating the layout files this way.</p>
-<h2 id="TaskUseAliasFilters">Use Layout Aliases</h2>
+<h2 id="TaskUseAliasFilters">Use Layout Aliases</h2>
<p>The smallest-width qualifier is available only on Android 3.2 and above.
Therefore, you should also still use the abstract size bins (small, normal,
@@ -271,7 +271,7 @@
{@code large}, and post-3.2 will match <code>sw600dp</code>).</p>
-<h2 id="TaskUseOriQuali">Use Orientation Qualifiers</h2>
+<h2 id="TaskUseOriQuali">Use Orientation Qualifiers</h2>
<p>Some layouts work well in both landscape and portrait orientations, but most of them can
benefit from adjustments. In the News Reader sample app, here is how the layout
@@ -287,7 +287,7 @@
<li><b>TV, landscape:</b> dual pane, wide, with action bar</li>
</ul></p>
-<p>So each of these layouts is defined in an XML file in the
+<p>So each of these layouts is defined in an XML file in the
<code>res/layout/</code> directory. To then assign each layout to the various screen
configurations, the app uses layout aliases to match them to
each configuration:</p>
@@ -361,7 +361,7 @@
the right and bottom borders indicate where the content should be
placed.</p>
-<p>Also, notice the <code>.9.png</code> extension. You must use this
+<p>Also, notice the <code>.9.png</code> extension. You must use this
extension, since this is how the framework detects that this is a nine-patch
image, as opposed to a regular PNG image.</p>
diff --git a/docs/html/training/notify-user/build-notification.jd b/docs/html/training/notify-user/build-notification.jd
index d24a496..2f96a20 100644
--- a/docs/html/training/notify-user/build-notification.jd
+++ b/docs/html/training/notify-user/build-notification.jd
@@ -42,9 +42,9 @@
<p>This lesson explains how to create and issue a notification.</p>
-<p>The examples in this class are based on the
-{@link android.support.v4.app.NotificationCompat.Builder} class.
-{@link android.support.v4.app.NotificationCompat.Builder}
+<p>The examples in this class are based on the
+{@link android.support.v4.app.NotificationCompat.Builder} class.
+{@link android.support.v4.app.NotificationCompat.Builder}
is in the <a href="{@docRoot}">Support Library</a>. You should use
{@link android.support.v4.app.NotificationCompat} and its subclasses,
particularly {@link android.support.v4.app.NotificationCompat.Builder}, to
@@ -52,9 +52,9 @@
<h2 id="builder">Create a Notification Builder</h2>
-<p>When creating a notification, specify the UI content and actions with a
-{@link android.support.v4.app.NotificationCompat.Builder} object. At bare minimum,
-a {@link android.support.v4.app.NotificationCompat.Builder Builder}
+<p>When creating a notification, specify the UI content and actions with a
+{@link android.support.v4.app.NotificationCompat.Builder} object. At bare minimum,
+a {@link android.support.v4.app.NotificationCompat.Builder Builder}
object must include the following:</p>
<ul>
@@ -96,7 +96,7 @@
android.app.Activity} from a notification, you must preserve the user's expected
navigation experience. In the snippet below, clicking the notification opens a
new activity that effectively extends the behavior of the notification. In this
-case there is no need to create an artificial back stack (see
+case there is no need to create an artificial back stack (see
<a href="navigation.html">Preserving Navigation when Starting an Activity</a> for
more information):</p>
@@ -132,11 +132,11 @@
<p>To issue the notification:</p>
<ul>
-<li>Get an instance of {@link android.app.NotificationManager}.</li>
+<li>Get an instance of {@link android.app.NotificationManager}.</li>
<li>Use the {@link android.app.NotificationManager#notify notify()} method to issue the
-notification. When you call {@link android.app.NotificationManager#notify notify()}, specify a notification ID.
-You can use this ID to update the notification later on. This is described in more detail in
+notification. When you call {@link android.app.NotificationManager#notify notify()}, specify a notification ID.
+You can use this ID to update the notification later on. This is described in more detail in
<a href="managing.html">Managing Notifications</a>.</li>
<li>Call {@link
@@ -152,7 +152,7 @@
// Sets an ID for the notification
int mNotificationId = 001;
// Gets an instance of the NotificationManager service
-NotificationManager mNotifyMgr =
+NotificationManager mNotifyMgr =
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
// Builds the notification and issues it.
mNotifyMgr.notify(mNotificationId, mBuilder.build());
diff --git a/docs/html/training/notify-user/display-progress.jd b/docs/html/training/notify-user/display-progress.jd
index 3439571..e2cf033 100644
--- a/docs/html/training/notify-user/display-progress.jd
+++ b/docs/html/training/notify-user/display-progress.jd
@@ -59,9 +59,9 @@
<h2 id="FixedProgress">Display a Fixed-duration Progress Indicator</h2>
<p>
To display a determinate progress bar, add the bar to your notification by calling
- {@link android.support.v4.app.NotificationCompat.Builder#setProgress
- setProgress(max, progress, false)} and then issue the notification.
- The third argument is a boolean that indicates whether the
+ {@link android.support.v4.app.NotificationCompat.Builder#setProgress
+ setProgress(max, progress, false)} and then issue the notification.
+ The third argument is a boolean that indicates whether the
progress bar is indeterminate (<strong>true</strong>) or determinate (<strong>false</strong>).
As your operation proceeds,
increment <code>progress</code>, and update the notification. At the end of the operation,
@@ -74,7 +74,7 @@
You can either leave the progress bar showing when the operation is done, or remove it. In
either case, remember to update the notification text to show that the operation is complete.
To remove the progress bar, call
- {@link android.support.v4.app.NotificationCompat.Builder#setProgress
+ {@link android.support.v4.app.NotificationCompat.Builder#setProgress
setProgress(0, 0, false)}. For example:
</p>
<pre>
@@ -136,14 +136,14 @@
<p>
To display a continuing (indeterminate) activity indicator, add it to your notification with
{@link android.support.v4.app.NotificationCompat.Builder#setProgress setProgress(0, 0, true)}
- and issue the notification. The first two arguments are ignored, and the third argument
+ and issue the notification. The first two arguments are ignored, and the third argument
declares that the indicator is indeterminate. The result is an indicator
that has the same style as a progress bar, except that its animation is ongoing.
</p>
<p>
Issue the notification at the beginning of the operation. The animation will run until you
modify your notification. When the operation is done, call
- {@link android.support.v4.app.NotificationCompat.Builder#setProgress
+ {@link android.support.v4.app.NotificationCompat.Builder#setProgress
setProgress(0, 0, false)} and then update the notification to remove the activity indicator.
Always do this; otherwise, the animation will run even when the operation is complete. Also
remember to change the notification text to indicate that the operation is complete.
@@ -160,7 +160,7 @@
</pre>
<p>
Replace the lines you've found with the following lines. Notice that the third parameter
- in the {@link android.support.v4.app.NotificationCompat.Builder#setProgress setProgress()}
+ in the {@link android.support.v4.app.NotificationCompat.Builder#setProgress setProgress()}
call is set to {@code true} to indicate that the progress bar is
indeterminate:
</p>
diff --git a/docs/html/training/notify-user/expanded.jd b/docs/html/training/notify-user/expanded.jd
index b657426..23d85d4 100644
--- a/docs/html/training/notify-user/expanded.jd
+++ b/docs/html/training/notify-user/expanded.jd
@@ -75,7 +75,7 @@
</ul>
<p>The normal view provides these features through a new activity that launches
-when the user clicks the notification. Keep this in mind as you design your notifications—first
+when the user clicks the notification. Keep this in mind as you design your notifications—first
provide the functionality in the normal view, since
this is how many users will interact with the notification.</p>
@@ -87,19 +87,19 @@
<p>In this snippet, the
{@link android.app.IntentService} method
-{@link android.app.IntentService#onHandleIntent onHandleIntent()} specifies the new activity
+{@link android.app.IntentService#onHandleIntent onHandleIntent()} specifies the new activity
that will be launched if the user
-clicks the notification itself. The method
-{@link android.support.v4.app.NotificationCompat.Builder#setContentIntent setContentIntent()}
+clicks the notification itself. The method
+{@link android.support.v4.app.NotificationCompat.Builder#setContentIntent setContentIntent()}
defines a pending intent that should be fired when the user
clicks the notification, thereby launching the activity.</p>
<pre>Intent resultIntent = new Intent(this, ResultActivity.class);
resultIntent.putExtra(CommonConstants.EXTRA_MESSAGE, msg);
-resultIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
+resultIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_CLEAR_TASK);
-
-// Because clicking the notification launches a new ("special") activity,
+
+// Because clicking the notification launches a new ("special") activity,
// there's no need to create an artificial back stack.
PendingIntent resultPendingIntent =
PendingIntent.getActivity(
@@ -130,8 +130,8 @@
PendingIntent piSnooze = PendingIntent.getService(this, 0, snoozeIntent, 0);
</pre>
-<p>This snippet shows how to construct the
-{@link android.support.v4.app.NotificationCompat.Builder Builder} object.
+<p>This snippet shows how to construct the
+{@link android.support.v4.app.NotificationCompat.Builder Builder} object.
It sets the style for the big
view to be "big text," and sets its content to be the reminder message. It uses
{@link android.support.v4.app.NotificationCompat.Builder#addAction addAction()}
diff --git a/docs/html/training/notify-user/index.jd b/docs/html/training/notify-user/index.jd
index 616e767..57efd65 100644
--- a/docs/html/training/notify-user/index.jd
+++ b/docs/html/training/notify-user/index.jd
@@ -43,9 +43,9 @@
</div>
<p>
- A notification is a user interface element that you display outside your app's normal UI to indicate
- that an event has occurred. Users can choose to view the notification while using other apps and respond
- to it when it's convenient for them.
+ A notification is a user interface element that you display outside your app's normal UI to indicate
+ that an event has occurred. Users can choose to view the notification while using other apps and respond
+ to it when it's convenient for them.
</p>
@@ -86,10 +86,10 @@
</strong>
</dt>
<dd>
- Learn how to create a big view within an expanded notification, while still maintaining
+ Learn how to create a big view within an expanded notification, while still maintaining
backward compatibility.
</dd>
-
+
<dt>
<strong>
<a href="display-progress.html">Displaying Progress in a Notification</a>
diff --git a/docs/html/training/notify-user/navigation.jd b/docs/html/training/notify-user/navigation.jd
index b7051ab..cdb7f3d 100644
--- a/docs/html/training/notify-user/navigation.jd
+++ b/docs/html/training/notify-user/navigation.jd
@@ -37,7 +37,7 @@
</div>
</div>
<p>
- Part of designing a notification is preserving the user's expected navigation experience.
+ Part of designing a notification is preserving the user's expected navigation experience.
For a detailed discussion of this topic, see the
<a href="{@docRoot}guide/topics/ui/notifiers/notifications.html#NotificationResponse">Notifications</a>
API guide.
@@ -49,7 +49,7 @@
</dt>
<dd>
You're starting an {@link android.app.Activity} that's part of the application's normal
- workflow.
+ workflow.
</dd>
<dt>
Special activity
@@ -202,7 +202,7 @@
Intent notifyIntent =
new Intent(new ComponentName(this, ResultActivity.class));
// Sets the Activity to start in a new, empty task
-notifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
+notifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_CLEAR_TASK);
// Creates the PendingIntent
PendingIntent notifyIntent =
diff --git a/docs/html/training/run-background-service/report-status.jd b/docs/html/training/run-background-service/report-status.jd
index 41121c1..41fbb00 100644
--- a/docs/html/training/run-background-service/report-status.jd
+++ b/docs/html/training/run-background-service/report-status.jd
@@ -91,7 +91,7 @@
</p>
<h2 id="ReceiveStatus">Receive Status Broadcasts from an IntentService</h2>
<p>
-
+
To receive broadcast {@link android.content.Intent} objects, use a subclass of
{@link android.content.BroadcastReceiver}. In the subclass, implement the
{@link android.content.BroadcastReceiver#onReceive BroadcastReceiver.onReceive()} callback
@@ -137,7 +137,7 @@
// The filter's action is BROADCAST_ACTION
IntentFilter mStatusIntentFilter = new IntentFilter(
Constants.BROADCAST_ACTION);
-
+
// Adds a data filter for the HTTP scheme
mStatusIntentFilter.addDataScheme("http");
...
@@ -194,6 +194,6 @@
{@link android.content.Intent}.
</p>
<p>
-
+
</p>
diff --git a/docs/html/training/sign-in/index.jd b/docs/html/training/sign-in/index.jd
index d7c8e1d..a585944 100644
--- a/docs/html/training/sign-in/index.jd
+++ b/docs/html/training/sign-in/index.jd
@@ -11,8 +11,8 @@
alt="Google maps sample image">
<p>
- Google Sign-In for Android lets you authenticate a user with the same credentials they use on
- Google. After a user signs in with Google, you can create more engaging experiences and drive
+ Google Sign-In for Android lets you authenticate a user with the same credentials they use on
+ Google. After a user signs in with Google, you can create more engaging experiences and drive
usage of your app.
</p>
@@ -34,8 +34,8 @@
<h4>Access the profile and social graph</h4>
<p>
- After users have signed in with Google, your app can welcome them by name and display their
- picture. If your app requests social scopes, it can connect users with friends, and access
+ After users have signed in with Google, your app can welcome them by name and display their
+ picture. If your app requests social scopes, it can connect users with friends, and access
age range, language, and public profile information.<br>
<a href="https://developers.google.com/identity/sign-in/android/people" class="external-link">
Getting Profile Information</a>.
@@ -47,6 +47,6 @@
The Google Android APIs are part of the Google Play services platform. To use Google features,
set up the Google Play services SDK in your app development project. For more information, see
the <a class="external-link" href=
- "https://developers.google.com/identity/sign-in/android/start-integrating">Start Integrating</a>
+ "https://developers.google.com/identity/sign-in/android/start-integrating">Start Integrating</a>
guide for Google Sign-In.
</p>
\ No newline at end of file
diff --git a/docs/html/wear/preview/features/ime.jd b/docs/html/wear/preview/features/ime.jd
index 1301be9..b07736f 100644
--- a/docs/html/wear/preview/features/ime.jd
+++ b/docs/html/wear/preview/features/ime.jd
@@ -19,14 +19,14 @@
</div>
-<p>Wear 2.0 supports input methods beyond voice by extending the Android
+<p>Wear 2.0 supports input methods beyond voice by extending the Android
Input Method Framework (IMF) to Android Wear. IMF allows for virtual, on-screen
- keyboards and other input methods to be used for text entry. The IMF APIs used
- for Wear devices are the same as other form factors, though usage is slightly
+ keyboards and other input methods to be used for text entry. The IMF APIs used
+ for Wear devices are the same as other form factors, though usage is slightly
different due to limited screen real estate.</p>
-<p>Wear 2.0 comes with the system default Input Method Editor (IME)
-and opens up the IMF APIs for third-party developers to create custom input
+<p>Wear 2.0 comes with the system default Input Method Editor (IME)
+and opens up the IMF APIs for third-party developers to create custom input
methods for Wear.</p>
<p><img src="{@docRoot}wear/preview/images/new_input_methods.png"></p>
@@ -46,17 +46,17 @@
<h2 id="invoking">Invoking an Input Method</h2>
-If you are developing an IME for Wear, remember that the
-feature is supported only on Android 6.0 (API level 23) and higher versions of
-the platform.
-To ensure that your IME can only be installed on Wearables that support input
+If you are developing an IME for Wear, remember that the
+feature is supported only on Android 6.0 (API level 23) and higher versions of
+the platform.
+To ensure that your IME can only be installed on Wearables that support input
methods beyond voice, add the following to your app's manifest:
<pre>
<uses-sdk android:minSdkVersion="23" />
</pre>
-This indicates that your app requires Android 6.0 or higher.
+This indicates that your app requires Android 6.0 or higher.
For more information, see <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a>
- and the documentation for the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a>
+ and the documentation for the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a>
element.
<p>
To control how your app is filtered from devices that do not support Wear
@@ -67,14 +67,14 @@
</pre>
<p>Wear provides user settings on the watch that lets the user to enable multiple
- IMEs from the list of installed IMEs. Once the users enable your IME, they
+ IMEs from the list of installed IMEs. Once the users enable your IME, they
can invoke your IME from:</p>
<ul>
-<li>A notification or an app using the
+<li>A notification or an app using the
<a href="{@docRoot}reference/android/support/v4/app/RemoteInput.html">RemoteInput</a></code> API.</li>
-<li>Wear apps with an
+<li>Wear apps with an
<a href="{@docRoot}reference/android/widget/EditText.html">EditText</a>
- field. Touching a text field places the cursor in the field and automatically
+ field. Touching a text field places the cursor in the field and automatically
displays the IME on focus.</li>
</ul>
@@ -86,10 +86,10 @@
<ul>
<li><strong>Set Default Action</strong>
<p>
-<a href="http://developer.android.com/reference/android/support/v4/app/RemoteInput.html">{@code RemoteInput}</a>
+<a href="http://developer.android.com/reference/android/support/v4/app/RemoteInput.html">{@code RemoteInput}</a>
and Wear apps expect only single-line text entry. The ENTER key should always trigger
a call to <a href="{@docRoot}reference/android/inputmethodservice/InputMethodService.html#sendDefaultEditorAction(boolean)">sendDefaultEditorAction</a>,
- which causes the app to dismiss the keyboard and continue on to the next step
+ which causes the app to dismiss the keyboard and continue on to the next step
or action.</p>
</li>
@@ -97,22 +97,22 @@
<p>
Input methods on Wear consume most of the screen, leaving very little of the
app visible; using full-screen mode ensures an optimal user experience regardless
- of the app UI. In full-screen mode, an
+ of the app UI. In full-screen mode, an
<a href="{@docRoot}reference/android/view/inputmethod/ExtractedText.html">{@code ExtractEditText}</a> provides a mirrored
view of the text field being edited and can be styled to blend with the rest of
- the input method UI. For more details on full-screen mode, see
+ the input method UI. For more details on full-screen mode, see
<a href="{@docRoot}reference/android/inputmethodservice/InputMethodService.html">InputMethodService</a>.
</p>
</li>
<li><strong>Handle InputType flags</strong>
<p>
-For privacy reasons, at a minimum you should handle the {@code InputType}
-flag {@code TYPE_TEXT_VARIATION_PASSWORD} in your IME. When your IME is in
-password mode, make sure that your keyboard is optimized for single key press
-(auto spelling correction, auto completion and gesture input are disabled).
-Most importantly, keyboard in password mode should support ASCII symbols
-regardless of the input language. For more details, see
+For privacy reasons, at a minimum you should handle the {@code InputType}
+flag {@code TYPE_TEXT_VARIATION_PASSWORD} in your IME. When your IME is in
+password mode, make sure that your keyboard is optimized for single key press
+(auto spelling correction, auto completion and gesture input are disabled).
+Most importantly, keyboard in password mode should support ASCII symbols
+regardless of the input language. For more details, see
<a href="{@docRoot}training/keyboard-input/style.html">Specifying The Input Method Type</a>.
</p>
</li>
@@ -120,9 +120,9 @@
<li><strong>Provide a key for switching to the next input method</strong>
<p>
Android allows users to easily switch between all IMEs supported by the platform.
- In your IME implementation, set the boolean
+ In your IME implementation, set the boolean
<a href="{@docRoot}guide/topics/text/creating-input-method.html#Switching">supportsSwitchingToNextInputMethod = true</a>
- to enable your IME to support the switching mechanism
+ to enable your IME to support the switching mechanism
(so that apps can switch to the next platform-supported IME).
</p>
</li>
diff --git a/docs/html/wear/preview/features/notifications.jd b/docs/html/wear/preview/features/notifications.jd
index c84a470..dcc0970 100644
--- a/docs/html/wear/preview/features/notifications.jd
+++ b/docs/html/wear/preview/features/notifications.jd
@@ -155,7 +155,7 @@
<p>If you have a chat messaging app, your notifications should use
<a href="{@docRoot}preview/features/notification-updates.html#style">{@code Notification.MessagingStyle}</a>,
which is new in Android N. Wear 2.0 uses the chat messages included
- in a <a href="{@docRoot}preview/features/notification-updates.html#style">{@code MessagingStyle}</a> notification
+ in a <a href="{@docRoot}preview/features/notification-updates.html#style">{@code MessagingStyle}</a> notification
(see <a href="{@docRoot}preview/features/notification-updates.html#style">{@code addMessage()}</a>) to provide
a rich chat app-like experience in the expanded notification.
@@ -195,7 +195,7 @@
<li>Use <a href="{@docRoot}preview/features/notification-updates.html#style">{@code Notification.MessagingStyle}</a>.
</li>
<li>Call the method {@code setAllowGeneratedReplies()} for the notification action.
- For more information, see the downloadable
+ For more information, see the downloadable
<a href="{@docRoot}preview/setup-sdk.html#docs-dl">API reference</a>.
</li>
<li>Ensure that the notification action has a
diff --git a/docs/html/work/cosu.jd b/docs/html/work/cosu.jd
index 8bc54d4..f66006b 100644
--- a/docs/html/work/cosu.jd
+++ b/docs/html/work/cosu.jd
@@ -223,7 +223,7 @@
</ul>
<p>
-Starting from Marshmallow, if your app is whitelisted by an EMM using {@link
+Starting from Marshmallow, if your app is whitelisted by an EMM using {@link
android.app.admin.DevicePolicyManager#setLockTaskPackages setLockTaskPackages},
your activities can automatically start lock task mode when the app is
launched.
@@ -253,15 +253,15 @@
<li>
The default value of the {@link android.R.attr#lockTaskMode} attribute is
-normal. When this attribute is set to normal, tasks don’t launch into
-{@link android.R.attr#lockTaskMode}, unless {@link android.app.Activity#startLockTask()}
+normal. When this attribute is set to normal, tasks don’t launch into
+{@link android.R.attr#lockTaskMode}, unless {@link android.app.Activity#startLockTask()}
is called. To call {@link android.app.Activity#startLockTask()},
-applications still need to be whitelisted using
-{@link android.app.admin.DevicePolicyManager#setLockTaskPackages setLockTaskPackages},
+applications still need to be whitelisted using
+{@link android.app.admin.DevicePolicyManager#setLockTaskPackages setLockTaskPackages},
otherwise, the user sees a dialog to approve entering pinned mode.
</li>
</ul>
-
+
<p>To have your activity <em>automatically</em> enter {@link android.R.attr#lockTaskMode},
change the value of this attribute to <code>if_whitelisted</code>.
Doing so causes your app to behave in this manner:
@@ -289,7 +289,7 @@
<p>
Given either of these options, you still need to create a mechanism for
calling {@link android.app.Activity#stopLockTask()} so that users can
-exit {@link android.R.attr#lockTaskMode}.
+exit {@link android.R.attr#lockTaskMode}.
</p>
<h2 id="create-dpc">
@@ -298,7 +298,7 @@
<p>
To manage applications in COSU, you need a DPC running as device
-owner to set several policies on the device.
+owner to set several policies on the device.
</p>
<p class="note">
diff --git a/docs/html/work/device-management-policy.jd b/docs/html/work/device-management-policy.jd
index d564b89..fd09150 100644
--- a/docs/html/work/device-management-policy.jd
+++ b/docs/html/work/device-management-policy.jd
@@ -14,7 +14,7 @@
<li><a href="#ActivateDeviceAdmin">Activate the Device Administrator</a></li>
<li><a href="#ImplementDevicePolicyController">Implement the Device Policy Controller</a></li>
</ol>
-
+
<!-- related docs (NOT javadocs) -->
<h2>You should also read</h2>
<ul>