Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a4a89f6 authored by Ricardo Cervera's avatar Ricardo Cervera Committed by Android Git Automerger
Browse files

am 811aeae9: am e34167ce: Merge "docs: Fixed minor issues with Wear docs. Bug:...

am 811aeae9: am e34167ce: Merge "docs: Fixed minor issues with Wear docs. Bug: 16062631" into klp-modular-dev

* commit '811aeae9':
  docs: Fixed minor issues with Wear docs. Bug: 16062631
parents 6b88a061 811aeae9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -89,10 +89,16 @@ types of screen shapes, which is useful for testing.</p>
  <li>Install the Android Wear app, available on Google Play, on your handheld.</li>
  <li>Follow the app's instructions to pair your handheld with your wearable.
  This allows you to test out synced handheld notifications, if you're building them.</li>
  <li>Leave the Android Wear app open on your phone.</li>
  <li>Connect the wearable to your machine through USB, so you can install apps directly to it
  as you develop.</li>
  as you develop. A message appears on both the wearable and the Android Wear app prompting you to allow debugging.</li>
  <li>On the Android Wear app, check <strong>Always allow from this computer</strong> and tap
  <strong>OK</strong>.</li>
</ol>

<p>The <strong>Android</strong> tool window on Android Studio shows the system log from the wearable.
The wearable should also be listed when you run the <code>adb devices</code> command.</p>

<h2 id="CreateProject">Create a Project</h2>

<p>To begin development, create an app project that contains
+10 −2
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ GoogleApiClient mGoogleAppiClient = new GoogleApiClient.Builder(this)
                &#64;Override
                public void onConnected(Bundle connectionHint) {
                    Log.d(TAG, "onConnected: " + connectionHint);
                    // Now you can use the data layer API
                }
                &#64;Override
                public void onConnectionSuspended(int cause) {
@@ -57,3 +58,10 @@ GoogleApiClient mGoogleAppiClient = new GoogleApiClient.Builder(this)
        .addApi(Wearable.API)
        .build();
</pre>

<p>Before you use the data layer API, start a connection on your client by calling the
<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html#connect()">connect()</a>
method, as described in
<a href="{@docRoot}google/auth/api-client.html#Starting">Accessing Google Play services APIs</a>.
When the system invokes the <code>onConnected()</code> callback for your client, you're ready
to use the data layer API.</p>
 No newline at end of file