summaryrefslogtreecommitdiffstats
path: root/docs/html/wear
diff options
context:
space:
mode:
authorRobert Ly <robertly@google.com>2014-06-15 22:00:13 -0700
committerRobert Ly <robertly@google.com>2014-06-24 16:49:48 -0700
commit2728c2a93abd74ef19e550f3530ee70ea41424b3 (patch)
tree6ac225c907bea486cef5849af46508461b32018c /docs/html/wear
parent5f036fb80bac5da7578cefaecdb62457e0067368 (diff)
downloadframeworks_base-2728c2a93abd74ef19e550f3530ee70ea41424b3.zip
frameworks_base-2728c2a93abd74ef19e550f3530ee70ea41424b3.tar.gz
frameworks_base-2728c2a93abd74ef19e550f3530ee70ea41424b3.tar.bz2
docs: wear training classes
Change-Id: I542b3bc87d3a24bf89ea9b7d8edeec224780f31b
Diffstat (limited to 'docs/html/wear')
-rw-r--r--docs/html/wear/notifications/creating.jd305
-rw-r--r--docs/html/wear/notifications/pages.jd65
-rw-r--r--docs/html/wear/notifications/remote-input.jd241
-rw-r--r--docs/html/wear/notifications/stacks.jd138
4 files changed, 0 insertions, 749 deletions
diff --git a/docs/html/wear/notifications/creating.jd b/docs/html/wear/notifications/creating.jd
deleted file mode 100644
index a5d7da7..0000000
--- a/docs/html/wear/notifications/creating.jd
+++ /dev/null
@@ -1,305 +0,0 @@
-page.title=Creating Notifications for Android Wear
-
-@jd:body
-
-
-<p>When an Android device such as a phone or tablet is connected to an Android wearable,
-all notifications are shared between the devices by default. On the Android wearable, each
-notification appears as a new card in the <a href="{@docRoot}wear/design/user-interface.html#Stream"
->context stream</a>.</p>
-
-<img src="{@docRoot}wear/images/notification_phone@2x.png" width="700" height="265" />
-
-
-<p>So without any effort, your app notifications are available to users on Android Wear.
-However, you can enhance the user experience in several ways. For instance,
-if users may respond to a notification by entering text, such as to reply to
-a message, you can add the ability for users to reply by voice directly from the
-wearable.</p>
-
-<p>To help you provide the best user experience
-for your notifications on Android Wear, this guide shows you how to
-build notifications using standard templates in
-the {@link android.support.v4.app.NotificationCompat.Builder} APIs, plus how to begin
-extending your notification's capabilities for the wearable user experience.</p>
-
-<p class="note"><strong>Note:</strong>
-Notifications using {@link android.widget.RemoteViews} are stripped of custom
-layouts and the system uses only the text and icons in the
-{@link android.app.Notification} object to
-display the notification in a card. However, custom card layouts will be supported by
-the official Android Wear SDK that is coming later.</p>
-</div>
-
-
-
-
-<h2 id="Import">Import the Necessary Classes</h2>
-
-<p>To begin development, you must first complete the instructions in the <a
-href="{@docRoot}wear/preview/start.html">Get Started with the Developer Preview</a> document.
-As mentioned in that document, your app must include
-both the <a href="http://developer.android.com/tools/support-library/features.html#v4">v4 support
-library</a> and the Developer Preview support library. So to get started,
-you should include the following imports in your project code:</p>
-
-<pre>
-import android.support.wearable.notifications.*;
-import android.support.wearable.app.NotificationManagerCompat;
-import android.support.v4.app.NotificationCompat;
-</pre>
-
-<p class="caution"><strong>Caution:</strong>
-The APIs in the current Android Wear Developer Preview are intended for <b>development and testing purposes only</b>, not for production apps. Google may change this Developer Preview significantly prior to the official release of the Android Wear SDK. You may not publicly distribute or ship any application using this Developer Preview, as this Developer Preview will no longer be supported after the official SDK is released (which will cause applications based only on the Developer Preview to break).</p>
-
-
-
-<h2 id="NotificationBuilder">Create Notifications with the Notification Builder</h2>
-
-<p>The <a href="http://developer.android.com/tools/support-library/features.html#v4">v4
-support library</a> allows you to create notifications using the latest notification features
-such as action buttons and large icons, while remaining compatible with Android 1.6 (API level
-4) and higher.</p>
-
-
-<p>For example, here's some code that creates and issues a notification using the
-{@link android.support.v4.app.NotificationCompat} APIs combined with the new
-<a href="{@docRoot}reference/android/support/wearable/app/NotificationManagerCompat.html">
-<code>NotificationManagerCompat</code></a> API:</p>
-
-
-<pre>
-int notificationId = 001;
-// Build intent for notification content
-Intent viewIntent = new Intent(this, ViewEventActivity.class);
-viewIntent.putExtra(EXTRA_EVENT_ID, eventId);
-PendingIntent viewPendingIntent =
- PendingIntent.getActivity(this, 0, viewIntent, 0);
-
-NotificationCompat.Builder notificationBuilder =
- new NotificationCompat.Builder(this)
- .setSmallIcon(R.drawable.ic_event)
- .setContentTitle(eventTitle)
- .setContentText(eventLocation)
- .setContentIntent(viewPendingIntent);
-
-// Get an instance of the NotificationManager service
-NotificationManagerCompat notificationManager =
- NotificationManagerCompat.from(this);
-
-// Build the notification and issues it with notification manager.
-notificationManager.notify(notificationId, notificationBuilder.build());
-</pre>
-
-<p>When this notification appears on a handheld device, the user can invoke the
-{@link android.app.PendingIntent}
-specified by the {@link android.support.v4.app.NotificationCompat.Builder#setContentIntent
-setContentIntent()} method by touching the notification. When this
-notification appears on an Android wearable, the user can swipe the notification to the left to
-reveal the <strong>Open</strong> action, which invokes the intent on the handheld device.</p>
-
-
-
-
-
-
-<img src="{@docRoot}wear/images/circle_email_action.png" height="200" style="float:right;clear:right;margin:0 0 20px 60px" />
-
-<h2 id="ActionButtons">Add Action Buttons</h2>
-
-<p>In addition to the primary content action defined by
-{@link android.support.v4.app.NotificationCompat.Builder#setContentIntent
-setContentIntent()}, you can add other actions by passing a {@link android.app.PendingIntent} to
-the {@link android.support.v4.app.NotificationCompat.Builder#addAction
-addAction()} method.</p>
-
-<p>For example, the following code shows the same type of notification from above, but adds an
-action to view the event location on a map.</p>
-
-<pre style="clear:right">
-// Build an intent for an action to view a map
-Intent mapIntent = new Intent(Intent.ACTION_VIEW);
-Uri geoUri = Uri.parse("geo:0,0?q=" + Uri.encode(location));
-mapIntent.setData(geoUri);
-PendingIntent mapPendingIntent =
- PendingIntent.getActivity(this, 0, mapIntent, 0);
-
-NotificationCompat.Builder notificationBuilder =
- new NotificationCompat.Builder(this)
- .setSmallIcon(R.drawable.ic_event)
- .setContentTitle(eventTitle)
- .setContentText(eventLocation)
- .setContentIntent(viewPendingIntent)
- <b>.addAction(R.drawable.ic_map,
- getString(R.string.map), mapPendingIntent);</b>
-</pre>
-
-<p>On a handheld device, the action appears as an
-additional button attached to the notification. On an Android wearable, the action appears as
-a large button when the user swipes the notification to the left. When the user taps the action,
-the associated {@link android.content.Intent} is invoked on the handheld device.</p>
-
-<p class="note"><strong>Tip:</strong> If your notifications includes a "Reply" action
- (such as for a messaging app), you can enhance the behavior by enabling
- voice input replies directly from the Android wearable. For more information, read
- <a href="{@docRoot}wear/notifications/remote-input.html">Receiving Voice Input from a Notification</a>.
-</p>
-
-<p>For details about designing action buttons (including the icon specifications), see the
-<a href="{@docRoot}wear/design/index.html#NotifictionActions">Design Principles of Android
-Wear</a>.</p>
-
-
-<h2 id="BigView">Add a Big View</h2>
-
-<img src="{@docRoot}wear/images/06_images.png" height="200" style="float:right;margin:0 0 20px 40px" />
-
-<p>You can insert extended text content
-to your notification by adding one of the "big view" styles to your notification. On a
-handheld device, users can see the big view content by expanding the notification,
-while on Android Wear, the big view content is visible by default.</p>
-
-<p>To add the extended content to your notification, call {@link
-android.support.v4.app.NotificationCompat.Builder#setStyle setStyle()} on the {@link
-android.support.v4.app.NotificationCompat.Builder} object, passing it an instance of either
-{@link android.support.v4.app.NotificationCompat.BigTextStyle BigTextStyle} or
-{@link android.support.v4.app.NotificationCompat.InboxStyle InboxStyle}.</p>
-
-<p>For example, the following code adds an instance of
-{@link android.support.v4.app.NotificationCompat.BigTextStyle} to the event notification,
-in order to include the complete event description (which includes more text than can fit
-into the space provided for {@link android.support.v4.app.NotificationCompat.Builder#setContentText
-setContentText()}).</p>
-
-
-<pre style="clear:right">
-// Specify the 'big view' content to display the long
-// event description that may not fit the normal content text.
-BigTextStyle bigStyle = new NotificationCompat.BigTextStyle();
-bigStyle.bigText(eventDescription);
-
-NotificationCompat.Builder notificationBuilder =
- new NotificationCompat.Builder(this)
- .setSmallIcon(R.drawable.ic_event)
- .setLargeIcon(BitmapFractory.decodeResource(
- getResources(), R.drawable.notif_background))
- .setContentTitle(eventTitle)
- .setContentText(eventLocation)
- .setContentIntent(viewPendingIntent)
- .addAction(R.drawable.ic_map,
- getString(R.string.map), mapPendingIntent)
- <b>.setStyle(bigStyle);</b>
-</pre>
-
-<p>Notice that you can add a large background image to any notification using the
-{@link android.support.v4.app.NotificationCompat.Builder#setLargeIcon setLargeIcon()}
-method. For more information about designing notifications with large images, see the
-<a href="{@docRoot}wear/design/index.html#Images">Design Principles of Android
-Wear</a>.</p>
-
-
-
-<h2 id="NewFeatures">Add New Features for Wearables</h2>
-
-<p>The Android Wear preview support library provides new APIs that
- allow you to enhance the user experience for notifications on a wearable device. For example,
- you can add additional pages of content that users can view by swiping to the left, or add the ability
-for users to deliver your app a text response using voice input.</p>
-
-<p>To use these new APIs:</p>
-
-<ol>
- <li>Create an instance of
-{@link android.support.v4.app.NotificationCompat.Builder}, setting the
-desired properties for your notification.</li>
- <li>Create a
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#WearableNotificationOptions.Builder(android.content.Context)"> <code>WearableNotificationOptions.Builder</code></a>, setting the wearable-specific options for the notication.</li>
- <li>Call <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#WearableNotificationOptions.Builder#applyTo"><code>WearableNotificationOptions.Builder.applyTo()</code>
- </a>, passing in the {@link android.support.v4.app.NotificationCompat.Builder}. This applies
- the wearable options to the notification.</li>
-</ol>
-
-<p>
-For example, the following code calls the
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setHintHideIcon(boolean)">
- <code>setHintHideIcon()</code></a> method to remove the app icon from the notification card.
-</p>
-
-<pre>
-// Create a NotificationCompat.Builder for standard notification features
- NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext)
- .setContentTitle("New mail from " + sender)
- .setContentText(subject)
- .setSmallIcon(R.drawable.new_mail);
-// Create a WearablesNotificationOptions.Builder to add functionality for wearables
- Notification notif = new WearableNotificationOptions.Builder()
- <b>.setHintHideIcon(true)</b>
- .build()
- .applyTo(builder); //apply wearable options to to the original notification
- .build()
-</pre>
-
-<p>The
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setHintHideIcon(boolean)">
- <code>setHintHideIcon()</code></a> method is just one example of new notification features available with the
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html"
- ><code>WearableNotificationOptions.Builder</code></a> class.
-</p>
-
-
-<p>When you want to deliver your notifications, always use the
- <a href="{@docRoot}reference/android/support/wearable/app/NotificationManagerCompat.html">
- <code>NotificationManagerCompat</code></a> API instead of
- {@link android.app.NotificationManager}:</p>
-
-<pre>
-// Get an instance of the NotificationManager service
-NotificationManagerCompat notificationManager =
- NotificationManagerCompat.from(this);
-
-// Issue the notification with notification manager.
-notificationManager.notify(notificationId, notif);
-</pre>
-
-
-<p>If you use the framework's {@link android.app.NotificationManager}, some
-features from <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html"><code>WearableNotificationOptions.Builder</code></a>
-do not work.</p>
-
-
-<p>To continue enhancing your notifications for wearables using
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html"
- ><code>WearableNotificationOptions.Builder</code></a> and other APIs in the
- preview support library, see the following developer guides:</p>
-
- <dl>
- <dt><a href="{@docRoot}wear/notifications/remote-input.html">Receiving Voice Input
-from a Notification</a></dt>
- <dd>Add an action that receives voice input from the user and delivers the
-transcribed message to your app.</dd>
- <dt><a href="{@docRoot}wear/notifications/pages.html">Adding Pages to a Notification</a></dt>
- <dd>Add additional pages of information that are visible when the user
-swipes to the left.</dd>
- <dt><a href="{@docRoot}wear/notifications/stacks.html">Stacking Notifications</a></dt>
- <dd>Place all similar notifications from your app in a stack, allowing each to be
-viewed individually without adding multiple cards to the card stream.</dd>
- </dl>
-
-
-<div class="next-docs">
-
-<div class="col-12">
- <h2 class="norule">You might also want to read:</h2>
- <dl>
- <dt><a href="{@docRoot}training/notify-user/index.html">Notifying the User</a></dt>
- <dd>Learn more about how to create notifications.</dd>
- <dt><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a></dt>
- <dd>Learn everything you need to know about the {@link android.content.Intent}
-APIs, used by notificaton actions.</dd>
- </dl>
-</div>
-</div>
-
-
-</body>
-</html>
diff --git a/docs/html/wear/notifications/pages.jd b/docs/html/wear/notifications/pages.jd
deleted file mode 100644
index 7d18b3f..0000000
--- a/docs/html/wear/notifications/pages.jd
+++ /dev/null
@@ -1,65 +0,0 @@
-page.title=Adding Pages to a Notification
-
-@jd:body
-
-
-<img src="{@docRoot}wear/images/09_pages.png" height="200" style="float:right;margin:0 0 20px 40px" />
-<img src="{@docRoot}wear/images/08_pages.png" height="200" style="float:right;margin:0 0 20px 40px" />
-
-<p>When you'd like to provide more information without requiring users
-to open your app on their handheld device, you can
-add one or more pages to the notification on Android Wear. The additional pages
-appear immediately to the right of the main notification card.
-For information about when to use and how to design
-multiple pages, see the
-<a href="{@docRoot}wear/design/index.html#NotificationPages">Design Principles of Android
-Wear</a>.</p>
-
-<p>To create a notification with multiple pages:</p>
-<ol>
- <li>Create the main notification (the first page) the way you'd like the notification to appear on a phone
- or tablet.</li>
- <li>Add pages one at a time with the
-<a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#addPage(android.app.Notification)">
-<code>addPage()</code></a> method, or add multiple pages in a {@link java.util.Collection} with the
-<a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#addPages(java.util.Collection<android.app.Notification>)">
-<code>addPages()</code></a> method.</li>
- <li>Apply the pages to the main notification with the
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.html#applyTo(android.support.v4.app.NotificationCompat.Builder)"
- ><code>applyTo()</code></a> method.</li>
-</ol>
-
-
-<p>For example, here's some code that adds a second page to a notification:</p>
-
-<pre>
-// Create builder for the main notification
-NotificationCompat.Builder notificationBuilder =
- new NotificationCompat.Builder(this)
- .setSmallIcon(R.drawable.new_message)
- .setContentTitle("Page 1")
- .setContentText("Short message")
- .setContentIntent(viewPendingIntent);
-
-// Create a big text style for the second page
-BigTextStyle secondPageStyle = new NotificationCompat.BigTextStyle();
-secondPageStyle.setBigContentTitle("Page 2")
- .bigText("A lot of text...");
-
-// Create second page notification
-Notification secondPageNotification =
- new NotificationCompat.Builder(this)
- .setStyle(secondPageStyle)
- .build();
-
-// Add second page with wearable options and apply to main notification
-Notification twoPageNotification =
- new WearableNotificationsOptions.Builder()
- .addPage(secondPageNotification)
- .build()
- .applyTo(notificationBuilder)
- .build();
-</pre>
-
-</body>
-</html>
diff --git a/docs/html/wear/notifications/remote-input.jd b/docs/html/wear/notifications/remote-input.jd
deleted file mode 100644
index 4db8274..0000000
--- a/docs/html/wear/notifications/remote-input.jd
+++ /dev/null
@@ -1,241 +0,0 @@
-page.title=Receiving Voice Input from a Notification
-
-@jd:body
-
-<img src="{@docRoot}wear/images/13_voicereply.png" height="200" width="169" style="float:right;margin:0 0 20px 40px" />
-
-<img src="{@docRoot}wear/images/03_actions.png" height="200" width="169" style="float:right;margin:0 0 20px 40px" />
-
-<p>If your notification includes an action to respond with text,
- such as to reply to an email, it should normally launch an activity
- on the handheld device. However, when your notification appears on an Android wearable, you can
- allow users to dictate a reply with voice input. You can also provide pre-defined text
- messages for the user to select.</p>
-
-<p>When the user replies with voice or selects one of the available
-messages, the system sends the message to your app on the connected handheld device.
-The message is attached as an extra in the {@link android.content.Intent} you specified
-to be used for the notification action.</p>
-
-<p class="note"><strong>Note:</strong> When developing with the Android emulator,
-you must type text replies into the voice input field, so be sure you have enabled
-<strong>Hardware keyboard present</strong> in the AVD settings.</p>
-
-
-<h2 id="RemoteInput">Define the Remote Input</h2>
-
-<p>To create an action that supports voice input, first create an instance of
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html">
-<code>RemoteInput</code></a> using the
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.Builder.html"><code>RemoteInput.Builder</code></a> APIs.
- The
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.Builder.html"><code>RemoteInput.Builder</code></a> constructor takes a string that the system
- will use as a key for the {@link android.content.Intent} extra that carries the reply message
- to your app on the handheld.</p>
-
-<p>For example, here's how to create a new
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html">
-<code>RemoteInput</code></a> object that provides a custom
- label for the voice input prompt:</p>
-
-<pre class="prettyprint">
-// Key for the string that's delivered in the action's intent
-private static final String EXTRA_VOICE_REPLY = "extra_voice_reply";
-
-String replyLabel = getResources().getString(R.string.reply_label);
-
-RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
- .setLabel(replyLabel)
- .build();
-</pre>
-
-
-<h3>Add Pre-defined Text Responses</h3>
-
-<img src="{@docRoot}wear/images/12_voicereply.png" height="200" style="float:right;margin:0 0 20px 40px" />
-
-<p>In addition to allowing voice input, you can
- provide up to five text responses that the user can select for quick replies. Call
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.Builder.html#setChoices(java.lang.String[])"><code>setChoices()</code></a> and pass it a string array.</p>
-
-<p>For example, you may define some responses in a resource array:</p>
-
-<p class="code-caption">res/values/strings.xml</code>
-<pre class="prettyprint">
-&lt;?xml version="1.0" encoding="utf-8"?>
-&lt;resources>
- &lt;string-array name="reply_choices">
- &lt;item>Yes&lt;/item>
- &lt;item>No&lt;/item>
- &lt;item>Maybe&lt;/item>
- &lt;/string-array>
-&lt;/resources>
-</pre>
-
-<p>Then, inflate the string array and add it to the
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a>:</p>
-
-<pre>
-String replyLabel = getResources().getString(R.string.reply_label);
-String[] replyChoices = getResources().getStringArray(R.array.reply_choices);
-
-RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
- .setLabel(replyLabel)
- .setChoices(replyChoices)
- .build();
-</pre>
-
-
-
-
-<h2 id="PrimaryAction">Receive Voice Input for the Primary Action</h2>
-
-<p>If "Reply" is your notification's primary action (defined by the {@link
-android.support.v4.app.NotificationCompat.Builder#setContentIntent setContentIntent()}
-method), then you should attach the
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> to the main action using
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#addRemoteInputForContentIntent(android.support.wearable.notifications.RemoteInput)">
-<code>addRemoteInputForContentIntent()</code></a>. For example:</p>
-
-<pre>
-// Create intent for reply action
-Intent replyIntent = new Intent(this, ReplyActivity.class);
-PendingIntent replyPendingIntent =
- PendingIntent.getActivity(this, 0, replyIntent, 0);
-
-// Build the notification
-NotificationCompat.Builder replyNotificationBuilder =
- new NotificationCompat.Builder(this)
- .setSmallIcon(R.drawable.ic_new_message)
- .setContentTitle("Message from Travis")
- .setContentText("I love key lime pie!")
- .setContentIntent(replyPendingIntent);
-
-// Create the remote input
-RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
- .setLabel(replyLabel)
- .build();
-
-// Add remote input to wearable options and apply to notification
-Notification replyNotification =
- new WearableNotificationOptions.Builder()
- .addRemoteInputForContentIntent(remoteInput)
- .build()
- .applyTo(replyNotificationBuilder)
- .build();
-</pre>
-
-<p>By using
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#addRemoteInputForContentIntent(android.support.wearable.notifications.RemoteInput)">
-<code>addRemoteInputForContentIntent()</code></a> to add the
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> object to the notification's primary action,
-the button that normally appears as an "Open" action becomes the "Reply" action
-and starts the voice input UI when users select it on Android Wear.</p>
-
-
-
-<h2 id="NewAction">Receive Voice Input for a Secondary Action</h2>
-
-<p>If the "Reply" action is not your notification's primary action and you want to enable
-voice input for a secondary action, add the
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> to a new action button defined by an
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.html">
-<code>Action</code></a> object.</p>
-
-<p>You should instantiate the
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.html">
-<code>WearableAction</code></a> with the
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.Builder.html"><code>WearableAction.Builder()</code></a>
-constructor, which takes an icon and text label for the action button, plus the
-{@link android.app.PendingIntent}
-the system should use to invoke your app when the user selects the action. For example:</p>
-
-<pre>
-// Create the pending intent to fire when the user selects the action
-Intent replyIntent = new Intent(this, ReplyActivity.class);
-PendingIntent pendingReplyIntent =
- PendingIntent.getActivity(this, 0, replyIntent, 0);
-
-// Create the remote input
-RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
- .setLabel(replyLabel)
- .build();
-
-// Create the notification action
-WearableAction replyAction = new WearableAction.Builder(R.drawable.ic_message,
- "Reply", pendingIntent)
- .addRemoteInput(remoteInput)
- .build();
-</pre>
-
-
-<p>After you add the
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> to the
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.html">
-<code>Wearablection</code></a>, set the
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.html">
-<code>WearableAction</code></a> on the
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html"><code>WearableNotifications.Builder</code></a> using
- <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationsOptions.Builder.html#addAction(Action)"><code>addAction()</code></a>.
-For example:</p>
-
-<pre>
-// Create basic notification builder
-NotificationCompat.Builder replyNotificationBuilder =
- new NotificationCompat.Builder(this)
- .setContentTitle("New message");
-
-// Create the notification action and add remote input
-WearableAction replyAction = new WearableAction.Builder(R.drawable.ic_message,
- "Reply", pendingIntent)
- .addRemoteInput(remoteInput)
- .build();
-
-// Create wearable notification and add action
-Notification replyNotification =
- new WearableNotificationOptions.Builder()
- .addAction(replyAction)
- .build()
- .applyTo(replyNotificationBuilder)
- .build();
-</pre>
-
-
-<p>Now, when the user selects "Reply" from an Android wearable, the system prompts the user
- for voice input (and shows the list of pre-defined replies, if provided).
- Once the user completes a response, the system invokes
- the {@link android.content.Intent} attached to the action and adds the
-<code>EXTRA_VOICE_REPLY</code> extra (the string
- you passed to the
- <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.Builder.html"><code>RemoteInput.Builder</code></a> constructor)
- with the user's message as the string value.</p>
-
-<h2 id="ObtainInput">Obtaining the Voice Input as a String</h2>
-<p>To obtain the user's voice input, call
-<a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html#getResultsFromIntent(Intent)"><code>getResultsFromIntent()</code></a>,
-passing in the "Reply" action's intent. This method returns
-a {@link android.os.Bundle} that represents the intent's extras. You can then query the
-{@link android.os.Bundle} to obtain the user's voice input string.
-</p>
-<p>
-The following code shows a method that accepts an intent and returns the voice input string,
-which is referenced by the <code>EXTRA_VOICE_REPLY</code> key that is used in the previous examples:
-</p>
-<pre>
-/**
- * Obtain the intent that started this activity by calling
- * Activity.getIntent() and pass it into this method to
- * get the associated voice input string.
- */
-private String getMessageText(Intent intent) {
- Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
- if (remoteInput != null) {
- return remoteInput.getString(Intent.EXTRA_VOICE_REPLY);
- }
- }
- return null;
-}
-</pre>
-
-</body>
-</html>
diff --git a/docs/html/wear/notifications/stacks.jd b/docs/html/wear/notifications/stacks.jd
deleted file mode 100644
index 3c3dc09..0000000
--- a/docs/html/wear/notifications/stacks.jd
+++ /dev/null
@@ -1,138 +0,0 @@
-page.title=Stacking Notifications
-
-@jd:body
-
-<img src="{@docRoot}wear/images/11_bundles_B.png" height="200" width="169" style="float:right;margin:0 0 20px 40px" alt="" />
-<img src="{@docRoot}wear/images/11_bundles_A.png" height="200" width="169" style="float:right;margin:0 0 20px 40px" alt="" />
-
-<p>When creating notifications for a handheld device, you should always aggregate similar
-notifications into a single summary notification. For example, if your app creates notifications
-for received messages, you should not show more than one notification
-on a handheld device&mdash;when more than one is message is received, use a single notification
-to provide a summary such as "2 new messages."</p>
-
-<p>However, a summary notification is less useful on an Android wearable because users
-are not able to read details from each message on the wearable (they must open your app on the
-handheld to view more information). So for the wearable device, you should
-group all the notifications together in a stack. The stack of notifications appears as a single
-card, which users can expand to view the details from each notification separately. The new
-<a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setGroup(java.lang.String, int)">
-<code>setGroup()</code></a> method makes this possible while allowing you to still provide
-only one summary notification on the handheld device.</p>
-
-<p>For details about designing notification stacks, see the
-<a href="{@docRoot}wear/design/index.html#NotificationStacks">Design Principles of Android
-Wear</a>.</p>
-
-
-<h2 id="AddGroup">Add Each Notification to a Group</h2>
-
-<p>To create a stack, call <a
-href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setGroup(java.lang.String, int)">
-<code>setGroup()</code></a> for each notification you want in the stack and specify a
-group key. Then call <a href="{@docRoot}reference/android/support/wearable/app/NotificationManagerCompat.html#notify(int, android.app.Notification)"><code>notify()</code></a> to send it to the wearable.</p>
-
-<pre style="clear:right">
-final static String GROUP_KEY_EMAILS = "group_key_emails";
-
-// Build the notification
-NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext)
- .setContentTitle("New mail from " + sender1)
- .setContentText(subject1)
- .setSmallIcon(R.drawable.new_mail);
-
-// Set the group with WearableNotificationOptions.Builder and apply to the notification
-Notification notif1 = new WearableNotificationOptions.Builder()
- .setGroup(GROUP_KEY_EMAILS)
- .build()
- .applyTo(builder)
- .build();
-
-// Issue the notification
-NotificationManagerCompat notificationManager =
- NotificationManagerCompat.from(this);
-notificationManager.notify(notificationId1, notif);
-</pre>
-
-<p>Later on, when you create another notification, specify
-the same group key. When you call
-<a href="{@docRoot}reference/android/support/v4/app/NotificationManagerCompat.html#notify(int, android.app.Notification)"><code>notify()</code></a>,
-this notification appears in the same stack as the previous notification,
-instead of as a new card:</p>
-
-<pre style="clear:right">
-builder = new NotificationCompat.Builder(mContext)
- .setContentTitle("New mail from " + sender2)
- .setContentText(subject2)
- .setSmallIcon(R.drawable.new_mail);
-
-// Use the same group as the previous notification
-Notification notif2 = new WearableNotificationOptions.Builder()
- .setGroup(GROUP_KEY_EMAILS)
- .build()
- .applyTo(builder)
- .build();
-
-notificationManager.notify(notificationId2, notif);
-</pre>
-
-<p>By default, notifications appear in the order in which you added them, with the most recent
- notification visible at the top. You can define a specific position in the group
- by passing an order position as the second parameter for <a
-href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setGroup(java.lang.String, int)">
-<code>setGroup()</code></a>.</p>
-
-
-<h2 id="AddSummary">Add a Summary Notification</h2>
-
-<img src="{@docRoot}wear/images/notif_summary_framed.png" height="242" width="330" style="float:right;margin:0 0 20px 40px" alt="" />
-
-<p>It's important that you still provide a summary notification that appears on handheld devices.
-So in addition to adding each unique notification to the same stack group, also add a summary
-notification, but set its order position to be <a
-href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationsOptions.html#GROUP_ORDER_SUMMARY"><code>GROUP_ORDER_SUMMARY</code></a>.</p>
-
-<p>This notification does not appear in your stack of notifications on the wearable, but
-appears as the only notification on the handheld device.</p>
-
-<pre style="clear:right">
-Bitmap largeIcon = BitmapFactory.decodeResource(getResources(),
- R.drawable.ic_large_icon);
-
-// Create an InboxStyle notification
-builder = new NotificationCompat.Builder(this)
- .setContentTitle("2 new messages")
- .setSmallIcon(R.drawable.ic_small_icon)
- .setLargeIcon(largeIcon)
- .setStyle(new NotificationCompat.InboxStyle()
- .addLine("Alex Faaborg Check this out")
- .addLine("Jeff Chang Launch Party")
- .setBigContentTitle("2 new messages")
- .setSummaryText("johndoe@gmail.com"));
-
-// Specify the notification to be the group summary
-Notification summaryNotification = new WearableNotificationOptions.Builder()
- .setGroupSummary(GROUP_KEY_EMAILS)
- .build()
- .applyTo(builder)
- .build();
-
-notificationManager.notify(notificationId3, summaryNotification);
-</pre>
-
-<p>
-This notification uses {@link android.support.v4.app.NotificationCompat.InboxStyle},
-which gives you an easy way to create notifications for email or messaging apps.
-You can use this style, another one defined in {@link android.support.v4.app.NotificationCompat},
-or no style for the summary notification.
-</p>
-
-<p class="note"><b>Tip:</b>
-To style the text like in the example screenshot, see
-<a href="{@docRoot}guide/topics/resources/string-resource.html#StylingWithHTML">Styling
-with HTML markup</a> and
-<a href="{@docRoot}guide/topics/resources/string-resource.html#StylingWithSpannables">Styling
-with Spannables</a>.
-</p>
-</body>
-</html> \ No newline at end of file