From 2871e05b48f0b932885986322ce01212717a6399 Mon Sep 17 00:00:00 2001
From: Ricardo Cervera
However, before you can begin a connection by calling +Important: To avoid client connection errors on devices that do not have the +Android +Wear app installed, use a separate {@code +GoogleApiClient} instance to access only the {@code +Wearable} API. For more information, see Access the Wearable +API.
+ +Before you can begin a connection by calling {@code connect()} on the {@code @@ -408,6 +419,45 @@ consult the corresponding documentation, such as for
+On devices that do not have the Android
+Wear app installed, connection requests that include the {@code
+Wearable} API fail with the
+API_UNAVAILABLE error code. If your app uses the {@code
+Wearable} API in addition to other Google APIs, use a separate {@code
+GoogleApiClient} instance to access the {@code
+Wearable} API. This approach enables you to access other Google APIs on devices that are not
+paired with a wearable device.
When you use a separate {@code +GoogleApiClient} instance to access only the Wearable API, you can determine +whether the Android +Wear app is installed on the device:
+ +
+// Connection failed listener method for a client that only
+// requests access to the Wearable API
+@Override
+public void onConnectionFailed(ConnectionResult result) {
+ if (result.getErrorCode() == ConnectionResult.API_UNAVAILABLE) {
+ // The Android Wear app is not installed
+ }
+ ...
+}
+
+
+
+
+
+Important: To avoid client connection errors on devices that do not have the +Android +Wear app installed, use a separate {@code +GoogleApiClient} instance to access only the {@code +Wearable} API. For more information, see Access the Wearable API.
+Before you use the data layer API, start a connection on your client by calling the
connect()
method, as described in
Accessing Google Play services APIs.
When the system invokes the onConnected() callback for your client, you're ready
-to use the data layer API.