diff options
Diffstat (limited to 'docs/html/google')
| -rw-r--r-- | docs/html/google/auth/api-client.jd | 118 | ||||
| -rw-r--r-- | docs/html/google/auth/http-auth.jd | 2 | ||||
| -rw-r--r-- | docs/html/google/play-services/index.jd | 24 |
3 files changed, 95 insertions, 49 deletions
diff --git a/docs/html/google/auth/api-client.jd b/docs/html/google/auth/api-client.jd index e33721d..8f926f5 100644 --- a/docs/html/google/auth/api-client.jd +++ b/docs/html/google/auth/api-client.jd @@ -99,20 +99,23 @@ GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this) href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a> by appending additional calls to -<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApi(com.google.android.gms.common.api.Api)" +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApi(com.google.android.gms.common.api.Api<? extends com.google.android.gms.common.api.Api.ApiOptions.NotRequiredOptions>)" >{@code addApi()}</a> and <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addScope(com.google.android.gms.common.api.Scope)" >{@code addScope()}</a>.</p> <p class="caution"> -<strong>Important:</strong> To avoid client connection errors on devices that do not have the +<strong>Important:</strong> If you are adding multiple APIs to a +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html"><code>GoogleApiClient</code></a>, +you may run into client connection errors on devices that do not have the <a href="https://play.google.com/store/apps/details?id=com.google.android.wearable.app&hl=en">Android -Wear app</a> installed, use a separate <a -href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code -GoogleApiClient}</a> instance to access only the <a +Wear app</a> installed. To avoid connection errors, call the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApiIfAvailable(com.google.android.gms.common.api.Api<? extends com.google.android.gms.common.api.Api.ApiOptions.NotRequiredOptions>, com.google.android.gms.common.api.Scope...)">{@code addApiIfAvailable()}</a> +method and pass in the <a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code -Wearable}</a> API. For more information, see <a href="#WearableApi">Access the Wearable -API</a>.</p> +Wearable}</a> API to indicate that your client should gracefully handle the missing API. +For more information, see <a +href="{@docRoot}google/auth/api-client.html#WearableApi">Access the Wearable API</a>.</p> <p>Before you can begin a connection by calling <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html#connect()" @@ -421,27 +424,52 @@ consult the corresponding documentation, such as for <h3 id="WearableApi">Access the Wearable API</h3> -<p>On devices that do not have the <a -href="https://play.google.com/store/apps/details?id=com.google.android.wearable.app&hl=en">Android -Wear app</a> installed, connection requests that include the <a +<p>The Wearable API provides a communication channel for your handheld and wearable apps. The API +consists of a set of data objects that the system can send and synchronize over the wire and +listeners that notify your apps of important events with the data layer. The +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API is available on devices running Android 4.3 (API level 18) or higher when a wearable device is +connected. The API is not available under the following conditions: +</p> + +<ul> +<li>Devices running Android 4.2 (API level 17) or earlier.</li> +<li><a href="https://play.google.com/store/apps/details?id=com.google.android.wearable.app&hl=en">Android +Wear companion app</a> is not installed on the device.</li> +<li>Android Wear device is not connected.</li> +</ul> + +<h4 id="OnlyWearableApi">Using only the Wearable API</h4> + +<p>If your app uses the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API but not other Google APIs, you can add this API by calling the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApi(com.google.android.gms.common.api.Api<? extends com.google.android.gms.common.api.Api.ApiOptions.NotRequiredOptions>)" +>{@code addApi()}</a> method. The following example shows how to add the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API to your <a +href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code +GoogleApiClient}</a> instance:</p> + +<pre> +GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this) + .addApi(Wearable.API) + .build(); +</pre> + +<p>In situations where the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API is not available, connection requests that include the <a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> API fail with the <a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#API_UNAVAILABLE"> -<code>API_UNAVAILABLE</code></a> error code. If your app uses the <a -href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code -Wearable}</a> API in addition to other Google APIs, use a separate <a -href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code -GoogleApiClient}</a> instance to access the <a -href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code -Wearable}</a> API. This approach enables you to access other Google APIs on devices that are not -paired with a wearable device.</p> +<code>API_UNAVAILABLE</code></a> error code.</p> -<p>When you use a separate <a -href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code -GoogleApiClient}</a> instance to access only the Wearable API, you can determine -whether the <a -href="https://play.google.com/store/apps/details?id=com.google.android.wearable.app&hl=en">Android -Wear app</a> is installed on the device:</p> +<p> +The following example shows how to determine whether the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API is available: +</p> <pre> // Connection failed listener method for a client that only @@ -449,15 +477,55 @@ Wear app</a> is installed on the device:</p> @Override public void onConnectionFailed(ConnectionResult result) { if (result.getErrorCode() == ConnectionResult.API_UNAVAILABLE) { - // The Android Wear app is not installed + // The Wearable API is unavailable } ... } </pre> +<h4 id="WearableApiWithOthers">Using the Wearable API with other APIs</h4> + +<p> +If your app uses the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API in addition to other Google APIs, call the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#addApiIfAvailable(com.google.android.gms.common.api.Api<? extends com.google.android.gms.common.api.Api.ApiOptions.NotRequiredOptions>, com.google.android.gms.common.api.Scope...)">addApiIfAvailable()</a> +method and pass in the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API to indicate that your client should gracefully handle the missing API.</p> +<p>The following example shows how to access the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API along with the +<a href="{@docRoot}reference/com/google/android/gms/drive/DriveApi.html">{@code Drive}</a> +API:</p> +<pre> +// Create a GoogleApiClient instance +mGoogleApiClient = new GoogleApiClient.Builder(this) + .addApi(Drive.API) + .addApiIfAvailable(Wearable.API) + .addScope(Drive.SCOPE_FILE) + .addConnectionCallbacks(this) + .addOnConnectionFailedListener(this) + .build(); +</pre> + +<p>In the example above, the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a> +can successfully connect with the Google Drive service without connecting to the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API if it is unavailable. After you connect your +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a> +instance, ensure that the +<a href="{@docRoot}reference/com/google/android/gms/wearable/Wearable.html">{@code Wearable}</a> +API is available before making the API calls: +</p> + +<pre> +mGoogleApiClient.hasConnectedApi(Wearable.API); +</pre> <h2 id="Communicating">Communicate with Google Services</h2> diff --git a/docs/html/google/auth/http-auth.jd b/docs/html/google/auth/http-auth.jd index 804ba12..7d34d89 100644 --- a/docs/html/google/auth/http-auth.jd +++ b/docs/html/google/auth/http-auth.jd @@ -95,7 +95,7 @@ keytool -exportcert -alias <keystore_alias> -keystore <keystore_path> -lis </pre> <p>For example, you're using a debug-key with Eclipse, then the command looks like this:</p> <pre class="no-pretty-print"> -keytool -exportcert -alias androiddebugkey-keystore ~/.android/debug.keystore -list -v +keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v </pre> <p>Then the keystore password is "android".</p> </li> diff --git a/docs/html/google/play-services/index.jd b/docs/html/google/play-services/index.jd index e31290a..5ccdcb9 100644 --- a/docs/html/google/play-services/index.jd +++ b/docs/html/google/play-services/index.jd @@ -74,30 +74,8 @@ announcement <a href="http://android-developers.blogspot.com/2015/04/theres-lot-to-explore-with-google-play.html" class="external-link">blog post</a>.</p> <ul> - <li><strong>Maps</strong> - This release makes the Google Maps Android API v2 available on -<a href="https://developers.google.com/maps/documentation/android/wear" class="external-link"> -Android Wear</a>, so you can now create map-based apps that run directly on wearable devices. In -addition, the Maps API now offers a new -<a href="{@docRoot}reference/com/google/android/gms/maps/StreetViewPanorama.OnStreetViewPanoramaLongClickListener.html"> -{@code OnStreetViewPanoramaLongClickListener}</a> interface, similar to the existing -<a href="{@docRoot}reference/com/google/android/gms/maps/GoogleMap.OnMapLongClickListener.html"> -{@code OnMapLongClickListener}</a> interface. These listeners are particularly helpful -for wearable devices, so you can let users exit from the app by long-clicking on a map or panorama. -On a wearable device, the swipe gesture is used to pan the map instead of exiting the app. - <ul> - <li><a href="https://developers.google.com/maps/documentation/android/wear" - class="external-link">Google Maps on Android Wear developer guide</a> - </li> - <li><a href="https://github.com/googlemaps/android-samples" - class="external-link">Google Maps on Android Wear sample</a> - </li> - <li><a href="https://developers.google.com/maps/documentation/android/releases" - class="external-link">Release notes</a> - </li> - </ul> - </li> <li> - <strong>Wear</strong> - In addition to Maps support, this release provides you with the ability + <strong>Wear</strong> - This release provides you with the ability to advertise and discover the capabilities of devices that are connected in a Wear network, through the new <a href="{@docRoot}reference/com/google/android/gms/wearable/CapabilityApi.html"> {@code CapabilityApi}</a> class. The new |
