summaryrefslogtreecommitdiffstats
path: root/docs/html/resources
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html/resources')
-rw-r--r--docs/html/resources/articles/can-i-use-this-intent.jd2
-rw-r--r--docs/html/resources/articles/contacts.jd10
-rw-r--r--docs/html/resources/articles/creating-input-method.jd742
-rw-r--r--docs/html/resources/articles/faster-screen-orientation-change.jd11
-rw-r--r--docs/html/resources/articles/images/inputmethod_composing_text_1.pngbin0 -> 5551 bytes
-rw-r--r--docs/html/resources/articles/images/inputmethod_composing_text_2.pngbin0 -> 5458 bytes
-rw-r--r--docs/html/resources/articles/images/inputmethod_composing_text_3.pngbin0 -> 1888 bytes
-rw-r--r--docs/html/resources/articles/images/inputmethod_lifecycle_image.pngbin0 -> 88902 bytes
-rw-r--r--docs/html/resources/articles/images/inputmethod_numeric_type_screenshot.pngbin0 -> 11814 bytes
-rw-r--r--docs/html/resources/articles/images/inputmethod_subtype_notification.pngbin0 -> 11404 bytes
-rw-r--r--docs/html/resources/articles/images/inputmethod_subtype_preferences.pngbin0 -> 18451 bytes
-rw-r--r--docs/html/resources/articles/images/inputmethod_subtype_settings.pngbin0 -> 16355 bytes
-rw-r--r--docs/html/resources/articles/images/inputmethod_text_type_screenshot.pngbin0 -> 13017 bytes
-rw-r--r--docs/html/resources/articles/images/spellcheck_client_flow.pngbin0 -> 48331 bytes
-rw-r--r--docs/html/resources/articles/images/spellcheck_lifecycle.pngbin0 -> 73795 bytes
-rw-r--r--docs/html/resources/articles/images/textview_spellcheck_screenshot_1.pngbin0 -> 1908 bytes
-rw-r--r--docs/html/resources/articles/images/textview_spellcheck_screenshot_2.pngbin0 -> 12063 bytes
-rw-r--r--docs/html/resources/articles/index.jd13
-rw-r--r--docs/html/resources/articles/live-wallpapers.jd12
-rw-r--r--docs/html/resources/articles/speech-input.jd4
-rw-r--r--docs/html/resources/articles/spell-checker-framework.jd236
-rw-r--r--docs/html/resources/articles/tts.jd2
-rw-r--r--docs/html/resources/articles/ui-1.6.jd2
-rw-r--r--docs/html/resources/community-groups.jd8
-rw-r--r--docs/html/resources/community-more.jd21
-rw-r--r--docs/html/resources/dashboard/opengl.jd14
-rw-r--r--docs/html/resources/dashboard/platform-versions.jd30
-rw-r--r--docs/html/resources/dashboard/screens.jd24
-rw-r--r--docs/html/resources/faq/troubleshooting.jd4
-rw-r--r--docs/html/resources/resources-data.js21
-rw-r--r--docs/html/resources/resources_toc.cs224
-rw-r--r--docs/html/resources/samples/get.jd8
-rw-r--r--docs/html/resources/samples/images/KeyChainDemo1.pngbin0 -> 142236 bytes
-rwxr-xr-xdocs/html/resources/samples/images/KeyChainDemo2.pngbin0 -> 40334 bytes
-rwxr-xr-xdocs/html/resources/samples/images/KeyChainDemo3.pngbin0 -> 62468 bytes
-rwxr-xr-xdocs/html/resources/samples/images/KeyChainDemo4.pngbin0 -> 61334 bytes
-rw-r--r--docs/html/resources/tutorials/hello-world.jd6
-rw-r--r--docs/html/resources/tutorials/notepad/notepad-ex2.jd3
-rw-r--r--docs/html/resources/tutorials/opengl/opengl-es10.jd2
-rw-r--r--docs/html/resources/tutorials/opengl/opengl-es20.jd2
-rw-r--r--docs/html/resources/tutorials/testing/activity_test.jd2
-rw-r--r--docs/html/resources/tutorials/views/hello-formstuff.jd164
-rw-r--r--docs/html/resources/tutorials/views/hello-mapview.jd4
-rw-r--r--docs/html/resources/tutorials/views/hello-webview.jd2
44 files changed, 1163 insertions, 410 deletions
diff --git a/docs/html/resources/articles/can-i-use-this-intent.jd b/docs/html/resources/articles/can-i-use-this-intent.jd
index c527331..7787d31 100644
--- a/docs/html/resources/articles/can-i-use-this-intent.jd
+++ b/docs/html/resources/articles/can-i-use-this-intent.jd
@@ -68,4 +68,4 @@ but it only lets you react to the problem, you cannot predict it and update the
UI accordingly to prevent the user from doing something that won't work. The
technique described here can also be used at startup time to ask the user
whether he'd like to install the missing package, you can then simply redirect
-him to the Android Market by using the appropriate URI.</p> \ No newline at end of file
+him to Google Play by using the appropriate URI.</p> \ No newline at end of file
diff --git a/docs/html/resources/articles/contacts.jd b/docs/html/resources/articles/contacts.jd
index 8365d29..374587b 100644
--- a/docs/html/resources/articles/contacts.jd
+++ b/docs/html/resources/articles/contacts.jd
@@ -298,10 +298,10 @@ platforms and one for Android 2.0 and beyond. If so, here's what you'll need to
<li>At launch time, check the version of the SDK. The version of the SDK
is available as {@link android.os.Build.VERSION#SDK android.os.Build.VERSION.SDK}.</li>
<li>If the SDK version is greater or equal to 5 (Android 2.0), show a dialog
-suggesting to the user that it's time to go to Market and find a new version of
-the app. You can even provide a link to the new app on Market (see <a
+suggesting to the user that it's time to go to Google Play and find a new version of
+the app. You can even provide a link to the new app on Google Play (see <a
href="{@docRoot}guide/publishing/publishing.html#marketintent">Using Intents
-to Launch Market</a>). </li>
+to Launch Google Play</a>). </li>
</ul>
<li>Change the new application:</li>
<ul>
@@ -311,14 +311,14 @@ and other new features of Android 2.0. </li>
<li>Modify that application's AndroidManifest.xml file: </li>
<ul>
<li>Give the application a new name and a new package name. Currently
-Android Market does not allow you to have two applications with the same
+Google Play does not allow you to have two applications with the same
name/package.</li>
<li>Update (or add) the <code>android:minSdkVersion</code> attribute
to the <code>&lt;uses-sdk&gt;</code> element. To use the new Contacts API,
you should set the value of the attribute to "5" (or higher, as appropriate).</li>
</ul>
</ul>
- <li>Publish both apps on Market, the old app one as an upgrade and the
+ <li>Publish both apps on Google Play, the old app one as an upgrade and the
other as new. Make sure to explain the difference between the apps in their
descriptions.</li>
</ul>
diff --git a/docs/html/resources/articles/creating-input-method.jd b/docs/html/resources/articles/creating-input-method.jd
index e4b77f4..84c2704 100644
--- a/docs/html/resources/articles/creating-input-method.jd
+++ b/docs/html/resources/articles/creating-input-method.jd
@@ -3,248 +3,526 @@ parent.title=Articles
parent.link=../browser.html?tag=article
@jd:body
-
<div id="qv-wrapper">
<div id="qv">
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}resources/articles/on-screen-inputs.html">Onscreen Input Methods</a></li>
- <li><a href="{@docRoot}resources/samples/SoftKeyboard/index.html">Soft Keyboard sample</a></li>
- </ol>
-
+<h2>See also</h2>
+<ol>
+ <li>
+ <a href="{@docRoot}resources/articles/on-screen-inputs.html">Onscreen Input Methods</a>
+ </li>
+ <li>
+ <a href="{@docRoot}resources/samples/SoftKeyboard/index.html">Soft Keyboard sample</a>
+ </li>
+</ol>
</div>
</div>
-
-
-<p>To create an input method (IME) for entering text into text fields
-and other Views, you need to extend the {@link android.inputmethodservice.InputMethodService}.
-class. This class provides much of the basic implementation for an input
-method, in terms of managing the state and visibility of the input method and
-communicating with the currently visible activity.</p>
-
-<p>A good starting point would be the SoftKeyboard sample code provided as part
-of the SDK. You can modify the sample code to start building your own input
-method.</p>
-
-<p>An input method is packaged like any other application or service. In the
-<code>AndroidManifest.xml</code> file, you declare the input method as a
-service, with the appropriate intent filter and any associated meta data:</p>
-
-<pre>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.fastinput"&gt;
-
- &lt;application android:label="@string/app_label"&gt;<br>
- &lt;!-- Declares the input method service --&gt;
- &lt;service android:name="FastInputIME"
- android:label="@string/fast_input_label"
- android:permission="android.permission.BIND_INPUT_METHOD"&gt;
- &lt;intent-filter&gt;
- &lt;action android:name="android.view.InputMethod" /&gt;
- &lt;/intent-filter&gt;
- &lt;meta-data android:name="android.view.im" android:resource="@xml/method" /&gt;
- &lt;/service&gt;
-
- &lt;!-- Optional activities. A good idea to have some user settings. --&gt;
- &lt;activity android:name="FastInputIMESettings" android:label="@string/fast_input_settings"&gt;
- &lt;intent-filter&gt;
- &lt;action android:name="android.intent.action.MAIN"/&gt;
- &lt;/intent-filter&gt;
- &lt;/activity&gt;
- &lt;/application&gt;
-&lt;/manifest&gt;</pre>
-
-<p>If your input method allows the user to tweak some settings, you should
-provide a settings activity that can be launched from the Settings application.
-This is optional and you may choose to provide all user settings directly in
-your IME's UI.</p>
-
-<p>The typical life-cycle of an <code>InputMethodService</code> looks like
-this:</p>
-
-<p><img src="images/ime_003.png" style="border: medium none ; width: 374px; height: 871px;"></p>
-
-<h3>Visual Elements</h3>
-
-<p>There are two main visual elements for an input method—the input view and the
-candidates view. You don't have to follow this style though, if one of them is
-not relevant to your input method experience.</p>
-
-<h4>Input View</h4>
-
-<p>This is where the user can input text either in the form of keypresses,
-handwriting or other gestures. When the input method is displayed for the first
-time, <code>InputMethodService.onCreateInputView()</code> will be called. Create
-and return the view hierarchy that you would like to display in the input method
-window.</p>
-
-<h4>Candidates View</h4>
-
-<p>This is where potential word corrections or completions are presented to the
-user for selection. Again, this may or may not be relevant to your input method
-and you can return <code>null</code> from calls to
-<code>InputMethodService.onCreateCandidatesView()</code>, which is the default
-behavior.</p>
-
-<h3>Designing for the different Input Types</h3>
-
-<p>An application's text fields can have different input types specified on
-them, such as free form text, numeric, URL, email address and search. When you
-implement a new input method, you need to be aware of the different input types.
-Input methods are not automatically switched for different input types and so
-you need to support all types in your IME. However, the IME is not responsible
-for validating the input sent to the application. That's the responsibility of
-the application.</p>
-
-<p>For example, the LatinIME provided with the Android platform provides
-different layouts for text and phone number entry:</p>
-
-<p><img style="margin: 0pt 10px 0pt 0pt; width: 319px; height: 198px;" src="images/ime_002.png"><img style="width: 320px; height: 199px;" src="images/ime.png"></p>
-
-<p><code>InputMethodService.onStartInputView()</code> is called with an<code>
-EditorInfo</code> object that contains details about the input type and other
-attributes of the application's text field.</p><p>(<code>EditorInfo.inputType
-&amp; EditorInfo.TYPE_CLASS_MASK</code>) can be one of many different values,
-including:</p>
-
+<p>
+ An input method editor (IME) is a user control that enables users to enter text. Android
+ provides an extensible input method framework that allows applications to provide users
+ alternative input methods, such as on-screen keyboards or even speech input. Once installed,
+ users can select which IME they want to use from the system settings and use it across the
+ entire system; only one IME may be enabled at a time.
+</p>
+<p>
+ To add an IME to the Android system, you create an Android application
+ containing a class that extends {@link android.inputmethodservice.InputMethodService}. In
+ addition, you usually create a "settings" activity that passes options to the IME
+ service. You can also define a settings UI that's displayed as part of the system settings.
+</p>
+<p>This article covers the following:</p>
<ul>
-<li><code>TYPE_CLASS_NUMBER</code></li>
-<li><code>TYPE_CLASS_DATETIME</code></li>
-<li><code>TYPE_CLASS_PHONE</code></li>
-<li><code>TYPE_CLASS_TEXT</code></li>
+ <li>The IME lifecycle.</li>
+ <li>Declaring IME components in the application manifest.</li>
+ <li>The IME API.</li>
+ <li>Designing an IME UI.</li>
+ <li>Sending text from an IME to an application.</li>
+ <li>Working with IME subtypes.</li>
</ul>
+<p>
+ If you haven't worked with IMEs before, you should read the introductory article
+ <a href="{@docRoot}resources/articles/on-screen-inputs.html">Onscreen Input Methods</a> first.
+ Also, the Soft Keyboard sample app included in the SDK contains sample code that you can modify
+ to start building your own IME.
+</p>
+<h2 id="InputMethodLifecycle">The IME Lifecycle</h2>
+<p>
+ The following diagram describes the life cycle of an IME:
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_lifecycle_image.png" alt="" height="845"
+ id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> The life cycle of an IME.
+</p>
+<p>
+ The following sections describe how to implement the UI and code associated with an IME that
+ follows this lifecycle.
+</p>
+<h2 id="DefiningIME">Declaring IME Components in the Manifest</h2>
+<p>
+ In the Android system, an IME is an Android application that contains a special IME service.
+ The application's manifest file must declare the service, request the necessary permissions,
+ provide an intent filter that matches the action <code>action.view.InputMethod</code>, and
+ provide metadata that defines characteristics of the IME. In addition, to provide a settings
+ interface that allows the user to modify the behavior of the IME, you can define a "settings"
+ activity that can be launched from System Settings.
+</p>
+<p>
+ The following snippet declares IME service. It requests the permission {@link
+ android.Manifest.permission#BIND_INPUT_METHOD} to allow the service to connect the IME to
+ the system, sets up an intent filter that matches the action
+ <code>android.view.InputMethod</code>, and defines metadata for the IME:
+</p>
+<pre>
+&lt;!-- Declares the input method service --&gt;
+ &lt;service android:name="FastInputIME"
+ android:label="&#64;string/fast_input_label"
+ android:permission="android.permission.BIND_INPUT_METHOD"&gt;
+ &lt;intent-filter&gt;
+ &lt;action android:name="android.view.InputMethod" /&gt;
+ &lt;/intent-filter&gt;
+ &lt;meta-data android:name="android.view.im" android:resource="&#64;xml/method" /&gt;
+ &lt;/service&gt;
+</pre>
+<p>
+ This next snippet declares the settings activity for the IME. It has an intent filter for
+ {@link android.content.Intent#ACTION_MAIN} that indicates this activity is the main entry point
+ for the IME application:</p>
+<pre>
+ &lt;!-- Optional: an activity for controlling the IME settings --&gt;
+ &lt;activity android:name="FastInputIMESettings"
+ android:label="&#64;string/fast_input_settings"&gt;
+ &lt;intent-filter&gt;
+ &lt;action android:name="android.intent.action.MAIN"/&gt;
+ &lt;/intent-filter&gt;
+ &lt;/activity&gt;
+</pre>
+<p>
+ You can also provide access to the IME's settings directly from its UI.
+</p>
+<h2 id="IMEAPI">The Input Method API</h2>
+<p>
+ Classes specific to IMEs are found in the {@link android.inputmethodservice} and {@link
+ android.view.inputmethod} packages. The {@link android.view.KeyEvent} class is important for
+ handling keyboard characters.
+</p>
+<p>
+ The central part of an IME is a service component, a class that extends
+ {@link android.inputmethodservice.InputMethodService}. In addition to implementing the
+ normal service lifecycle, this class has callbacks for providing your IME's UI, handling user
+ input, and delivering text to the field that currently has focus. By default, the
+ {@link android.inputmethodservice.InputMethodService} class provides most of the implementation
+ for managing the state and visibility of the IME and communicating with the current
+ input field.
+</p>
+<p>
+ The following classes are also important:
+</p>
+<dl>
+ <dt>{@link android.view.inputmethod.BaseInputConnection}</dt>
+ <dd>
+ Defines the communication channel from an {@link android.view.inputmethod.InputMethod}
+ back to the application that is receiving its input. You use it to read text around the
+ cursor, commit text to the text box, and send raw key events to the application.
+ Applications should extend this class rather than implementing the base interface
+ {@link android.view.inputmethod.InputConnection}.
+ </dd>
+ <dt>{@link android.inputmethodservice.KeyboardView}</dt>
+ <dd>
+ An extension of {@link android.view.View} that renders a keyboard and responds to user
+ input events. The keyboard layout is specified by an instance of
+ {@link android.inputmethodservice.Keyboard}, which you can define in an XML file.
+ </dd>
+</dl>
+<h2 id="IMEUI">Designing the Input Method UI</h2>
+<p>
+ There are two main visual elements for an IME: the <strong>input</strong> view and the
+ <strong>candidates</strong> view. You only have to implement the elements that are relevant to
+ the input method you're designing.
+</p>
+<h3 id="InputView">Input view</h3>
+<p>
+ The input view is the UI where the user inputs text, in the form of keyclicks, handwriting or
+ gestures. When the iIME is displayed for the first time, the system calls the
+ {@link android.inputmethodservice.InputMethodService#onCreateInputView()} callback. In your
+ implementation of this method, you create the layout you want to display in the IME
+ window and return the layout to the system. This snippet is an example of implementing the
+ {@link android.inputmethodservice.InputMethodService#onCreateInputView()} method:
+<pre>
+ &#64;Override
+ public View onCreateInputView() {
+ MyKeyboardView inputView =
+ (MyKeyboardView) getLayoutInflater().inflate( R.layout.input, null);
+
+ inputView.setOnKeyboardActionListener(this); inputView.setKeyboard(mLatinKeyboard);
+
+ return mInputView;
+ }
+</pre>
+<p>
+ In this example, {@code MyKeyboardView} is an instance of a custom implementation of
+ {@link android.inputmethodservice.KeyboardView} that renders a
+ {@link android.inputmethodservice.Keyboard}. If you’re building a traditional QWERTY keyboard,
+ see the <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample
+ app for an example of how to extend the {@link android.inputmethodservice.KeyboardView} class.
+</p>
+<h3 id="CandidateView">Candidates view</h3>
+<p>
+ The candidates view is the UI where the IME displays potential word corrections or
+ suggestions for the user to select. In the IME lifecycle, the system calls
+ {@link android.inputmethodservice.InputMethodService#onCreateCandidatesView()} when it's ready
+ to display the candidate view. In your implementation of this method, return a layout that shows
+ word suggestions, or return null if you don’t want to show anything (a null response is the
+ default behavior, so you don’t have to implement this if you don’t provide suggestions).</p>
+<p>
+ For an example implementation that provides user suggestions, see the
+ <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample app.
+</p>
+<h3 id="DesignConsiderations">UI design considerations</h3>
+<p>
+ This section describes some specific UI design considerations for IMEs.
+</p>
+<h4>Handling multiple screen sizes</h4>
+<p>
+ The UI for your IME must be able to scale for different screen sizes, and it also
+ must handle both landscape and portrait orientations. In non-fullscreen IME mode, leave
+ sufficient space for the application to show the text field and any associated context, so that
+ no more than half the screen is occupied by the IME. In fullscreen IME mode this is not an
+ issue.
+</p>
+<h4>Handling different input types</h4>
+<p>
+ Android text fields allow you to set a specific input type, such as free form text, numbers,
+ URLs, email addresses, and search strings. When you implement a new IME, you need to
+ detect the input type of each field and provide the appropriate interface for it. However, you
+ don't have to set up your IME to check that the user entered text that's valid for the
+ input type; that's the responsibility of the application that owns the text field.
+</p>
+<p>
+ For example, here are screenshots of the interfaces that the Latin IME provided with the
+ Android platform provides for text and phone number inputs:
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_text_type_screenshot.png" alt=""
+ height="142" id="figure2" />
+<img src="{@docRoot}resources/articles/images/inputmethod_numeric_type_screenshot.png" alt=""
+ height="120" id="figure2a" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> Latin IME input types.
+</p>
+<p>
+ When an input field receives focus and your IME starts, the system calls
+ {@link android.inputmethodservice.InputMethodService#onStartInputView(EditorInfo, boolean)
+ onStartInputView()}, passing in an {@link android.view.inputmethod.EditorInfo} object that
+ contains details about the input type and other attributes of the text field. In this object,
+ the {@link android.view.inputmethod.EditorInfo#inputType} field contains the text field's input
+ type.
+</p>
+<p>
+ The {@link android.view.inputmethod.EditorInfo#inputType} field is an <code>int</code>
+ that contains bit patterns for various input type settings. To test it for the text field's
+ input type, mask it with the constant {@link android.text.InputType#TYPE_MASK_CLASS}, like
+ this:
+</p>
+<pre>
+inputType &amp; InputType.TYPE_MASK_CLASS
+</pre>
+<p>
+The input type bit pattern can have one of several values, including:
+</p>
+<dl>
+ <dt>{@link android.text.InputType#TYPE_CLASS_NUMBER}</dt>
+ <dd>
+ A text field for entering numbers. As illustrated in the previous screen shot, the
+ Latin IME displays a number pad for fields of this type.
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_CLASS_DATETIME}</dt>
+ <dd>
+ A text field for entering a date and time.
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_CLASS_PHONE}</dt>
+ <dd>
+ A text field for entering telephone numbers.
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_CLASS_TEXT}</dt>
+ <dd>
+ A text field for entering all supported characters.
+ </dd>
+</dl>
+<p>
+ These constants are described in more detail in the reference documentation for
+ {@link android.text.InputType}.
+</p>
+<p>
+ The {@link android.view.inputmethod.EditorInfo#inputType} field can contain other bits that
+ indicate a variant of the text field type, such as:
+</p>
+<dl>
+ <dt>{@link android.text.InputType#TYPE_TEXT_VARIATION_PASSWORD}</dt>
+ <dd>
+ A variant of {@link android.text.InputType#TYPE_CLASS_TEXT} for entering passwords. The
+ input method will display dingbats instead of the actual text.
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_TEXT_VARIATION_URI}</dt>
+ <dd>
+ A variant of {@link android.text.InputType#TYPE_CLASS_TEXT} for entering web URLs and
+ other Uniform Resource Identifiers (URIs).
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_TEXT_FLAG_AUTO_COMPLETE}</dt>
+ <dd>
+ A variant of {@link android.text.InputType#TYPE_CLASS_TEXT} for entering text that the
+ application "auto-completes" from a dictionary, search, or other facility.
+ </dd>
+</dl>
+<p>
+ Remember to mask {@link android.view.inputmethod.EditorInfo#inputType} with the appropriate
+ constant when you test for these variants. The available mask constants are listed in the
+ reference documentation for {@link android.text.InputType}.
+</p>
+<p class="caution">
+ <strong>Caution:</strong> In your own IME, make sure you handle text correctly when you send it
+ to a password field. Hide the password in your UI both in the input view and in the candidates
+ view. Also remember that you shouldn't store passwords on a device. To learn more, see the <a
+ href="{@docRoot}guide/practices/security.html">Designing for Security</a> guide.
+</p>
+<h2 id="SendText">Sending Text to the Application</h2>
+<p>
+ As the user inputs text with your IME, you can send text to the application by
+ sending individual key events or by editing the text around the cursor in the application's text
+ field. In either case, you use an instance of {@link android.view.inputmethod.InputConnection}
+ to deliver the text. To get this instance, call
+ {@link android.inputmethodservice.InputMethodService#getCurrentInputConnection
+ InputMethodService.getCurrentInputConnection()}.
+</p>
+<h3 id="EditingCursor">Editing the text around the cursor</h3>
+<p>
+ When you're handling the editing of existing text in a text field, some of the more useful
+ methods in {@link android.view.inputmethod.BaseInputConnection} are:
+</p>
+<dl>
+ <dt>
+ {@link android.view.inputmethod.BaseInputConnection#getTextBeforeCursor(int, int)
+ getTextBeforeCursor()}</dt>
+ <dd>
+ Returns a {@link java.lang.CharSequence} containing the number of requested characters
+ before the current cursor position.
+ </dd>
+ <dt>
+ {@link android.view.inputmethod.BaseInputConnection#getTextAfterCursor(int, int)
+ getTextAfterCursor()}
+ </dt>
+ <dd>
+ Returns a {@link java.lang.CharSequence} containing the number of requested characters
+ following the current cursor position.
+ </dd>
+ <dt>
+ {@link android.view.inputmethod.BaseInputConnection#deleteSurroundingText(int, int)
+ deleteSurroundingText()}
+ </dt>
+ <dd>
+ Deletes the specified number of characters before and following the current cursor
+ position.
+ </dd>
+ <dt>
+ {@link android.view.inputmethod.BaseInputConnection#commitText(CharSequence, int)
+ commitText()}
+ </dt>
+ <dd>
+ Commit a {@link java.lang.CharSequence} to the text field and set a new cursor
+ position.
+ </dd>
+</dl>
+<p>
+ For example, the following snippet shows how to replace the text "Fell" to the left of the
+ with the text "Hello!":
+</p>
+<pre>
+ InputConnection ic = getCurrentInputConnection();
+
+ ic.deleteSurroundingText(4, 0);
+
+ ic.commitText("Hello", 1);
+
+ ic.commitText("!", 1);
+</pre>
+<h3 id="ComposeThenCommit">Composing text before committing</h3>
+<p>
+ If your IME does text prediction or requires multiple steps to compose a glyph or
+ word, you can show the progress in the text field until the user commits the word, and then you
+ can replace the partial composition with the completed text. You may give special treatment to
+ the text by adding a "span" to it when you pass it to InputConnection#setComposingText().
+</p>
+<p>
+ The following snippet shows how to show progress in a text field:
+</p>
+<pre>
+ InputConnection ic = getCurrentInputConnection();
+
+ ic.setComposingText("Composi", 1);
+...
-<p>See <code>android.text.InputType</code> for more details.</p>
-
-<p><code>EditorInfo.inputType</code> can contain other masked bits that
-indicate the class variation and other flags. For example,
-<code>TYPE_TEXT_VARIATION_PASSWORD</code> or <code>TYPE_TEXT_VARIATION_URI</code>
-or <code>TYPE_TEXT_FLAG_AUTO_COMPLETE</code>.</p>
-
-<h4>Password fields</h4>
-
-<p>Pay
-specific attention when sending text to password fields. Make sure that
-the password is not visible within your UI &mdash; neither in the input
-view or the candidates view. Also, do not save the password anywhere without
-explicitly informing the user.</p>
-
-<h3>Landscape vs. portrait</h3>
-
-<p>The UI needs to be able to scale between landscape and portrait orientations.
-In non-fullscreen IME mode, leave sufficient space for the application to show
-the text field and any associated context. Preferably, no more than half the
-screen should be occupied by the IME. In fullscreen IME mode this is not an
-issue.</p>
-
-<h3>Sending text to the application</h3>
-
-<p>There are two ways to send text to the application. You can either send
-individual key events or you can edit the text around the cursor in the
-application's text field.</p>
-
-<p>To send a key event, you can simply construct KeyEvent objects and call
-<code>InputConnection.sendKeyEvent()</code>. Here are some examples:</p>
-
-<pre>InputConnection ic = getCurrentInputConnection();
-long eventTime = SystemClock.uptimeMillis();
-ic.sendKeyEvent(new KeyEvent(eventTime, eventTime,
- KeyEvent.ACTION_DOWN, keyEventCode, 0, 0, 0, 0,
- KeyEvent.FLAG_SOFT_KEYBOARD|KeyEvent.FLAG_KEEP_TOUCH_MODE));
-ic.sendKeyEvent(new KeyEvent(SystemClock.uptimeMillis(), eventTime,
- KeyEvent.ACTION_UP, keyEventCode, 0, 0, 0, 0,
- KeyEvent.FLAG_SOFT_KEYBOARD|KeyEvent.FLAG_KEEP_TOUCH_MODE));</pre>
-
-<p>Or use the convenience method:</p>
-
-<pre>InputMethodService.sendDownUpKeyEvents(keyEventCode);</pre>
-
-<p class="note"><strong>Note</strong>:
-It is recommended to use the above method for certain fields such as
-phone number fields because of filters that may be applied to the text
-after each key press. Return key and delete key should also be sent as
-raw key events for certain input types, as applications may be watching
-for specific key events in order to perform an action.</p>
+ ic.setComposingText("Composin", 1);
-<p>When editing text in a text field, some of the more useful methods on
-<code>android.view.inputmethod.InputConnection</code> are:</p>
+...
+ ic.commitText("Composing ", 1);
+</pre>
+<p>
+ The following screenshots show how this appears to the user:
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_composing_text_1.png" alt="" height="54"
+ id="figure3a" />
+<img src="{@docRoot}resources/articles/images/inputmethod_composing_text_2.png" alt="" height="53"
+ id="figure3b" />
+<img src="{@docRoot}resources/articles/images/inputmethod_composing_text_3.png" alt="" height="31"
+ id="figure3c" />
+<p class="img-caption">
+ <strong>Figure 3.</strong> Composing text before committing.
+</p>
+<h3 id="HardwareKeyEvents">Intercepting hardware key events</h3>
+<p>
+ Even though the input method window doesn't have explicit focus, it receives hardware key
+ events first and can choose to consume them or forward them along to the application. For
+ example, you may want to consume the directional keys to navigate within your UI for candidate
+ selection during composition. You may also want to trap the back key to dismiss any popups
+ originating from the input method window.</p>
+<p>
+ To intercept hardware keys, override
+ {@link android.inputmethodservice.InputMethodService#onKeyDown(int, KeyEvent) onKeyDown()}
+ and {@link android.inputmethodservice.InputMethodService#onKeyUp(int, KeyEvent) onKeyUp()}.
+ See the <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample
+ app for an example.
+</p>
+<p>
+ Remember to call the <code>super()</code> method for keys you don't want to handle yourself.
+</p>
+<h2 id="IMESubTypes">Creating an IME Subtype</h2>
+<p>
+ Subtypes allow the IME to expose multiple input modes and languages supported by an IME. A
+ subtype can represent:
+</p>
<ul>
-<li><code>getTextBeforeCursor()</code></li>
-<li><code>getTextAfterCursor()</code></li>
-<li><code>deleteSurroundingText()</code></li>
-<li><code>commitText()</code></li>
+ <li>A locale such as en_US or fr_FR</li>
+ <li>An input mode such as voice, keyboard, or handwriting</li>
+ <li>
+ Other input styles, forms, or properties specific to the IME, such as 10-key or qwerty
+ keyboard layouts.
+ </li>
</ul>
-
-<p>For example, let's say the text "Fell" is to the left of the cursor
-and you want to replace it with "Hello!":</p>
-
-<pre>InputConnection ic = getCurrentInputConnection();
-ic.deleteSurroundingText(4, 0);
-ic.commitText("Hello", 1);
-ic.commitText("!", 1);</pre>
-
-<h4>Composing text before committing</h4>
-
-<p>If your input method does some kind of text prediction or requires multiple
-steps to compose a word or glyph, you can show the progress in the text field
-until the user commits the word and then you can replace the partial composition
-with the completed text. The text that is being composed will be highlighted in
-the text field in some fashion, such as an underline.</p>
-
-<pre>InputConnection ic = getCurrentInputConnection();
-ic.setComposingText("Composi", 1);
-...
-ic.setComposingText("Composin", 1);
-...
-ic.commitText("Composing ", 1);</pre>
-
-<p><img style="width: 320px; height: 98px; margin-bottom: 10px;" src="images/ime_006.png">
-<img style="width: 320px; height: 97px; margin-bottom: 10px;" src="images/ime_005.png">
-<img style="width: 320px; height: 97px;" src="images/ime_004.png"></p>
-
-<h3>Intercepting hard key events</h3>
-
-<p>Even though the input method window doesn't have explicit focus, it receives
-hard key events first and can choose to consume them or forward them along to
-the application. For instance, you may want to consume the directional keys to
-navigate within your UI for candidate selection during composition. Or you may
-want to trap the back key to dismiss any popups originating from the input
-method window. To intercept hard keys, override
-<code>InputMethodService.onKeyDown()</code> and
-<code>InputMethodService.onKeyUp().</code> Remember to call
-<code>super.onKey</code>* if you don't want to consume a certain key
-yourself.</p>
-
-<h3>Other considerations</h3>
-
+<p>
+ Basically, the mode can be any text such as "keyboard", "voice", and so forth.
+</p>
+<p>A subtype can also expose a combination of these.</p>
+<p>
+ Subtype information is used for an IME switcher dialog that's available from the notification
+ bar and also for IME settings. The information also allows the framework to bring up a
+ specific subtype of an IME directly. When you build an IME, use the subtype facility, because
+ it helps the user identify and switch between different IME languages and modes.
+</p>
+<p>
+ You define subtypes in one of the input method's XML resource files, using the
+ <code>&lt;subtype&gt;</code> element. The following snippet defines an IME with two
+ subtypes: a keyboard subtype for the US English locale, and another keyboard subtype for the
+ French language locale for France:
+</p>
+<pre>
+&lt;input-method xmlns:android="http://schemas.android.com/apk/res/android"
+ android:settingsActivity="com.example.softkeyboard.Settings"
+ android:icon="&#64;drawable/ime_icon"
+ &lt;subtype android:name="&#64;string/display_name_english_keyboard_ime"
+ android:icon="&#64;drawable/subtype_icon_english_keyboard_ime"
+ android:imeSubtypeLanguage="en_US"
+ android:imeSubtypeMode="keyboard"
+ android:imeSubtypeExtraValue="somePrivateOption=true"
+ /&gt;
+ &lt;subtype android:name="&#64;string/display_name_french_keyboard_ime"
+ android:icon="&#64;drawable/subtype_icon_french_keyboard_ime"
+ android:imeSubtypeLanguage="fr_FR"
+ android:imeSubtypeMode="keyboard"
+ android:imeSubtypeExtraValue="foobar=30,someInternalOption=false"
+ /&gt;
+ &lt;subtype android:name="&#64;string/display_name_german_keyboard_ime"
+ ...
+ /&gt;
+/&gt;
+</pre>
+<p>
+ To ensure that your subtypes are labeled correctly in the UI, use %s to get a subtype label
+ that is the same as the subtype’s locale label. This is demonstrated in the next two snippets.
+ The first snippet shows part of the input method's XML file:
+</p>
+<pre>
+ &lt;subtype
+ android:label="&#64;string/label_subtype_generic"
+ android:imeSubtypeLocale="en_US"
+ android:icon="&#64;drawable/icon_en_us"
+ android:imeSubtypeMode="keyboard" /&gt;
+</pre>
+<p>
+ The next snippet is part of the IME's <code>strings.xml</code> file. The string
+ resource <code>label_subtype_generic</code>, which is used by the input method UI definition to
+ set the subtype's label, is defined as:
+</p>
+<pre>
+&lt;string name="label_subtype_generic"&gt;%s&lt;/string&gt;
+</pre>
+<p>
+ This sets the subtype’s display name to “English (United States)” in any English language
+ locale, or to the appropriate localization in other locales.
+</p>
+<h3 id="SubtypeProcessing">Choosing IME subtypes from the notification bar</h3>
+<p>
+ The Android system manages all subtypes exposed by all IMEs. IME subtypes are
+ treated as modes of the IME they belong to. In the notification bar, a user can select an
+ available subtype for the currently-set IME, as shown in the following screenshot:
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_subtype_notification.png" alt=""
+ height="85" id="figure4" />
+<p class="img-caption">
+ <strong>Figure 4.</strong> Choosing an IME subtype from the notification bar.
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_subtype_preferences.png" alt=""
+ height="165" id="figure5" />
+<p class="img-caption">
+ <strong>Figure 5.</strong> Setting subtype preferences in System Settings.
+</p>
+<h3 id="SubtypeSettings">Choosing IME subtypes from System Settings</h3>
+<p>
+ A user can control how subtypes are used in the “Language &amp; input” settings panel in the
+ System Settings area. In the Soft Keyboard sample, the file
+ <code>InputMethodSettingsFragment.java</code> contains an implementation that
+ facilitates a subtype enabler in the IME settings. Please refer to the SoftKeyboard sample in
+ the Android SDK for more information about how to support Input Method Subtypes in your IME.
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_subtype_settings.png" alt=""
+ height="210" id="figure6" />
+<p class="img-caption">
+ <strong>Figure 6.</strong> Choosing a language for the IME.
+</p>
+<h2 id="GeneralDesign">General IME Considerations</h2>
+<p>
+ Here are some other things to consider as you're implementing your IME:
+</p>
<ul>
-<li>Provide a way for the user to easily bring up any associated settings
-directly from the input method UI</li>
-<li>Provide
-a way for the user to switch to a different input method (multiple
-input methods may be installed) directly from the input method UI.</li>
-<li>Bring
-up the UI quickly - preload or lazy-load any large resources so that
-the user sees the input method quickly on tapping on a text field. And
-cache any resources and views for subsequent invocations of the input
-method.</li>
-<li>On the flip side, any large memory allocations should
-be released soon after the input method window is hidden so that
-applications can have sufficient memory to run. Consider using a
-delayed message to release resources if the input method is in a hidden
-state for a few seconds.</li>
-<li>Make sure that most common characters
-can be entered using the input method, as users may use punctuation in
-passwords or user names and they shouldn't be stuck in a situation
-where they can't enter a certain character in order to gain access into
-a password-locked device.</li>
+<li>
+ Provide a way for users to set options directly from the IME's UI.
+</li>
+<li>
+ Because multiple IMEs may be installed on the device, provide a way for the user to switch to a
+ different IME directly from the input method UI.
+</li>
+<li>
+ Bring up the IME's UI quickly. Preload or load on demand any large resources so that users
+ see the IME as soon as they tap on a text field. Cache resources and views for subsequent
+ invocations of the input method.
+</li>
+<li>
+ Conversely, you should release large memory allocations soon after the input method window is
+ hidden, so that applications can have sufficient memory to run. Consider using a delayed message
+ to release resources if the IME is in a hidden state for a few seconds.
+</li>
+<li>
+ Make sure that users can enter as many characters as possible for the language or locale
+ associated with the IME. Remember that users may use punctuation in passwords or user
+ names, so your IME has to provide many different characters to allow users to enter a
+ password and get access to the device.
+</li>
</ul>
-
-<h3>Samples</h3>
-
-<p>For a real world example, with support for multiple input types and text
-prediction, see the <a id="ccpb"
-href="http://android.git.kernel.org/?p=platform/packages/inputmethods/LatinIME.
-git;a=tree" title="LatinIME source code online">LatinIME source code</a>. The
-Android SDK also includes a SoftKeyboard sample as well.</p>
diff --git a/docs/html/resources/articles/faster-screen-orientation-change.jd b/docs/html/resources/articles/faster-screen-orientation-change.jd
index 52531bb..e7b73bf 100644
--- a/docs/html/resources/articles/faster-screen-orientation-change.jd
+++ b/docs/html/resources/articles/faster-screen-orientation-change.jd
@@ -58,7 +58,7 @@ though.</p>
<p>When your application displays a lot of data, or data that is expensive to fetch,
the automatic destruction/creation of the activities can be lead to a
-painful user experience. Take the example of <a href="http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/">Photostream</a>,
+painful user experience. Take the example of <a href="http://code.google.com/p/apps-for-android/source/browse/#git%2FPhotostream%2Fsrc%2Fcom%2Fgoogle%2Fandroid%2Fphotostream">Photostream</a>,
a simple Flickr browsing application. After you launch the application and choose a Flickr account, the
application downloads a set of 6 photos (on a T-Mobile G1) from the
Flickr servers and displays them on screen. To improve the user
@@ -80,9 +80,9 @@ offers a great API exactly for that purpose.</p>
<p>The Activity class has a special method called
{@link android.app.Activity#onRetainNonConfigurationInstance()}. This method
-can be used to pass an arbitrary object <em>your future self</em> and Android
+can be used to pass an arbitrary object to <em>your future self</em> and Android
is smart enough to call this method only when needed. In the case of Photostream,
-the application <a href="http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/PhotostreamActivity.java#226">used this method</a>
+the application used this method
to pass the downloaded images to the future activity on orientation change.
The implementation can be summarized like so:</p>
@@ -96,7 +96,7 @@ public Object onRetainNonConfigurationInstance() {
<p>In the new activity, in <code>onCreate()</code>, all you have to do to
get your object back is to call {@link android.app.Activity#getLastNonConfigurationInstance()}.
-In Photostream, <a href="http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/PhotostreamActivity.java#251">this method is invoked</a>
+In Photostream, this method is invoked
and if the returned value is not null, the grid is loaded with the list of
photos from the previous activity:</p>
@@ -128,3 +128,6 @@ only, not the drawables. Finally, remember that
<code>onRetainNonConfigurationChange()</code> should be used only to retain
data that is expensive to load. Otherwise, keep it simple and let Android
do everything.</p>
+
+<p>Also read the guide to <a href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime
+Changes</a>.</p>
diff --git a/docs/html/resources/articles/images/inputmethod_composing_text_1.png b/docs/html/resources/articles/images/inputmethod_composing_text_1.png
new file mode 100644
index 0000000..3403489
--- /dev/null
+++ b/docs/html/resources/articles/images/inputmethod_composing_text_1.png
Binary files differ
diff --git a/docs/html/resources/articles/images/inputmethod_composing_text_2.png b/docs/html/resources/articles/images/inputmethod_composing_text_2.png
new file mode 100644
index 0000000..67bd1d9
--- /dev/null
+++ b/docs/html/resources/articles/images/inputmethod_composing_text_2.png
Binary files differ
diff --git a/docs/html/resources/articles/images/inputmethod_composing_text_3.png b/docs/html/resources/articles/images/inputmethod_composing_text_3.png
new file mode 100644
index 0000000..4fd1a30
--- /dev/null
+++ b/docs/html/resources/articles/images/inputmethod_composing_text_3.png
Binary files differ
diff --git a/docs/html/resources/articles/images/inputmethod_lifecycle_image.png b/docs/html/resources/articles/images/inputmethod_lifecycle_image.png
new file mode 100644
index 0000000..5f7cf95
--- /dev/null
+++ b/docs/html/resources/articles/images/inputmethod_lifecycle_image.png
Binary files differ
diff --git a/docs/html/resources/articles/images/inputmethod_numeric_type_screenshot.png b/docs/html/resources/articles/images/inputmethod_numeric_type_screenshot.png
new file mode 100644
index 0000000..61b7483
--- /dev/null
+++ b/docs/html/resources/articles/images/inputmethod_numeric_type_screenshot.png
Binary files differ
diff --git a/docs/html/resources/articles/images/inputmethod_subtype_notification.png b/docs/html/resources/articles/images/inputmethod_subtype_notification.png
new file mode 100644
index 0000000..3f13927
--- /dev/null
+++ b/docs/html/resources/articles/images/inputmethod_subtype_notification.png
Binary files differ
diff --git a/docs/html/resources/articles/images/inputmethod_subtype_preferences.png b/docs/html/resources/articles/images/inputmethod_subtype_preferences.png
new file mode 100644
index 0000000..d8aa0cf
--- /dev/null
+++ b/docs/html/resources/articles/images/inputmethod_subtype_preferences.png
Binary files differ
diff --git a/docs/html/resources/articles/images/inputmethod_subtype_settings.png b/docs/html/resources/articles/images/inputmethod_subtype_settings.png
new file mode 100644
index 0000000..b8942c6
--- /dev/null
+++ b/docs/html/resources/articles/images/inputmethod_subtype_settings.png
Binary files differ
diff --git a/docs/html/resources/articles/images/inputmethod_text_type_screenshot.png b/docs/html/resources/articles/images/inputmethod_text_type_screenshot.png
new file mode 100644
index 0000000..8008b27
--- /dev/null
+++ b/docs/html/resources/articles/images/inputmethod_text_type_screenshot.png
Binary files differ
diff --git a/docs/html/resources/articles/images/spellcheck_client_flow.png b/docs/html/resources/articles/images/spellcheck_client_flow.png
new file mode 100644
index 0000000..4e097aa
--- /dev/null
+++ b/docs/html/resources/articles/images/spellcheck_client_flow.png
Binary files differ
diff --git a/docs/html/resources/articles/images/spellcheck_lifecycle.png b/docs/html/resources/articles/images/spellcheck_lifecycle.png
new file mode 100644
index 0000000..0b10824
--- /dev/null
+++ b/docs/html/resources/articles/images/spellcheck_lifecycle.png
Binary files differ
diff --git a/docs/html/resources/articles/images/textview_spellcheck_screenshot_1.png b/docs/html/resources/articles/images/textview_spellcheck_screenshot_1.png
new file mode 100644
index 0000000..deb47c4
--- /dev/null
+++ b/docs/html/resources/articles/images/textview_spellcheck_screenshot_1.png
Binary files differ
diff --git a/docs/html/resources/articles/images/textview_spellcheck_screenshot_2.png b/docs/html/resources/articles/images/textview_spellcheck_screenshot_2.png
new file mode 100644
index 0000000..e3af4c5
--- /dev/null
+++ b/docs/html/resources/articles/images/textview_spellcheck_screenshot_2.png
Binary files differ
diff --git a/docs/html/resources/articles/index.jd b/docs/html/resources/articles/index.jd
index 220a4ed..2947e4a 100644
--- a/docs/html/resources/articles/index.jd
+++ b/docs/html/resources/articles/index.jd
@@ -47,7 +47,16 @@ parent.link=../browser.html?tag=article
<dt><a href="{@docRoot}resources/articles/glsurfaceview.html">Introducing GLSurfaceView</a></dt>
<dd>This article provides an overview of GLSurfaceView, a class that makes it easy to implement 2D or 3D OpenGL rendering inside of an Android application.</dd>
</dl>
-
+<dl>
+ <dt>
+ <a href="{@docRoot}resources/articles/spell-checker-framework.jd">
+ Using the Spell Checker Framework</a>
+ </dt>
+ <dd>
+ This article describes how to use the Spell Checker Framework to check spelling in
+ various ways in your application.
+ </dd>
+</dl>
<dl>
<dt><a href="{@docRoot}resources/articles/layout-tricks-reuse.html">Layout Tricks: Creating Reusable UI Components</a></dt>
<dd>Learn how to combine multiple standard UI widgets into a single high-level component, which can be reused throughout your application.</dd>
@@ -149,7 +158,7 @@ parent.link=../browser.html?tag=article
</dl>
<dl>
- <dt><a href="{@docRoot}resources/articles/window-bg-speed.html">Window Backgrounds & UI Speed</a></dt>
+ <dt><a href="{@docRoot}resources/articles/window-bg-speed.html">Window Backgrounds &amp; UI Speed</a></dt>
<dd>Some Android applications need to squeeze every bit of performance out of the UI toolkit and there are many ways to do so. In this article, you will discover how to speed up the drawing and the perceived startup time of your activities. Both of these techniques rely on a single feature, the window's background drawable.</dd>
</dl>
diff --git a/docs/html/resources/articles/live-wallpapers.jd b/docs/html/resources/articles/live-wallpapers.jd
index bfbbb34..0692a62 100644
--- a/docs/html/resources/articles/live-wallpapers.jd
+++ b/docs/html/resources/articles/live-wallpapers.jd
@@ -76,19 +76,19 @@ live wallpapers.</li>
supported only on Android 2.1 (API level 7) and higher versions of the platform.
To ensure that your application can only be installed on devices that support
live wallpapers, remember to add the following to the application's manifest
-before publishing to Android Market:</p>
+before publishing to Google Play:</p>
<ul>
<li><code>&lt;uses-sdk android:minSdkVersion="7" /&gt;</code>, which indicates
-to Android Market and the platform that your application requires Android 2.1 or
+to Google Play and the platform that your application requires Android 2.1 or
higher. For more information, see the <a href="{@docRoot}guide/appendix/api-levels.html">API
Levels</a> and the documentation for the
<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code>&lt;uses-sdk&gt;</code></a>
element.</li>
<li><code>&lt;uses-feature android:name="android.software.live_wallpaper" /&gt;</code>,
-which tells Android Market that your application includes a live wallpaper
-Android Market uses this feature as a filter, when presenting users lists of
-available applications. When you declaring this feature, Android Market
+which tells Google Play that your application includes a live wallpaper
+Google Play uses this feature as a filter, when presenting users lists of
+available applications. When you declaring this feature, Google Play
displays your application only to users whose devices support live wallpapers,
while hiding it from other devices on which it would not be able to run. For
more information, see the documentation for the
@@ -98,5 +98,5 @@ href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
element.</li>
</ul>
-<p>Many great live wallpapers are already available on Android Market and
+<p>Many great live wallpapers are already available on Google Play and
we can't wait to see more!</p>
diff --git a/docs/html/resources/articles/speech-input.jd b/docs/html/resources/articles/speech-input.jd
index 0867ff2..2f9cd69 100644
--- a/docs/html/resources/articles/speech-input.jd
+++ b/docs/html/resources/articles/speech-input.jd
@@ -9,7 +9,7 @@ on. </p>
<p>Speech input adds another dimension to staying in touch.
Google's Voice Search application, which is pre-installed on many Android devices
-and available in Android Market, provides powerful features like "search by voice"
+and available on Google Play, provides powerful features like "search by voice"
and Voice Actions like "Navigate to." Further
enhancing the voice experience, Android 2.1 introduces a <a
href="http://www.youtube.com/watch?v=laOlkD8LmZw">
@@ -21,7 +21,7 @@ any context in which you would normally type. </p>
<p> We believe speech can
fundamentally change the mobile experience. We would like to invite every
Android application developer to consider integrating speech input capabilities
-via the Android SDK. One of our favorite apps in the Market that integrates
+via the Android SDK. One of our favorite apps on Google Play that integrates
speech input is <a href="http://www.handcent.com/">Handcent SMS</a>,
because you can dictate a reply to any SMS with a
quick tap on the SMS popup window. Here is Speech input integrated into
diff --git a/docs/html/resources/articles/spell-checker-framework.jd b/docs/html/resources/articles/spell-checker-framework.jd
new file mode 100644
index 0000000..8d57b4e
--- /dev/null
+++ b/docs/html/resources/articles/spell-checker-framework.jd
@@ -0,0 +1,236 @@
+page.title=Using the Spell Checker Framework
+parent.title=Articles
+parent.link=../browser.html?tag=article
+@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In This Document</h2>
+<ol>
+ <li>
+ <a href="#SpellCheckLifeCycle">Spell Check Lifecycle</a>
+ </li>
+ <li>
+ <a href="#SpellCheckImplementation">Implementing a Spell Checker Service</a>
+ </li>
+ <li>
+ <a href="#SpellCheckClient">Implementing a Spell Checker Client</a>
+ </li>
+</ol>
+ <h2>See also</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}resources/samples/SpellChecker/SampleSpellCheckerService/index.html">
+ Spell Checker Service</a> sample app
+ </li>
+ <li>
+ <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
+ Spell Checker Client</a> sample app
+ </li>
+ </ol>
+</div>
+</div>
+
+<p>
+ The Android platform offers a spell 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
+ generates a spell checker <strong>session</strong> object. Based on text you provide,
+ the session object returns spelling suggestions generated by the spell checker.
+</p>
+<h2 id="SpellCheckLifeCycle">Spell Checker Lifecycle</h2>
+<p>
+ The following diagram shows the lifecycle of the spell checker service:
+</p>
+<img src="{@docRoot}resources/articles/images/spellcheck_lifecycle.png" alt="" height="596"
+ id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> The spell checker service lifecycle.
+</p>
+<p>
+ To initiate spell checking, your app starts its implementation of the spell checker
+ service. Clients in your app, such as activities or individual UI elements, request a
+ spell checker session from the service, then use the session to get suggestions for text.
+ As a client terminates its operation, it closes its spell checker session. If necessary, your
+ app can shut down the spell checker service at any time.
+</p>
+<h2 id="SpellCheckImplementation">Implementing a Spell Checker Service</h2>
+<p>
+ To use the spell checker framework in your app, add a spell checker service component including
+ the session object definition. You can also add to your app an optional activity that
+ controls settings. You must also add an XML metadata file that describes
+ the spell checker service, and add the appropriate elements to your manifest file.
+</p>
+<h3 id="SpellCheckCode">Spell checker classes</h3>
+<p>
+ Define the service and session object with the following classes:
+</p>
+<dl>
+ <dt>
+ A subclass of {@link android.service.textservice.SpellCheckerService}
+ </dt>
+ <dd>
+ The {@link android.service.textservice.SpellCheckerService} implements both the
+ {@link android.app.Service} class and the spell checker framework interface. Within your
+ subclass, you must implement the following method:
+ <dl>
+ <dt>{@link android.service.textservice.SpellCheckerService#createSession()}</dt>
+ <dd>
+ A factory method that returns a
+ {@link android.service.textservice.SpellCheckerService.Session} object to a
+ client that wants to do spell checking.
+ </dd>
+ </dl>
+ <p>
+ See the
+ <a href="{@docRoot}resources/samples/SpellChecker/SampleSpellCheckerService/index.html">
+ Spell Checker Service</a> sample app to learn more about implementing this class.
+ </p>
+ </dd>
+ <dt>
+ An implementation of {@link android.service.textservice.SpellCheckerService.Session}
+ </dt>
+ <dd>
+ An object that the spell checker service provides to clients, to let them pass text to
+ the spell checker and receive suggestions. Within this class, you must implement the
+ following methods:
+ <dl>
+ <dt>
+ {@link android.service.textservice.SpellCheckerService.Session#onCreate()}
+ </dt>
+ <dd>
+ Called by the system in response to
+ {@link android.service.textservice.SpellCheckerService#createSession()}. In this
+ method, you can initialize the
+ {@link android.service.textservice.SpellCheckerService.Session} object based on
+ the current locale and so forth.
+ </dd>
+ <dt>
+ {@link android.service.textservice.SpellCheckerService.Session#onGetSuggestions(TextInfo, int)
+ onGetSuggestions()}
+ </dt>
+ <dd>
+ Does the actual spell checking. This method returns an object containing
+ suggestions for the text passed to it.
+ </dd>
+ </dl>
+ <p>
+ Optionally, you can implement
+ {@link android.service.textservice.SpellCheckerService.Session#onCancel()}, which
+ handles requests to cancel spell checking, or
+{@link android.service.textservice.SpellCheckerService.Session#onGetSuggestionsMultiple(TextInfo[], int, boolean)
+onGetSuggestionsMultiple()}, which handles batches of suggestion requests, or both.
+ </p>
+ <p>
+ See the
+ <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
+ Spell Checker Client</a> sample app to learn more about implementing this class.
+ </p>
+ </dd>
+</dl>
+<p class="note">
+ <strong>Note:</strong> You must implement all aspects of spell checking as asynchronous and
+ thread-safe. A spell checker may be called simultaneously by different threads running on
+ different cores. The {@link android.service.textservice.SpellCheckerService} and
+ {@link android.service.textservice.SpellCheckerService.Session} take care of this
+ automatically.
+</p>
+<h3 id="SpellCheckXML">Spell checker manifest and metadata</h3>
+<p>
+ In addition to code, you need to provide the appropriate manifest file and a metadata file for
+ the spell checker.
+</p>
+<p>
+ The manifest file defines the application, the service, and the activity for controlling
+ settings, as shown in the following snippet:
+</p>
+<pre>
+&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.samplespellcheckerservice" &gt;
+ &lt;application
+ android:label="&#64;string/app_name" &gt;
+ &lt;service
+ android:label="&#64;string/app_name"
+ android:name=".SampleSpellCheckerService"
+ android:permission="android.permission.BIND_TEXT_SERVICE" &gt;
+ &lt;intent-filter &gt;
+ &lt;action android:name="android.service.textservice.SpellCheckerService" /&gt;
+ &lt;/intent-filter&gt;
+
+ &lt;meta-data
+ android:name="android.view.textservice.scs"
+ android:resource="&#64;xml/spellchecker" /&gt;
+ &lt;/service&gt;
+
+ &lt;activity
+ android:label="&#64;string/sample_settings"
+ android:name="SpellCheckerSettingsActivity" &gt;
+ &lt;intent-filter &gt;
+ &lt;action android:name="android.intent.action.MAIN" /&gt;
+ &lt;/intent-filter&gt;
+ &lt;/activity&gt;
+ &lt;/application&gt;
+&lt;/manifest&gt;
+</pre>
+<p>
+ Notice that components that want to use the service must request the permission
+ {@link android.Manifest.permission#BIND_TEXT_SERVICE} to ensure that only the system binds to
+ the service. The service's definition also specifies the <code>spellchecker.xml</code> metadata
+ file, which is described in the next section.
+</p>
+<p>
+ The metadata file <code>spellchecker.xml</code> contains the following XML:
+</p>
+<pre>
+&lt;spell-checker xmlns:android="http://schemas.android.com/apk/res/android"
+ android:label="&#64;string/spellchecker_name"
+ android:settingsActivity="com.example.SpellCheckerSettingsActivity"&gt;
+ &lt;subtype
+ android:label="&#64;string/subtype_generic"
+ android:subtypeLocale="en”
+ /&gt;
+ &lt;subtype
+ android:label="&#64;string/subtype_generic"
+ android:subtypeLocale="fr”
+ /&gt;
+&lt;/spell-checker&gt;
+</pre>
+<p>
+ The metadata specifies the activity that the spell checker uses for controlling settings. It
+ also defines subtypes for the spell checker; in this case, the subtypes define locales that
+ the spell checker can handle.
+</p>
+
+
+<!-- Accessing the Spell Checker Service from a Client -->
+<h2 id="SpellCheckClient">Accessing the Spell Checker Service from a Client</h2>
+<p>
+ Applications that use {@link android.widget.TextView} views automatically benefit from spell
+ checking, because {@link android.widget.TextView} automatically uses a spell checker. The
+ following screenshots show this:
+</p>
+<img src="{@docRoot}resources/articles/images/textview_spellcheck_screenshot_1.png" alt=""
+ height="45" id="figure2a" />
+<br>
+<img src="{@docRoot}resources/articles/images/textview_spellcheck_screenshot_2.png" alt=""
+ height="121" id="figure2b" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> Spell checking in TextView.
+</p>
+<p>
+ However, you may want to interact directly with a spell checker service in other cases as well.
+ The following diagram shows the flow of control for interacting with a spell checker service:
+</p>
+<img src="{@docRoot}resources/articles/images/spellcheck_client_flow.png" alt=""
+ height="394" id="figure3" />
+<p class="img-caption">
+ <strong>Figure 3.</strong> Interacting with a spell checker service.
+</p>
+<p>
+ The <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
+ Spell Checker Client</a> sample app shows how to interact with a spell checker service. The
+ LatinIME input method editor in the Android Open Source Project also contains an example of
+ spell checking.
+</p> \ No newline at end of file
diff --git a/docs/html/resources/articles/tts.jd b/docs/html/resources/articles/tts.jd
index 7d07a89..929d084 100644
--- a/docs/html/resources/articles/tts.jd
+++ b/docs/html/resources/articles/tts.jd
@@ -43,7 +43,7 @@ our
know to install the data that's required for the device to become a
multi-lingual talking machine! Downloading and installing the data is
accomplished by firing off the ACTION_INSTALL_TTS_DATA intent, which will take
-the user to Android Market, and will let her/him initiate the download.
+the user to Google Play, and will let her/him initiate the download.
Installation of the data will happen automatically once the download completes.
Here is an example of what your implementation of
<code>onActivityResult()</code> would look like:</p>
diff --git a/docs/html/resources/articles/ui-1.6.jd b/docs/html/resources/articles/ui-1.6.jd
index 09108dd..b3238e3 100644
--- a/docs/html/resources/articles/ui-1.6.jd
+++ b/docs/html/resources/articles/ui-1.6.jd
@@ -129,4 +129,4 @@ leaving you more time to concentrate on your application.</p>
<p>The Android team is committed to helping you write applications in the
easiest and most efficient way possible. We hope you find these improvements
-useful and we're excited to see your applications on Android Market.</p>
+useful and we're excited to see your applications on Google Play.</p>
diff --git a/docs/html/resources/community-groups.jd b/docs/html/resources/community-groups.jd
index 599c4ae..6bd347c 100644
--- a/docs/html/resources/community-groups.jd
+++ b/docs/html/resources/community-groups.jd
@@ -14,7 +14,7 @@ page.title=Developer Forums
<li><a href="#UsingEmail">Using email with the mailing lists</a></li>
<li><a href="#ApplicationDeveloperLists">Application developer mailing lists</a></li>
</ol></li>
- <li><a href="#MarketHelp">Android Market Help Forum</a></li>
+ <li><a href="#PlayHelp">Google Play Help Forum</a></li>
</ol>
</div>
@@ -113,8 +113,8 @@ A low-volume group for security-related announcements by the Android Security Te
</ul>
-<h2 id="MarketHelp">Android Market Help Forum</h2>
+<h2 id="PlayHelp">Google Play Help Forum</h2>
-<p>The <a href="http://www.google.com/support/forum/p/Android+Market">Android Market Help Forum</a> is a web-based discussion forum where you can ask questions or report issues relating to Android Market.</p>
+<p>The <a href="http://support.google.com/googleplay">Google Play Help Forum</a> is a web-based discussion forum where you can ask questions or report issues relating to Google Play.</p>
-<p style="margin-left: 2em"><a href="http://www.google.com/support/forum/p/Android+Market">http://www.google.com/support/forum/p/Android+Market</a></p>
+<p style="margin-left: 2em"><a href="http://support.google.com/googleplay">http://support.google.com/googleplay</a></p>
diff --git a/docs/html/resources/community-more.jd b/docs/html/resources/community-more.jd
index df72926..3089d45 100644
--- a/docs/html/resources/community-more.jd
+++ b/docs/html/resources/community-more.jd
@@ -1,5 +1,5 @@
community=true
-page.title=IRC and Twitter
+page.title=IRC, G+, Twitter
@jd:body
<p>In addition to the <a href="community-groups.html">Android developer forums</a>, you can participate in the Android developer community through IRC and you can follow us on Twitter. </p>
@@ -45,8 +45,27 @@ does not require any installation, to join discussions on the Android IRC channe
</li>
</ul>
+
+<h3 id="gplus">Google+</h3>
+<p>We use a Google+ page to host Hangouts for developers, talk about the latest
+releases, development and design tips, and much more.</p>
+
+<div style='margin-top:1em'><g:plus href='https://plus.google.com/108967384991768947849'
+size='badge'></g:plus></div>
+
+
<h3 id="twitter">Twitter</h3>
<p>You can follow us on Twitter at this account:</p>
<p style="margin-left:2em;"><a href="http://twitter.com/androiddev">http://twitter.com/androiddev</a></p>
+<script type="text/javascript" src="https://plus.google.com/108967384991768947849"
+rel="publisher"></script>
+<script type="text/javascript">
+window.___gcfg = {lang: 'en'};
+(function()
+{var po = document.createElement("script");
+po.type = "text/javascript"; po.async = true;po.src = "https://apis.google.com/js/plusone.js";
+var s = document.getElementsByTagName("script")[0];
+s.parentNode.insertBefore(po, s);
+})();</script> \ No newline at end of file
diff --git a/docs/html/resources/dashboard/opengl.jd b/docs/html/resources/dashboard/opengl.jd
index 4d0abec..4c55522 100644
--- a/docs/html/resources/dashboard/opengl.jd
+++ b/docs/html/resources/dashboard/opengl.jd
@@ -50,14 +50,14 @@ href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
uses.</p>
<p class="note"><strong>Note:</strong> This data is based on the number
-of Android devices that have accessed Android Market within a 7-day period
+of Android devices that have accessed Google Play within a 7-day period
ending on the data collection date noted below.</p>
<div class="dashboard-panel">
<img alt="" width="400" height="250"
-src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=GL%201.1|GL%202.0%20%26%201.1&chd=t%3A10.1,89.9" />
+src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=GL%201.1%20only|GL%202.0%20%26%201.1&chd=t%3A11.9,88.1" />
<table>
<tr>
@@ -65,15 +65,15 @@ src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=
<th scope="col">Distribution</th>
</tr>
<tr>
-<td>1.1</th>
-<td>10.1%</td>
+<td>1.1 only</th>
+<td>11.9%</td>
</tr>
<tr>
-<td>2.0</th>
-<td>89.9%</td>
+<td>2.0 &amp; 1.1</th>
+<td>88.1%</td>
</tr>
</table>
-<p><em>Data collected during a 7-day period ending on December 1, 2011</em></p>
+<p><em>Data collected during a 7-day period ending on April 2, 2012</em></p>
</div>
diff --git a/docs/html/resources/dashboard/platform-versions.jd b/docs/html/resources/dashboard/platform-versions.jd
index 72370bb..2cbbe99 100644
--- a/docs/html/resources/dashboard/platform-versions.jd
+++ b/docs/html/resources/dashboard/platform-versions.jd
@@ -47,12 +47,12 @@ platform version, see <a href="{@docRoot}guide/appendix/api-levels.html">API Lev
<h3 id="Current">Current Distribution</h3>
<p>The following pie chart and table is based on the number of Android devices that have accessed
-Android Market within a 14-day period ending on the data collection date noted below.</p>
+Google Play within a 14-day period ending on the data collection date noted below.</p>
<div class="dashboard-panel">
<img alt="" height="250" width="470"
-src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.8,1.3,9.6,35.3,0.5,50.1,0.1,1.1,1.2&chl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.0|Android%203.1|Android%203.2&chco=c4df9b,6fad0c" />
+src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.3,0.7,6.0,23.1,0.5,63.2,0.1,1.0,2.2,0.5,2.4&chl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.0|Android%203.1|Android%203.2|Android%204.0|Android%204.0.3&chco=c4df9b,6fad0c" />
<table>
<tr>
@@ -61,21 +61,25 @@ src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.8,1.3,9.6,35.
<th>API Level</th>
<th>Distribution</th>
</tr>
-<tr><td><a href="{@docRoot}sdk/android-1.5.html">Android 1.5</a></td><td>Cupcake</td> <td>3</td><td>0.8%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-1.6.html">Android 1.6</a></td><td>Donut</td> <td>4</td><td>1.3%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-2.1.html">Android 2.1</a></td><td>Eclair</td> <td>7</td><td>9.6%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-2.2.html">Android 2.2</a></td><td>Froyo</td> <td>8</td><td>35.3%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-1.5.html">Android 1.5</a></td><td>Cupcake</td> <td>3</td><td>0.3%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-1.6.html">Android 1.6</a></td><td>Donut</td> <td>4</td><td>0.7%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-2.1.html">Android 2.1</a></td><td>Eclair</td> <td>7</td><td>6.0%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-2.2.html">Android 2.2</a></td><td>Froyo</td> <td>8</td><td>23.1%</td></tr>
<tr><td><a href="{@docRoot}sdk/android-2.3.html">Android 2.3 -<br/>
Android 2.3.2</a></td><td rowspan="2">Gingerbread</td> <td>9</td><td>0.5%</td></tr>
<tr><td><a href="{@docRoot}sdk/android-2.3.3.html">Android 2.3.3 -<br/>
- Android 2.3.7</a></td><!-- Gingerbread --> <td>10</td><td>50.1%</td></tr>
+ Android 2.3.7</a></td><!-- Gingerbread --> <td>10</td><td>63.2%</td></tr>
<tr><td><a href="{@docRoot}sdk/android-3.0.html">Android 3.0</a></td>
<td rowspan="3">Honeycomb</td> <td>11</td><td>0.1%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-3.1.html">Android 3.1</a></td><!-- Honeycomb --><td>12</td><td>1.1%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-3.2.html">Android 3.2</a></td><!-- Honeycomb --><td>13</td><td>1.2%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-3.1.html">Android 3.1</a></td><!-- Honeycomb --><td>12</td><td>1.0%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-3.2.html">Android 3.2</a></td><!-- Honeycomb --><td>13</td><td>2.2%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-4.0.html">Android 4.0 -<br/>
+ Android 4.0.2</a></td>
+ <td rowspan="2">Ice Cream Sandwich</td><td>14</td><td>0.5%</td></tr>
+<tr><td><a href="{@docRoot}sdk/android-4.0.3.html">Android 4.0.3</a></td><!-- ICS --><td>15</td><td>2.4%</td></tr>
</table>
-<p><em>Data collected during a 14-day period ending on December 1, 2011</em></p>
+<p><em>Data collected during a 14-day period ending on April 2, 2012</em></p>
<!--
<p style="font-size:.9em">* <em>Other: 0.1% of devices running obsolete versions</em></p>
-->
@@ -99,14 +103,14 @@ then it is currently compatible with the percentage of devices indicated on the
line for that version meets the y-axis on the right.</p>
<p>Each dataset in the timeline is based on the number of Android devices that accessed
-Android Market within a 14-day period ending on the date indicated on the x-axis.</p>
+Google Play within a 14-day period ending on the date indicated on the x-axis.</p>
<div class="dashboard-panel">
<img alt="" height="250" width="660" style="padding:5px;background:#fff"
-src="http://chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A|06/01|06/15|07/01|07/15|08/01|08/15|09/01|09/15|10/01|10/15|11/01|11/15|12/01|1%3A|2011||||||||||||2011|2%3A|0%25|25%25|50%25|75%25|100%25|3%3A|0%25|25%25|50%25|75%25|100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:99.4,99.3,99.2,99.0,98.8,98.7,98.5,98.5,98.2,98.1,98.0,99.9,99.9|97.5,97.5,97.7,97.6,97.5,97.5,97.5,97.5,97.1,97.1,97.0,99.1,99.1|95.0,95.2,95.5,95.5,95.5,95.6,95.7,95.8,95.6,95.9,95.7,97.7,97.8|73.9,75.4,77.6,79.0,80.2,81.1,82.4,83.3,83.8,84.9,85.1,87.5,88.2|9.5,13.6,17.8,20.6,24.3,27.5,31.2,34.7,38.3,41.3,44.0,48.9,52.9|8.4,12.6,16.8,20.0,23.7,26.9,30.6,34.1,37.8,40.8,43.5,48.4,52.4|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,2.3|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.2&chm=b,c3df9b,0,1,0|b,b8dc82,1,2,0|tAndroid%202.1,608920,2,0,15,,t::-5|b,addb67,2,3,0|tAndroid%202.2,517617,3,0,15,,t::-5|b,a3db4b,3,4,0|b,98dc2e,4,5,0|tAndroid%202.3.3,334d0a,5,1,15,,t::-5|b,8cd41b,5,6,0|b,7ec113,6,7,0|B,6fad0c,7,8,0&chg=7,25&chdl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.1|Android%203.2&chco=add274,a2d15a,97d13e,8bcb28,7dba1e,6ea715,5f920e,507d08" />
+src="http://chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A%7C10/01%7C10/15%7C11/01%7C11/15%7C12/01%7C12/15%7C01/01%7C01/15%7C02/01%7C02/15%7C03/01%7C03/15%7C04/01%7C1%3A%7C2011%7C%7C%7C%7C%7C%7C2012%7C%7C%7C%7C%7C%7C2012%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C3%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:97.7,97.6,97.5,99.4,99.4,99.2,98.9,98.8,99.2,98.9,98.9,99.0,98.8|96.6,96.6,96.5,98.6,98.6,98.5,98.3,98.2,98.6,98.4,98.4,98.6,98.5|95.1,95.4,95.2,97.2,97.3,97.3,97.2,97.2,97.6,97.5,97.6,97.8,97.8|83.3,84.4,84.6,87.0,87.7,88.1,88.7,89.2,89.9,90.3,90.8,91.4,91.8|37.8,40.8,43.5,48.4,52.4,55.2,58.2,60.1,62.0,63.7,65.2,66.8,68.6|0.0,0.0,0.0,2.0,2.3,2.6,3.5,3.6,4.0,4.1,4.3,4.6,5.5|0.0,0.0,0.0,1.0,1.2,1.3,2.0,2.2,2.6,3.0,3.2,3.5,4.5|0.0,0.0,0.0,0.0,0.0,0.0,0.3,0.4,0.7,0.8,1.1,1.3,2.3&chm=b,c3df9b,0,1,0|b,b8dc82,1,2,0|tAndroid%202.1,608920,2,0,15,,t::-5|b,addb67,2,3,0|tAndroid%202.2,517617,3,0,15,,t::-5|b,a3db4b,3,4,0|tAndroid%202.3.3,426210,4,0,15,,t::-5|b,98dc2e,4,5,0|b,8cd41b,5,6,0|b,7ec113,6,7,0|B,6fad0c,7,8,0&chg=7,25&chdl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3.3|Android%203.1|Android%203.2|Android%204.0.3&chco=add274,a2d15a,97d13e,8bcb28,7dba1e,6ea715,5f920e,507d08" />
-<p><em>Last historical dataset collected during a 14-day period ending on December 1, 2011</em></p>
+<p><em>Last historical dataset collected during a 14-day period ending on April 2, 2012</em></p>
</div><!-- end dashboard-panel -->
diff --git a/docs/html/resources/dashboard/screens.jd b/docs/html/resources/dashboard/screens.jd
index 79d59d9..e5c79a1 100644
--- a/docs/html/resources/dashboard/screens.jd
+++ b/docs/html/resources/dashboard/screens.jd
@@ -53,14 +53,14 @@ application, see <a href="{@docRoot}guide/practices/screens_support.html">Suppor
Screens</a>.</p>
<p class="note"><strong>Note:</strong> This data is based on the number
-of Android devices that have accessed Android Market within a 7-day period
+of Android devices that have accessed Google Play within a 7-day period
ending on the data collection date noted below.</p>
<div class="dashboard-panel">
<img alt="" width="400" height="250"
-src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=Xlarge%20/%20mdpi|Large%20/%20ldpi|Large%20/%20mdpi|Normal%20/%20hdpi|Normal%20/%20ldpi|Normal%20/%20mdpi|Small%20/%20hdpi|Small%20/%20ldpi&chd=t%3A3.1,0.1,3.1,71.0,1.0,17.5,2.9,1.3" />
+src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=Xlarge%20/%20mdpi|Large%20/%20ldpi|Large%20/%20mdpi|Normal%20/%20hdpi|Normal%20/%20ldpi|Normal%20/%20mdpi|Normal%20/%20xhdpi|Small%20/%20hdpi|Small%20/%20ldpi&chd=t%3A5.8,0.2,2.3,64.6,0.7,19.6,2.4,2.5,1.9" />
<table>
<tr>
@@ -71,31 +71,31 @@ src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=
<th scope="col">xhdpi</th>
</tr>
<tr><th scope="row">small</th>
-<td>1.3%</td> <!-- small/ldpi -->
+<td>1.9%</td> <!-- small/ldpi -->
<td></td> <!-- small/mdpi -->
-<td>2.9%</td> <!-- small/hdpi -->
+<td>2.5%</td> <!-- small/hdpi -->
<td></td> <!-- small/xhdpi -->
</tr>
<tr><th scope="row">normal</th>
-<td>1.0%</td> <!-- normal/ldpi -->
-<td>17.5%</td> <!-- normal/mdpi -->
-<td>71%</td> <!-- normal/hdpi -->
-<td></td> <!-- normal/xhdpi -->
+<td>0.7%</td> <!-- normal/ldpi -->
+<td>19.6%</td> <!-- normal/mdpi -->
+<td>64.6%</td> <!-- normal/hdpi -->
+<td>2.4%</td> <!-- normal/xhdpi -->
</tr>
<tr><th scope="row">large</th>
-<td>0.1%</td> <!-- large/ldpi -->
-<td>3.1%</td> <!-- large/mdpi -->
+<td>0.2%</td> <!-- large/ldpi -->
+<td>2.3%</td> <!-- large/mdpi -->
<td></td> <!-- large/hdpi -->
<td></td> <!-- large/xhdpi -->
</tr>
<tr><th scope="row">xlarge</th>
<td></td> <!-- xlarge/ldpi -->
-<td>3.1%</td> <!-- xlarge/mdpi -->
+<td>5.8%</td> <!-- xlarge/mdpi -->
<td></td> <!-- xlarge/hdpi -->
<td></td> <!-- xlarge/xhdpi -->
</tr>
</table>
-<p><em>Data collected during a 7-day period ending on December 1, 2011</em></p>
+<p><em>Data collected during a 7-day period ending on April 2, 2012</em></p>
</div>
diff --git a/docs/html/resources/faq/troubleshooting.jd b/docs/html/resources/faq/troubleshooting.jd
index 05a7dda..f19f5ec 100644
--- a/docs/html/resources/faq/troubleshooting.jd
+++ b/docs/html/resources/faq/troubleshooting.jd
@@ -222,8 +222,8 @@ the adb tool. Here's how to do that:</p>
<ol>
<li>In a terminal, change to the tools directory of the SDK.</li>
- <li>If no emulator instance is running, start an emulator using using the command <code>emulator &</code>.</li>
- <li>Uninstall the preinstalled app using the command <code>adb uninstall com.android.samples</code>.</li>
+ <li>If no emulator instance is running, start an emulator using using the command <code>emulator</code>.</li>
+ <li>Uninstall the preinstalled app using the command <code>adb uninstall com.example.android.apis</code>.</li>
<li>Reinstall the app using the command <code>adb install &lt;path to the ApiDemos.apk&gt;</code>. If you are
working in Eclipse/ADT, you can just compile and run the app in the normal way. </li>
</ol>
diff --git a/docs/html/resources/resources-data.js b/docs/html/resources/resources-data.js
index 8ad970b..fb4225d 100644
--- a/docs/html/resources/resources-data.js
+++ b/docs/html/resources/resources-data.js
@@ -263,6 +263,17 @@ var ANDROID_RESOURCES = [
}
},
{
+ tags: ['article', 'input', 'ui'],
+ path: 'articles/spell-checker-framework.html',
+ title: {
+ en: 'The Android Spell Checker Framework'
+ },
+ description: {
+ en: 'This article describes the Android spell checker framework and how to use to implement spell checking in applications.'
+ }
+ },
+
+ {
tags: ['article', 'ui'],
path: 'articles/touch-mode.html',
title: {
@@ -548,6 +559,16 @@ var ANDROID_RESOURCES = [
}
},
{
+ tags: ['sample', 'new'],
+ path: 'samples/KeyChainDemo/index.html',
+ title: {
+ en: 'KeyChain Demo'
+ },
+ description: {
+ en: 'A demo application to demonstrate how to use KeyChain APIs.'
+ }
+ },
+ {
tags: ['sample', 'gamedev', 'media'],
path: 'samples/LunarLander/index.html',
title: {
diff --git a/docs/html/resources/resources_toc.cs b/docs/html/resources/resources_toc.cs
index 8df419f..a21708c 100644
--- a/docs/html/resources/resources_toc.cs
+++ b/docs/html/resources/resources_toc.cs
@@ -1,7 +1,8 @@
<ul>
<li>
- <h2><span class="en">Android Training</span>
- </h2>
+ <span class="heading">
+ <span class="en">Android Training</span>
+ </span>
<ul>
<li><a href="<?cs var:toroot ?>training/index.html">
@@ -96,6 +97,69 @@
</li>
</ul>
</li>
+
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>training/efficient-downloads/index.html">
+ <span class="en">Transferring Data Without Draining the Battery<span
+class="new">&nbsp;new!</span></span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/efficient-network-access.html">
+ <span class="en">Optimizing Downloads for Efficient Network Access</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/regular_updates.html">
+ <span class="en">Minimizing the Effect of Regular Updates</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/redundant_redundant.html">
+ <span class="en">Redundant Downloads are Redundant</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/connectivity_patterns.html">
+ <span class="en">Modifying Patterns Based on the Connectivity Type</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>training/cloudsync/index.html">
+ <span class="en">Syncing to the Cloud<span class="new">&nbsp;new!</span></span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/cloudsync/aesync.html">
+ <span class="en">Syncing with App Engine</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/cloudsync/backupapi.html">
+ <span class="en">Using the Backup API</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>training/search/index.html">
+ <span class="en">Adding Search Functionality<span class="new">&nbsp;new!</span></span>
+ </a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/search/setup.html">
+ <span class="en">Setting up the Search Interface</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/search/search.html">
+ <span class="en">Storing and Searching for Data</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/search/backward-compat.html">
+ <span class="en">Remaining Backward Compatible</span>
+ </a>
+ </li>
+ </ul>
+ </li>
<li class="toggle-list">
<div><a href="<?cs var:toroot ?>training/id-auth/index.html">
@@ -180,7 +244,31 @@
</li>
</ul>
</li>
-
+
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>training/backward-compatible-ui/index.html">
+ <span class="en">Creating Backward-Compatible UIs<span class="new">&nbsp;new!</span></span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/abstracting.html">
+ <span class="en">Abstracting the New APIs</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/new-implementation.html">
+ <span class="en">Proxying to the New APIs</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/older-implementation.html">
+ <span class="en">Creating an Implementation with Older APIs</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/using-component.html">
+ <span class="en">Using the Version-Aware Component</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
<li class="toggle-list">
<div><a href="<?cs var:toroot ?>training/enterprise/index.html">
<span class="en">Developing for Enterprise</span>
@@ -232,13 +320,103 @@
</li>
</ul>
</li>
- </ul>
- </li>
-
+
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>training/implementing-navigation/index.html">
+ <span class="en">Implementing Effective Navigation<span class="new">&nbsp;new!</span></span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/lateral.html">
+ <span class="en">Implementing Lateral Navigation</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/ancestral.html">
+ <span class="en">Implementing Ancestral Navigation</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/temporal.html">
+ <span class="en">Implementing Temporal Navigation</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/descendant.html">
+ <span class="en">Implementing Descendant Navigation</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>training/tv/index.html">
+ <span class="en">Designing for TV<span class="new">&nbsp;new!</span></span>
+ </a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/tv/optimizing-layouts-tv.html">
+ <span class="en">Optimizing Layouts for TV</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/tv/optimizing-navigation-tv.html">
+ <span class="en">Optimizing Navigation for TV</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/tv/unsupported-features-tv.html">
+ <span class="en">Handling Features Not Supported on TV</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>training/displaying-bitmaps/index.html">
+ <span class="en">Displaying Bitmaps Efficiently<span class="new">&nbsp;new!</span></span>
+ </a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/load-bitmap.html">
+ <span class="en">Loading Large Bitmaps Efficiently</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/process-bitmap.html">
+ <span class="en">Processing Bitmaps Off the UI Thread</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/cache-bitmap.html">
+ <span class="en">Caching Bitmaps</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/display-bitmap.html">
+ <span class="en">Displaying Bitmaps in Your UI</span>
+ </li>
+ <ul>
+ </li>
+
+
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>training/accessibility/index.html">
+ <span class="en">Implementing Accessibility<span class="new">&nbsp;new!</span></span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/accessibility/accessible-app.html">
+ <span class="en">Developing Accessible Applications</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/accessibility/service.html">
+ <span class="en">Developing Accessibility Services</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ </ul>
+ </li>
+
+
+
+
<li>
- <h2><span class="en">Technical Resources</span>
- </h2>
+ <span class="heading">
+ <span class="en">Technical Resources</span>
+ </span>
<ul>
<li class="toggle-list">
<div><a href="<?cs var:toroot ?>resources/browser.html?tag=sample">
@@ -288,29 +466,31 @@
</ul>
</li>
<li>
- <h2><span class="en">Community</span>
- <span style="display:none" class="de"></span>
- <span style="display:none" class="es">Comunidad</span>
- <span style="display:none" class="fr">Communauté</span>
- <span style="display:none" class="it"></span>
- <span style="display:none" class="ja">コミュニティ</span>
- <span style="display:none" class="zh-CN">社区</span>
- <span style="display:none" class="zh-TW">社群</span>
- </h2>
+ <span class="heading">
+ <span class="en">Community</span>
+ <span style="display:none" class="de"></span>
+ <span style="display:none" class="es">Comunidad</span>
+ <span style="display:none" class="fr">Communauté</span>
+ <span style="display:none" class="it"></span>
+ <span style="display:none" class="ja">コミュニティ</span>
+ <span style="display:none" class="zh-CN">社区</span>
+ <span style="display:none" class="zh-TW">社群</span>
+ </span>
<ul>
<li><a href="<?cs var:toroot ?>resources/community-groups.html">
<span class="en">Developer Forums</span>
</a></li>
<li><a href="<?cs var:toroot ?>resources/community-more.html">
- <span class="en">IRC, Twitter</span>
+ <span class="en">IRC, G+, Twitter</span>
</a></li>
</ul>
</li>
<?cs
if:android.whichdoc == "online" ?>
<li>
- <h2><span class="en">Device Dashboard</span>
- </h2>
+ <span class="heading">
+ <span class="en">Device Dashboard</span>
+ </span>
<ul>
<li><a href="<?cs var:toroot ?>resources/dashboard/platform-versions.html">
<span class="en">Platform Versions</span>
@@ -327,7 +507,9 @@
?>
<li>
- <h2><span class="en">More</span></h2>
+ <span class="heading">
+ <span class="en">More</span>
+ </span>
<ul>
<li><a href="<?cs var:toroot ?>resources/faq/commontasks.html">
<span class="en">Common Tasks </span>
diff --git a/docs/html/resources/samples/get.jd b/docs/html/resources/samples/get.jd
index 86ec836..751965f 100644
--- a/docs/html/resources/samples/get.jd
+++ b/docs/html/resources/samples/get.jd
@@ -26,15 +26,15 @@ needed!</p>
<p>The SDK sample code is available to you as a set of downloadable SDK
components, each of which contains the samples for a specific Android platform
version. Once you have installed the SDK, you can download one or more samples
-component(s) into your SDK environment using the Android SDK and AVD Manager
+component(s) into your SDK environment using the Android SDK Manager
tool, which is pre-installed in the SDK. </p>
-<p>To download the samples, launch the Android SDK and AVD Manager tool and
+<p>To download the samples, launch the Android SDK Manager tool and
select one of the samples components from the <strong>Available
Packages</strong> panel, for example "Samples for SDK API 7". Select
<strong>Install Selected</strong>, verify and accept the download, then select
<strong>Install Accepted</strong> to download the component into your SDK. If
-you aren't familiar with the Android SDK and AVD Manager and how to launch or
+you aren't familiar with the Android SDK Manager and how to launch or
use it, please read the <a href="{@docRoot}sdk/adding-components.html">Adding
SDK Components</a> document. </p>
@@ -74,7 +74,7 @@ From there you can read a short summary of each sample application and what
types of concepts, features, or APIs it includes. Then, use the links provided
to move through the directories and files of each sample. The browseable source
is generated from the same source code that is downloadable through the Android
-SDK and AVD Manager, as described above. </p>
+SDK Manager, as described above. </p>
<p>The browseable samples files are available online, at the Android Developers
site only and are not included in the downloadable offline documentation.
diff --git a/docs/html/resources/samples/images/KeyChainDemo1.png b/docs/html/resources/samples/images/KeyChainDemo1.png
new file mode 100644
index 0000000..d426c22
--- /dev/null
+++ b/docs/html/resources/samples/images/KeyChainDemo1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/KeyChainDemo2.png b/docs/html/resources/samples/images/KeyChainDemo2.png
new file mode 100755
index 0000000..e181e58
--- /dev/null
+++ b/docs/html/resources/samples/images/KeyChainDemo2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/KeyChainDemo3.png b/docs/html/resources/samples/images/KeyChainDemo3.png
new file mode 100755
index 0000000..acfdd89
--- /dev/null
+++ b/docs/html/resources/samples/images/KeyChainDemo3.png
Binary files differ
diff --git a/docs/html/resources/samples/images/KeyChainDemo4.png b/docs/html/resources/samples/images/KeyChainDemo4.png
new file mode 100755
index 0000000..a9101ab
--- /dev/null
+++ b/docs/html/resources/samples/images/KeyChainDemo4.png
Binary files differ
diff --git a/docs/html/resources/tutorials/hello-world.jd b/docs/html/resources/tutorials/hello-world.jd
index 9afab6a..70ba06c 100644
--- a/docs/html/resources/tutorials/hello-world.jd
+++ b/docs/html/resources/tutorials/hello-world.jd
@@ -24,7 +24,7 @@ Eclipse as your IDE, because we've provided a great plugin that handles your pro
management to greatly speed up your development cycles.</p>
<p>This tutorial assumes that you're using Eclipse. If you're using the command line, see
-<a href="{@docRoot}/guide/developing/building/building-cmdline.html">Building and Running from the
+<a href="{@docRoot}guide/developing/building/building-cmdline.html">Building and Running from the
Command Line</a>. You can then return to this tutorial and ignore anything about Eclipse.</p>
<p>Before you start, you should already have the SDK installed, and if you're
@@ -42,7 +42,7 @@ you need to do it now.</p>
<ol>
- <li>In the Android SDK and AVD Manager, choose <strong>Available
+ <li>In the Android SDK Manager, choose <strong>Available
Packages</strong> in the left panel.</li>
<li>In the right panel, expand the Android Repository list to display
@@ -72,7 +72,7 @@ device settings used by the emulator.</p>
<p>To create an AVD:</p>
<ol>
- <li>In Eclipse, select <strong>Window &gt; Android SDK and AVD Manager</strong>.</li>
+ <li>In Eclipse, select <strong>Window &gt; AVD Manager</strong>.</li>
<li>Select <strong>Virtual Devices</strong> in the left panel.</li>
<li>Click <strong>New...</strong>.
diff --git a/docs/html/resources/tutorials/notepad/notepad-ex2.jd b/docs/html/resources/tutorials/notepad/notepad-ex2.jd
index 7e3288f..1334d7a 100644
--- a/docs/html/resources/tutorials/notepad/notepad-ex2.jd
+++ b/docs/html/resources/tutorials/notepad/notepad-ex2.jd
@@ -87,8 +87,7 @@ Open the Notepadv2 class.</p>
menu callback used for the options menu. Here, we add just one line, which will add a menu item
to delete a note. Call <code>menu.add()</code> like so:
<pre>
-public void onCreateContextMenu(Menu menu, View v,
- ContextMenu.ContextMenuInfo menuInfo) {
+public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.add(0, DELETE_ID, 0, R.string.menu_delete);
}</pre>
diff --git a/docs/html/resources/tutorials/opengl/opengl-es10.jd b/docs/html/resources/tutorials/opengl/opengl-es10.jd
index 3570766..2b44620 100644
--- a/docs/html/resources/tutorials/opengl/opengl-es10.jd
+++ b/docs/html/resources/tutorials/opengl/opengl-es10.jd
@@ -58,7 +58,7 @@ carefully consider which version of the OpenGL ES API (1.0/1.1 or 2.0) is most a
needs. For more information, see
<a href="{@docRoot}guide/topics/graphics/opengl.html#choosing-version">Choosing an OpenGL API
Version</a>. If you would prefer to use OpenGL ES 2.0, see the <a
-href="{@docRoot}resources/tutorials/opengl/opengl-es20.jd">OpenGL ES 2.0 tutorial</a>.</p>
+href="{@docRoot}resources/tutorials/opengl/opengl-es20.html">OpenGL ES 2.0 tutorial</a>.</p>
<p>Before you start, you should understand how to create a basic Android application. If you do not
know how to create an app, follow the <a href="{@docRoot}resources/tutorials/hello-world.html">Hello
diff --git a/docs/html/resources/tutorials/opengl/opengl-es20.jd b/docs/html/resources/tutorials/opengl/opengl-es20.jd
index 889dd50..dd23dbf 100644
--- a/docs/html/resources/tutorials/opengl/opengl-es20.jd
+++ b/docs/html/resources/tutorials/opengl/opengl-es20.jd
@@ -57,7 +57,7 @@ carefully consider which version of the OpenGL ES API (1.0/1.1 or 2.0) is most a
needs. For more information, see
<a href="{@docRoot}guide/topics/graphics/opengl.html#choosing-version">Choosing an OpenGL API
Version</a>. If you would prefer to use OpenGL ES 1.0, see the <a
-href="{@docRoot}resources/tutorials/opengl/opengl-es10.jd">OpenGL ES 1.0 tutorial</a>.</p>
+href="{@docRoot}resources/tutorials/opengl/opengl-es10.html">OpenGL ES 1.0 tutorial</a>.</p>
<p>Before you start, you should understand how to create a basic Android application. If you do not
know how to create an app, follow the <a href="{@docRoot}resources/tutorials/hello-world.html">Hello
diff --git a/docs/html/resources/tutorials/testing/activity_test.jd b/docs/html/resources/tutorials/testing/activity_test.jd
index 4b861e2..f88b768 100644
--- a/docs/html/resources/tutorials/testing/activity_test.jd
+++ b/docs/html/resources/tutorials/testing/activity_test.jd
@@ -163,7 +163,7 @@ parent.link=../../browser.html?tag=tutorial
open the Android SDK and AVD Manager and check in the
<strong>Installed Packages</strong> panel.
If aren't sure how to download a platform into your SDK,
- read <a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.
+ read <a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a>.
</p>
</li>
</ul>
diff --git a/docs/html/resources/tutorials/views/hello-formstuff.jd b/docs/html/resources/tutorials/views/hello-formstuff.jd
index b9f6c16..1ddd1df 100644
--- a/docs/html/resources/tutorials/views/hello-formstuff.jd
+++ b/docs/html/resources/tutorials/views/hello-formstuff.jd
@@ -91,31 +91,30 @@ android.widget.Button} element:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
- android:background="@drawable/android_button" />
+ android:background="@drawable/android_button"
+ android:onClick="onButtonClicked"/>
</pre>
<p>The <code>android:background</code> attribute specifies the drawable resource to use for the
button background (which, when saved at <code>res/drawable/android.xml</code>, is
referenced as <code>@drawable/android</code>). This replaces the normal background image
-used for buttons throughout the system. In order for the drawable to change its image based on
-the button state, the image must be applied to the background.</p>
+applied by the system with the drawable created above, which changes its image based on
+the button state.</p>
+ <p>The attribute <code>android:onClick</code> specifies the name of a method in your activity
+that the system should call when the user clicks the button. You'll create that method next.</p>
</li>
<li>To make the button do something when pressed, add the following
-code at the end of the {@link android.app.Activity#onCreate(Bundle) onCreate()} method:
+method inside your {@link android.app.Activity} class:
<pre>
-final Button button = (Button) findViewById(R.id.button);
-button.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- // Perform action on clicks
- Toast.makeText(HelloFormStuff.this, "Beep Bop", Toast.LENGTH_SHORT).show();
- }
-});
+public void onButtonClicked(View v) {
+ // Do something when the button is clicked
+ Toast.makeText(HelloFormStuff.this, "Button clicked", Toast.LENGTH_SHORT).show();
+}
</pre>
-<p>This captures the {@link android.widget.Button} from the layout, then adds an {@link
-android.view.View.OnClickListener}. The {@link android.view.View.OnClickListener}
-must implement the {@link android.view.View.OnClickListener#onClick(View)} callback method, which
-defines the action to be made when the button is clicked. In this example, a
-{@link android.widget.Toast} message will be displayed.</p>
+<p>When you specify this kind of method, which is used in your layout file with the {@code
+android:onClick} attribute, the method must be <code>public</code>, have a <code>void</code> return
+value, and accept a single {@code android.view.View} parameter. When the system calls this method,
+it passes the {@code android.view.View} that was clicked.</p>
</li>
<li>Now run the application.</li>
</ol>
@@ -183,34 +182,33 @@ element (inside the {@link android.widget.LinearLayout}):
&lt;CheckBox android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="check it out" />
+ android:text="check it out"
+ android:onClick="onCheckboxClicked"/>
</pre>
+ <p>The attribute <code>android:onClick</code> specifies the name of a method in your activity
+that the system should call when the user clicks the check box. You'll create that method next.</p>
</li>
-<li>To do something when the state is changed, add the following code
-to the end of the {@link android.app.Activity#onCreate(Bundle) onCreate()} method:
+<li>To do something when the state is changed, add the following method inside your {@link
+android.app.Activity} class:</p>
+
<pre>
-final CheckBox checkbox = (CheckBox) findViewById(R.id.checkbox);
-checkbox.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- // Perform action on clicks, depending on whether it's now checked
- if (((CheckBox) v).isChecked()) {
- Toast.makeText(HelloFormStuff.this, "Selected", Toast.LENGTH_SHORT).show();
- } else {
- Toast.makeText(HelloFormStuff.this, "Not selected", Toast.LENGTH_SHORT).show();
- }
+public void onCheckboxClicked(View v) {
+ // Perform action on clicks, depending on whether it's now checked
+ if (((CheckBox) v).isChecked()) {
+ Toast.makeText(HelloFormStuff.this, "Selected", Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(HelloFormStuff.this, "Not selected", Toast.LENGTH_SHORT).show();
}
-});
+}
</pre>
-<p>This captures the {@link android.widget.CheckBox} element from the layout, then adds an {@link
-android.view.View.OnClickListener}. The {@link android.view.View.OnClickListener} must implement the
-{@link android.view.View.OnClickListener#onClick(View)} callback method, which
-defines the action to be made when the checkbox is clicked. When clicked, {@link
-android.widget.CompoundButton#isChecked()} is called to check the new state of the check box. If it
-has been checked, then a {@link android.widget.Toast} displays the message "Selected", otherwise it
-displays "Not selected". Note that the {@link android.view.View} object that is passed in the {@link
-android.view.View.OnClickListener#onClick(View)} callback must be cast to a {@link
-android.widget.CheckBox} because the {@link android.widget.CompoundButton#isChecked()} method is
-not defined by the parent {@link android.view.View} class. The {@link android.widget.CheckBox}
+
+<p>When you specify this kind of method, which is used in your layout file with the {@code
+android:onClick}
+attribute, the method must be <code>public</code>, have a <code>void</code> return value, and
+accept a single {@code android.view.View} parameter. When the system calls this method, it
+passes the {@code android.view.View} that was clicked. In this example, the {@code
+android.view.View} is cast to a {@link android.widget.CheckBox} to determine whether the widget
+has been checked or unchecked. The {@link android.widget.CheckBox} widget
handles its own state changes, so you only need to query the current state.</p>
</li>
<li>Run it.</li>
@@ -240,44 +238,44 @@ android.widget.LinearLayout}):
&lt;RadioButton android:id="@+id/radio_red"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Red" />
+ android:text="Red"
+ android:onClick="onRadioButtonClicked"/>
&lt;RadioButton android:id="@+id/radio_blue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Blue" />
+ android:text="Blue"
+ android:onClick="onRadioButtonClicked"/>
&lt;/RadioGroup>
</pre>
<p>It's important that the {@link android.widget.RadioButton}s are grouped together by the {@link
android.widget.RadioGroup} element so that no more than one can be selected at a time. This logic
is automatically handled by the Android system. When one {@link android.widget.RadioButton} within
a group is selected, all others are automatically deselected.</p>
+ <p>The attribute <code>android:onClick</code> specifies the name of a method in your activity
+that the system should call when the user clicks the radio button. You'll create that method
+next.</p>
</li>
-<li>To do something when each {@link android.widget.RadioButton} is selected, you need an
-{@link android.view.View.OnClickListener}. In this case, you want the listener to be re-usable, so
-add the following code to create a new member in the <code>HelloFormStuff</code> Activity:
-<pre>
-private OnClickListener radio_listener = new OnClickListener() {
- public void onClick(View v) {
- // Perform action on clicks
- RadioButton rb = (RadioButton) v;
- Toast.makeText(HelloFormStuff.this, rb.getText(), Toast.LENGTH_SHORT).show();
- }
-};
-</pre>
-<p>First, the {@link android.view.View} that is passed to the {@link
-android.view.View.OnClickListener#onClick(View)} method is cast into a RadioButton. Then a
-{@link android.widget.Toast} message displays the selected radio button's text.</p>
-<li>Now, at the bottom of the {@link android.app.Activity#onCreate(Bundle) onCreate()} method, add
-the following:
+<li>To do something when each {@link android.widget.RadioButton} is selected, add the following
+method inside your {@link android.app.Activity} class:</p>
+
<pre>
- final RadioButton radio_red = (RadioButton) findViewById(R.id.radio_red);
- final RadioButton radio_blue = (RadioButton) findViewById(R.id.radio_blue);
- radio_red.setOnClickListener(radio_listener);
- radio_blue.setOnClickListener(radio_listener);
+public void onRadioButtonClicked(View v) {
+ // Perform action on clicks
+ RadioButton rb = (RadioButton) v;
+ Toast.makeText(HelloFormStuff.this, rb.getText(), Toast.LENGTH_SHORT).show();
+}
</pre>
-<p>This captures each of the {@link android.widget.RadioButton}s from the layout and adds the
-newly-created {@link android.view.View.OnClickListener} to each.</p>
+
+<p>When you specify this kind of method, which is used in your layout file with the {@code
+android:onClick}
+attribute, the method must be <code>public</code>, have a <code>void</code> return value, and
+accept a single {@code android.view.View} parameter. When the system calls this method, it
+passes the {@code android.view.View} that was clicked.</p>
+<p>Because each {@link android.widget.RadioButton} widget is grouped into a {@link
+android.widget.RadioGroup}, each widget handles its own state changes when a new button is
+selected.</p>
+</li>
<li>Run the application.</li>
</ol>
@@ -303,31 +301,35 @@ element (inside the {@link android.widget.LinearLayout}):
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOn="Vibrate on"
- android:textOff="Vibrate off"/>
+ android:textOff="Vibrate off"
+ android:onClick="onToggleClicked"/>
</pre>
<p>The attributes <code>android:textOn</code> and <code>android:textOff</code> specify the text
for the button when the button has been toggled on or off. The default values are "ON" and
"OFF".</p>
+ <p>The attribute <code>android:onClick</code> specifies the name of a method in your activity
+that the system should call when the user clicks the button. You'll create that method next.</p>
</li>
-<li>To do something when the state is changed, add the following code
-to the end of the {@link android.app.Activity#onCreate(Bundle) onCreate()} method:
+<li>To do something when the user clicks the button, add the following
+method inside your {@link android.app.Activity} class:</p>
+
<pre>
-final ToggleButton togglebutton = (ToggleButton) findViewById(R.id.togglebutton);
-togglebutton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- // Perform action on clicks
- if (togglebutton.isChecked()) {
- Toast.makeText(HelloFormStuff.this, "Checked", Toast.LENGTH_SHORT).show();
- } else {
- Toast.makeText(HelloFormStuff.this, "Not checked", Toast.LENGTH_SHORT).show();
- }
+public void onToggleClicked(View v) {
+ // Perform action on clicks
+ if (((ToggleButton) v).isChecked()) {
+ Toast.makeText(HelloFormStuff.this, "Toggle on", Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(HelloFormStuff.this, "Toggle off", Toast.LENGTH_SHORT).show();
}
-});
+}
</pre>
-<p>This captures the {@link android.widget.ToggleButton} element from the layout, then adds an
-{@link android.view.View.OnClickListener}. The {@link android.view.View.OnClickListener} must
-implement the {@link android.view.View.OnClickListener#onClick(View)} callback method, which
-defines the action to perform when the button is clicked. In this example, the callback
+
+<p>When you specify this kind of method, which is used in your layout file with the {@code
+android:onClick}
+attribute, the method must be <code>public</code>, have a <code>void</code> return value, and
+accept a single {@code android.view.View} parameter. When the system calls this method, it
+passes the {@code android.view.View} that was clicked.</p>
+<p>In this example, the callback
method checks the new state of the button, then shows a {@link android.widget.Toast} message that
indicates the current state.</p>
diff --git a/docs/html/resources/tutorials/views/hello-mapview.jd b/docs/html/resources/tutorials/views/hello-mapview.jd
index 836d22c..7a0bedf 100644
--- a/docs/html/resources/tutorials/views/hello-mapview.jd
+++ b/docs/html/resources/tutorials/views/hello-mapview.jd
@@ -208,7 +208,7 @@ public int size() {
new class constructor:
<pre>
public HelloItemizedOverlay(Drawable defaultMarker, Context context) {
- super(defaultMarker);
+ super(boundCenterBottom(defaultMarker));
mContext = context;
}
</pre>
@@ -255,7 +255,7 @@ to define its coordinates on the map.</p>
<pre>
List&lt;Overlay> mapOverlays = mapView.getOverlays();
Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);
-HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable);</pre>
+HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable, this);</pre>
<p>All overlay elements on a map are held by the {@code MapView}, so when you want to add some,
you have to get a list from the <code>getOverlays()</code> method. Then instantiate the {@link
diff --git a/docs/html/resources/tutorials/views/hello-webview.jd b/docs/html/resources/tutorials/views/hello-webview.jd
index 2d07647..f6a6a71 100644
--- a/docs/html/resources/tutorials/views/hello-webview.jd
+++ b/docs/html/resources/tutorials/views/hello-webview.jd
@@ -52,7 +52,7 @@ public void onCreate(Bundle savedInstanceState) {
<li>While you're in the manifest, give some more space for web pages by removing the title
bar, with the "NoTitleBar" theme:
<pre>
-&lt;activity android:name=".HelloGoogleMaps" android:label="@string/app_name"
+&lt;activity android:name=".HelloWebView" android:label="@string/app_name"
<strong>android:theme="@android:style/Theme.NoTitleBar"</strong>&gt;
</pre>
</li>