From aa3315d6b1b5be7ee313cff33402e76a2936d044 Mon Sep 17 00:00:00 2001
From: Luan Nguyen This lesson teaches you to
@@ -112,18 +112,20 @@ types of screen shapes, which is useful for testing.
Note: If you can not connect your wearable to your machine via USB, - follow the directions on - Debugging over - Bluetooth. + as you develop. A message appears on both the wearable and the Android Wear app prompting you to + allow debugging. + +
Note: If you can not connect your wearable + to your machine via USB, you can try + connecting over Bluetooth.
+The Android tool window on Android Studio shows the system log from the wearable.
-The wearable should also be listed when you run the adb devices
command.
The Android tool window on Android Studio shows the system log from the
+wearable. The wearable should also be listed when you run the adb devices
command.
When the wizard completes, Android Studio creates a new project with two modules, mobile and - wear. You now have a project for both your handheld and wearable apps that you can create activities, - services, custom layouts, and much more in. On the handheld app, you do most of the heavy lifting, - such as network communications, intensive processing, or tasks that require long - amounts of user interaction. When these are done, - you usually notify the wearable of the results through notifications or by syncing and sending - data to the wearable.
- -Note: The wear module also contains a "Hello World" activity that uses a
- WatchViewStub
that inflates a layout based on whether the device's screen
- is round or square. The WatchViewStub
class is one of the UI widgets that's provided
- by the wearable support library.
When the wizard completes, Android Studio creates a new project with two modules, mobile + and wear. You now have a project for both your handheld and wearable apps for which you can + create activities, services, and custom layouts. The handheld app does most of + the heavy lifting, such as network communications, intensive processing, or tasks that require + long amounts of user interaction. When the app completes these operations, your app should + notify the wearable of the results through notifications or by syncing and sending data to + the wearable.
+ +Note: The wear module also contains a "Hello World" activity that
+ uses a
+ WatchViewStub
.
+ This class inflates a layout based on whether the device's screen is round or square. The
+ WatchViewStub
+ class is one of the UI widgets that the
+ wearable support library
+ provides.
+
adb install
or the Play button on Android Studio.
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 -receives the wearable app.
+handheld app. When a user installs the handheld app from Google Play, a connected wearable +automatically receives the wearable app.Note: 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 @@ -184,7 +191,8 @@ wearable and prints out "Hello world!"
As part of the Project Wizard, the correct
dependencies are imported for you in the appropriate module's build.gradle
file.
-However, these dependencies are not required, so read the following descriptions to find out if you need them or not:
The Android
diff --git a/docs/html/training/wearables/apps/layouts.jd b/docs/html/training/wearables/apps/layouts.jd
index 1d0e49b..197b94b0c 100644
--- a/docs/html/training/wearables/apps/layouts.jd
+++ b/docs/html/training/wearables/apps/layouts.jd
@@ -10,7 +10,7 @@ helpoutsWidget=true
Here are some of the major classes in the Wearable UI Library:This lesson teaches you to
You should also read
@@ -73,8 +73,8 @@ public void onCreate(Bundle bundle){
For example:
Intent notificationIntent = new Intent(this, NotificationActivity.class);
-PendingIntent notificationPendingIntent = PendingIntent.getActivity(this, 0, notificationIntent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+PendingIntent notificationPendingIntent = PendingIntent.getActivity(
+ this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-
BoxInsetLayout
- A FrameLayout that's aware of screen shape and can box its
- children in the center square of a round screen.CardFragment
- A fragment that presents content within an expandable,
- vertically scrollable card.CircledImageView
- An image view surrounded by a circle.ConfirmationActivity
- An activity that displays confirmation animations after the user
- completes an action.CrossFadeDrawable
- A drawable that contains two child drawables and provides
- methods to directly adjust the blend between the two.DelayedConfirmationView
- A view that provides a circular countdown timer,
- typically used to automatically confirm an operation after a short delay has elapsed.DismissOverlayView
- A view for implementing long-press-to-dismiss.DotsPageIndicator
- A page indicator for GridViewPager that identifies the
- current page in relation to all available pages on the current row.GridViewPager
- A layout manager that allows the user to both vertically and
- horizontally through pages of data. You supply an implementation of a GridPagerAdapter to
- generate the pages that the view shows.GridPagerAdapter
- An adapter that supplies pages to a GridViewPager.FragmentGridPagerAdapter
- An implementation of GridPagerAdapter that
- represents each page as a fragment.WatchViewStub
- A class that can inflate a specific layout,
- depending on the shape of the device's screen.WearableListView
- An alternative version of ListView 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.
-
+
BoxInsetLayout
+ CardFragment
+ CircledImageView
+ ConfirmationActivity
+ CrossFadeDrawable
+ DelayedConfirmationView
+ DismissOverlayView
+ GridViewPager
+ GridPagerAdapter
+ instance to generate the pages that the view shows.
+ GridPagerAdapter
+ GridViewPager
+ object.
+ FragmentGridPagerAdapter
+ GridPagerAdapter
+ instance that represents each page as a fragment.
+ DotsPageIndicator
+ GridViewPager
+ implementation that identifies the current page in relation to all available pages on the current
+ row.
+ WatchViewStub
+ WearableListView
+ Wear UI library API reference
--
cgit v1.1