Merge "docs: Update JavaDoc reference links for Create Wearable Apps class" into mnc-preview-docs

This commit is contained in:
Luan Nguyen
2015-06-17 14:54:49 +00:00
committed by Android (Google) Code Review
2 changed files with 116 additions and 55 deletions

View File

@@ -9,9 +9,9 @@ helpoutsWidget=true
<h2>This lesson teaches you to</h2> <h2>This lesson teaches you to</h2>
<ol> <ol>
<li><a href="#UpdateSDK">Update Your SDK</a></li> <li><a href="#UpdateSDK">Update Your SDK</a></li>
<li><a href="#SetupEmulator">Set Up an Android Wear Emulator</a></li> <li><a href="#SetupEmulator">Set Up an Android Wear Emulator or Device</a></li>
<li><a href="#SetupDevice">Set Up an Android Wear Device</a></li>
<li><a href="#CreateProject">Create a Project</a></li> <li><a href="#CreateProject">Create a Project</a></li>
<li><a href="#Install">Install the Wearable App</a></li>
<li><a href="#Libraries">Include the Correct Libraries</a></li> <li><a href="#Libraries">Include the Correct Libraries</a></li>
</ol> </ol>
</div> </div>
@@ -112,18 +112,20 @@ types of screen shapes, which is useful for testing.</p>
<li>Tap <strong>ADB Debugging</strong> to enable adb.</li> <li>Tap <strong>ADB Debugging</strong> to enable adb.</li>
</ol> </ol>
<li>Connect the wearable to your machine through USB, so you can install apps directly to it <li>Connect the wearable to your machine through USB, so you can install apps directly to it
as you develop. A message appears on both the wearable and the Android Wear app prompting you to allow debugging.</li> as you develop. A message appears on both the wearable and the Android Wear app prompting you to
<p class="note"><strong>Note:</strong> If you can not connect your wearable to your machine via USB, allow debugging.</li>
follow the directions on
<a href="{@docRoot}training/wearables/apps/bt-debugging.html">Debugging over <p class="note"><strong>Note:</strong> If you can not connect your wearable
Bluetooth</a>. to your machine via USB, you can try
<a href="{@docRoot}training/wearables/apps/bt-debugging.html">connecting over Bluetooth</a>.
</p> </p>
<li>On the Android Wear app, check <strong>Always allow from this computer</strong> and tap <li>On the Android Wear app, check <strong>Always allow from this computer</strong> and tap
<strong>OK</strong>.</li> <strong>OK</strong>.</li>
</ol> </ol>
<p>The <strong>Android</strong> tool window on Android Studio shows the system log from the wearable. <p>The <i>Android</i> tool window on Android Studio shows the system log from the
The wearable should also be listed when you run the <code>adb devices</code> command.</p> wearable. The wearable should also be listed when you run the <code>adb devices</code> command.</p>
<h2 id="CreateProject">Create a Project</h2> <h2 id="CreateProject">Create a Project</h2>
@@ -147,18 +149,23 @@ Project</a>. As you follow the wizard, enter the following information:</p>
<li>In the first <b>Add an Activity</b> window, add a blank activity for mobile.</li> <li>In the first <b>Add an Activity</b> window, add a blank activity for mobile.</li>
<li>In the second <b>Add an Activity</b> window, add a blank activity for Wear.</li> <li>In the second <b>Add an Activity</b> window, add a blank activity for Wear.</li>
</ol> </ol>
<p>When the wizard completes, Android Studio creates a new project with two modules, <b>mobile</b> and <p>When the wizard completes, Android Studio creates a new project with two modules, <b>mobile</b>
<b>wear</b>. You now have a project for both your handheld and wearable apps that you can create activities, and <b>wear</b>. You now have a project for both your handheld and wearable apps for which you can
services, custom layouts, and much more in. On the handheld app, you do most of the heavy lifting, create activities, services, and custom layouts. The handheld app does most of
such as network communications, intensive processing, or tasks that require long the heavy lifting, such as network communications, intensive processing, or tasks that require
amounts of user interaction. When these are done, long amounts of user interaction. When the app completes these operations, your app should
you usually notify the wearable of the results through notifications or by syncing and sending notify the wearable of the results through notifications or by syncing and sending data to
data to the wearable.</p> the wearable.</p>
<p class="note"><b>Note:</b> The <b>wear</b> module also contains a "Hello World" activity that uses a <p class="note"><b>Note:</b> The <b>wear</b> module also contains a "Hello World" activity that
<code>WatchViewStub</code> that inflates a layout based on whether the device's screen uses a
is round or square. The <code>WatchViewStub</code> class is one of the UI widgets that's provided <a href="{@docRoot}reference/android/support/wearable/view/WatchViewStub.html"><code>WatchViewStub</code></a>.
by the <a href="{@docRoot}training/wearables/apps/layouts.html#UiLibrary">wearable support library</a>.</p> This class inflates a layout based on whether the device's screen is round or square. The
<a href="{@docRoot}reference/android/support/wearable/view/WatchViewStub.html"><code>WatchViewStub</code></a>
class is one of the UI widgets that the
<a href="{@docRoot}training/wearables/apps/layouts.html#UiLibrary">wearable support library</a>
provides.
</p>
</li> </li>
<h2 id="Install">Install the Wearable App</h2> <h2 id="Install">Install the Wearable App</h2>
@@ -167,8 +174,8 @@ Project</a>. As you follow the wizard, enter the following information:</p>
either <code>adb install</code> or the <b>Play</b> button on Android Studio.</p> either <code>adb install</code> or the <b>Play</b> button on Android Studio.</p>
<p>When you're ready to publish your app to users, you embed the wearable app inside of the <p>When you're ready to publish your app to users, you embed the wearable app inside of the
handheld app. When users install the handheld app from Google Play, a connected wearable automatically handheld app. When a user installs the handheld app from Google Play, a connected wearable
receives the wearable app.</p> automatically receives the wearable app.</p>
<p class="note"><b>Note:</b> The automatic installation of wearable apps <p class="note"><b>Note:</b> The automatic installation of wearable apps
does not work when you are signing apps with a debug key and only works with release keys. See does not work when you are signing apps with a debug key and only works with release keys. See
@@ -184,7 +191,8 @@ wearable and prints out "Hello world!"
<p>As part of the Project Wizard, the correct <p>As part of the Project Wizard, the correct
dependencies are imported for you in the appropriate module's <code>build.gradle</code> file. dependencies are imported for you in the appropriate module's <code>build.gradle</code> file.
However, these dependencies are not required, so read the following descriptions to find out if you need them or not:</p> However, these dependencies are not required, so read the following descriptions to find out if you
need them or not:</p>
<b>Notifications</b> <b>Notifications</b>
<p>The <a href="{@docRoot}tools/support-library/features.html#v4">Android <p>The <a href="{@docRoot}tools/support-library/features.html#v4">Android

View File

@@ -10,7 +10,7 @@ helpoutsWidget=true
<h2>This lesson teaches you to</h2> <h2>This lesson teaches you to</h2>
<ol> <ol>
<li><a href="#CustomNotifications">Create custom notifications</a></li> <li><a href="#CustomNotifications">Create custom notifications</a></li>
<li><a href="#UiLibrary">Create Layouts with the Wearable UI Library</li> <li><a href="#UiLibrary">Create Layouts with the Wearable UI Library</a></li>
</ol> </ol>
<h2>You should also read</h2> <h2>You should also read</h2>
@@ -73,8 +73,8 @@ public void onCreate(Bundle bundle){
For example: For example:
<pre> <pre>
Intent notificationIntent = new Intent(this, NotificationActivity.class); Intent notificationIntent = new Intent(this, NotificationActivity.class);
PendingIntent notificationPendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent notificationPendingIntent = PendingIntent.getActivity(
PendingIntent.FLAG_UPDATE_CURRENT); this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
</pre> </pre>
</li> </li>
<li>Build a {@link android.app.Notification} and call <li>Build a {@link android.app.Notification} and call
@@ -110,35 +110,88 @@ dependencies {
<p>Here are some of the major classes in the Wearable UI Library:</p> <p>Here are some of the major classes in the Wearable UI Library:</p>
<ul> <dl>
<li><code>BoxInsetLayout</code> - A FrameLayout that's aware of screen shape and can box its <dt><a href="{@docRoot}reference/android/support/wearable/view/BoxInsetLayout.html"><code>BoxInsetLayout</code></a>
children in the center square of a round screen.</li> </dt>
<li><code>CardFragment</code> - A fragment that presents content within an expandable, <dd>A {@link android.widget.FrameLayout} object
vertically scrollable card.</li> that's aware of screen shape and can box its children in the center square of a round screen.
<li><code>CircledImageView</code> - An image view surrounded by a circle.</li> </dd>
<li><code>ConfirmationActivity</code> - An activity that displays confirmation animations after the user
completes an action.</li> <dt><a href="{@docRoot}reference/android/support/wearable/view/CardFragment.html"><code>CardFragment</code></a>
<li><code>CrossFadeDrawable</code> - A drawable that contains two child drawables and provides </dt>
methods to directly adjust the blend between the two.</li> <dd>A fragment that presents content within an expandable, vertically scrollable card.
<li><code>DelayedConfirmationView</code> - A view that provides a circular countdown timer, </dd>
typically used to automatically confirm an operation after a short delay has elapsed.</li>
<li><code>DismissOverlayView</code> - A view for implementing long-press-to-dismiss.</li> <dt><a href="{@docRoot}reference/android/support/wearable/view/CircledImageView.html"><code>CircledImageView</code></a>
<li><code>DotsPageIndicator</code> - A page indicator for GridViewPager that identifies the </dt>
current page in relation to all available pages on the current row.</li> <dd>An image view surrounded by a circle.
<li><code>GridViewPager</code> - A layout manager that allows the user to both vertically and </dd>
horizontally through pages of data. You supply an implementation of a GridPagerAdapter to
generate the pages that the view shows.</li> <dt><a href="{@docRoot}reference/android/support/wearable/activity/ConfirmationActivity.html"><code>ConfirmationActivity</code></a>
<li><code>GridPagerAdapter</code> - An adapter that supplies pages to a GridViewPager.</li> </dt>
<li><code>FragmentGridPagerAdapter</code> - An implementation of GridPagerAdapter that <dd>An activity that displays confirmation animations after the user completes an action.
represents each page as a fragment.</li> </dd>
</li>
<li><code>WatchViewStub</code> - A class that can inflate a specific layout, <dt><a href="{@docRoot}reference/android/support/wearable/view/CrossfadeDrawable.html"><code>CrossFadeDrawable</code></a>
depending on the shape of the device's screen.</li> </dt>
<li><code>WearableListView</code> - An alternative version of ListView that is optimized for <dd>A drawable that contains two child drawables and provides methods to directly adjust the blend
ease of use on small screen wearable devices. It displays a vertically scrollable list of items, between the two.
and automatically snaps to the nearest item when the user stops scrolling. </dd>
</li>
</ul> <dt><a href="{@docRoot}reference/android/support/wearable/view/DelayedConfirmationView.html"><code>DelayedConfirmationView</code></a>
</dt>
<dd>A view that provides a circular countdown timer, typically used to automatically confirm an
operation after a short delay has elapsed.
</dd>
<dt><a href="{@docRoot}reference/android/support/wearable/view/DismissOverlayView.html"><code>DismissOverlayView</code></a>
</dt>
<dd>A view for implementing long-press-to-dismiss.
</dd>
<dt><a href="{@docRoot}reference/android/support/wearable/view/GridViewPager.html"><code>GridViewPager</code></a>
</dt>
<dd>A layout manager that allows the user to navigate both vertically and
horizontally through pages of data. You supply an implementation of a
<a href="{@docRoot}reference/android/support/wearable/view/GridPagerAdapter.html"><code>GridPagerAdapter</code></a>
instance to generate the pages that the view shows.
</dd>
<dt><a href="{@docRoot}reference/android/support/wearable/view/GridPagerAdapter.html"><code>GridPagerAdapter</code></a>
</dt>
<dd>An adapter that supplies pages to a
<a href="{@docRoot}reference/android/support/wearable/view/GridViewPager.html"><code>GridViewPager</code></a>
object.
</dd>
<dt><a href="{@docRoot}reference/android/support/wearable/view/FragmentGridPagerAdapter.html"><code>FragmentGridPagerAdapter</code></a>
</dt>
<dd>An implementation of a
<a href="{@docRoot}reference/android/support/wearable/view/GridPagerAdapter.html"><code>GridPagerAdapter</code></a>
instance that represents each page as a fragment.
</dd>
<dt><a href="{@docRoot}reference/android/support/wearable/view/DotsPageIndicator.html"><code>DotsPageIndicator</code></a>
</dt>
<dd>A page indicator for a
<a href="{@docRoot}reference/android/support/wearable/view/GridViewPager.html"><code>GridViewPager</code></a>
implementation that identifies the current page in relation to all available pages on the current
row.
</dd>
<dt><a href="{@docRoot}reference/android/support/wearable/view/WatchViewStub.html"><code>WatchViewStub</code></a>
</dt>
<dd>A class that can inflate a specific layout, depending on the shape of the device's screen.
</dd>
<dt><a href="{@docRoot}reference/android/support/wearable/view/WearableListView.html"><code>WearableListView</code></a>
</dt>
<dd>An alternative version of a {@link android.widget.ListView}
object that is optimized for ease of use on small screen wearable devices. It displays a
vertically scrollable list of items, and automatically snaps to the nearest item when the user
stops scrolling.
</dd>
</dl>
<h3 id="UiLibReference">Wear UI library API reference</h3> <h3 id="UiLibReference">Wear UI library API reference</h3>