Merge "RESUBMIT: "docs: Updated 'What's New' in Google Play services doc to reflect changes in GMS v7.0 (Orla). This content is scheduled to be published with the Orla SDK release.""" into lmp-docs
This commit is contained in:
committed by
Android (Google) Code Review
commit
80f947c8b4
@@ -52,8 +52,7 @@ for REST APIs</a>.</p>
|
|||||||
|
|
||||||
<p class="note">
|
<p class="note">
|
||||||
<strong>Note:</strong> If you have an existing app that connects to Google Play services with a
|
<strong>Note:</strong> If you have an existing app that connects to Google Play services with a
|
||||||
subclass of <a
|
subclass of {@code GooglePlayServicesClient}, you should migrate to <a
|
||||||
href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.html">{@code GooglePlayServicesClient}</a>, you should migrate to <a
|
|
||||||
href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code
|
href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code
|
||||||
GoogleApiClient}</a> as soon as possible.</p>
|
GoogleApiClient}</a> as soon as possible.</p>
|
||||||
|
|
||||||
@@ -133,7 +132,9 @@ succeeds, fails, or becomes suspended.</p>
|
|||||||
API Client:</p>
|
API Client:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
import gms.common.api.*;
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||||||
|
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
|
||||||
|
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
|
||||||
import gms.drive.*;
|
import gms.drive.*;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
|
||||||
@@ -206,20 +207,18 @@ href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html
|
|||||||
|
|
||||||
<p>However, if you run this code, there's a good chance it will fail and your app will receive a call
|
<p>However, if you run this code, there's a good chance it will fail and your app will receive a call
|
||||||
to <a
|
to <a
|
||||||
href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.OnConnectionFailedListener.html#onConnectionFailed(com.google.android.gms.common.ConnectionResult)"
|
href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.OnConnectionFailedListener.html#onConnectionFailed(com.google.android.gms.common.ConnectionResult)"
|
||||||
>{@code onConnectionFailed()}</a> with the <a
|
>{@code onConnectionFailed()}</a> with the <a
|
||||||
href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SIGN_IN_REQUIRED"
|
href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SIGN_IN_REQUIRED"
|
||||||
>{@code SIGN_IN_REQUIRED}</a> error because the user account
|
>{@code SIGN_IN_REQUIRED}</a> error because the user account
|
||||||
has not been specified. The next section shows how to handle this error and others.</p>
|
has not been specified. The next section shows how to handle this error and others.</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3 id="HandlingFailures">Handle connection failures</h3>
|
<h3 id="HandlingFailures">Handle connection failures</h3>
|
||||||
|
|
||||||
<p>When you receive a call to the <a
|
<p>When you receive a call to the
|
||||||
href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.OnConnectionFailedListener.html#onConnectionFailed(com.google.android.gms.common.ConnectionResult)"
|
<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.OnConnectionFailedListener.html#onConnectionFailed(com.google.android.gms.common.ConnectionResult)">
|
||||||
>{@code onConnectionFailed()}</a> callback, you should call <a
|
{@code onConnectionFailed()}</a> callback, you should call <a
|
||||||
href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#hasResolution()"
|
href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#hasResolution()"
|
||||||
>{@code hasResolution()}</a> on the provided <a
|
>{@code hasResolution()}</a> on the provided <a
|
||||||
href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html"
|
href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html"
|
||||||
@@ -244,8 +243,9 @@ dialog may simply provide a message explaining the error, but it may also provid
|
|||||||
launch an activity that can resolve the error (such as when the user needs to install a newer
|
launch an activity that can resolve the error (such as when the user needs to install a newer
|
||||||
version of Google Play services).</p>
|
version of Google Play services).</p>
|
||||||
|
|
||||||
<p>For example, your <a
|
<p>For example, your
|
||||||
href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.OnConnectionFailedListener.html#onConnectionFailed(com.google.android.gms.common.ConnectionResult)"
|
<a
|
||||||
|
href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.OnConnectionFailedListener.html#onConnectionFailed(com.google.android.gms.common.ConnectionResult)"
|
||||||
>{@code onConnectionFailed()}</a> callback method should now look like this:</p>
|
>{@code onConnectionFailed()}</a> callback method should now look like this:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
@@ -365,9 +365,9 @@ if retained across activity instances, though. The next section explains further
|
|||||||
|
|
||||||
<h3 id="MaintainingState">Maintain state while resolving an error</h3>
|
<h3 id="MaintainingState">Maintain state while resolving an error</h3>
|
||||||
|
|
||||||
<p>To avoid executing the code in <a
|
<p>To avoid executing the code in
|
||||||
href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.OnConnectionFailedListener.html#onConnectionFailed(com.google.android.gms.common.ConnectionResult)"
|
<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.OnConnectionFailedListener.html#onConnectionFailed(com.google.android.gms.common.ConnectionResult)">
|
||||||
>{@code onConnectionFailed()}</a> while a previous attempt to resolve an
|
{@code onConnectionFailed()}</a> while a previous attempt to resolve an
|
||||||
error is ongoing, you need to retain a boolean that tracks whether your app is already attempting
|
error is ongoing, you need to retain a boolean that tracks whether your app is already attempting
|
||||||
to resolve an error.</p>
|
to resolve an error.</p>
|
||||||
|
|
||||||
|
|||||||
@@ -52,11 +52,8 @@ your app with the most recent version of Google Play services without worrying
|
|||||||
about your users' Android version.</p>
|
about your users' Android version.</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<p>To start integrating Google Play services into your app,
|
<p>To start integrating Google Play services into your app,
|
||||||
follow the <a href="/google/play-services/setup.html">Setup</a> guide.</p>
|
follow the <a href="/google/play-services/setup.html">Setup</a> guide.</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 style="margin-top:0" id="newfeatures">New Features</h2>
|
<h2 style="margin-top:0" id="newfeatures">New Features</h2>
|
||||||
@@ -65,6 +62,125 @@ about your users' Android version.</p>
|
|||||||
<p><a href="#" onclick="return toggleContent(this)">
|
<p><a href="#" onclick="return toggleContent(this)">
|
||||||
<img src="{@docRoot}assets/images/triangle-opened.png"
|
<img src="{@docRoot}assets/images/triangle-opened.png"
|
||||||
class="toggle-content-img"
|
class="toggle-content-img"
|
||||||
|
alt=""/>Google Play services, Version 7.0</a> <em>(March 2015)</em>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="toggle-content-toggleme">
|
||||||
|
<dl>
|
||||||
|
<dt>Highlights in Version 7.0</dt>
|
||||||
|
<dd>
|
||||||
|
<p>For a summary of the feature highlights in Google Play services 7.0, see the
|
||||||
|
announcement
|
||||||
|
<a href="http://android-developers.blogspot.com/2015/03/google-play-services-70-places-everyone.html"
|
||||||
|
class="external-link">blog post</a>.</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Places</strong> - Using the Google Places API for Android, you can build
|
||||||
|
location-aware apps that respond contextually to the local businesses and other places near
|
||||||
|
the device. Use the built-in place picker UI widget and API methods to find the device’s
|
||||||
|
current place, autocomplete users’ queries, and more.
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://developers.google.com/places/documentation/android/"
|
||||||
|
class="external-link">Places API developer guide</a></li>
|
||||||
|
<li><a href="{@docRoot}reference/com/google/android/gms/location/places/package-summary.html">
|
||||||
|
Places API reference</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><strong>Location settings</strong> - While the
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html">
|
||||||
|
{@code FusedLocationProviderApi}</a>
|
||||||
|
combines multiple sensors to give you the optimal location, the accuracy of the location your
|
||||||
|
app receives still depends greatly on the settings enabled on the device (GPS, wifi, airplane
|
||||||
|
mode, and others). Using the new
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/location/SettingsApi.html">
|
||||||
|
{@code SettingsApi}</a>
|
||||||
|
class, you can bring up a Location Settings dialog which displays a one-touch control for users
|
||||||
|
to change their settings without leaving your app.
|
||||||
|
</li>
|
||||||
|
<li><strong>Fit</strong> - The Google Fit API is now more efficient with modular calls to specific
|
||||||
|
functionality within the API. You can now also access distance and granular sleep data.
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://developers.google.com/fit/android/get-started.html#step_5_connect_to_the_fitness_service"
|
||||||
|
class="external-link">Fit API developer guide</a></li>
|
||||||
|
<li><a href="{@docRoot}reference/com/google/android/gms/fitness/package-summary.html">
|
||||||
|
Fit API reference</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><strong>Google Mobile Ads</strong> - This release introduces the
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/ads/doubleclick/PublisherAdRequest.Builder.html#addCustomTargeting(java.lang.String,%20java.lang.String)">
|
||||||
|
{@code addCustomTargeting()}</a>
|
||||||
|
and <a href="{@docRoot}reference/com/google/android/gms/ads/doubleclick/PublisherAdRequest.Builder.html#addCategoryExclusion(java.lang.String)">
|
||||||
|
{@code addCategoryExclusion()}</a>
|
||||||
|
methods to the <a href="{@docRoot}reference/com/google/android/gms/ads/doubleclick/PublisherAdRequest.Builder.html">
|
||||||
|
{@code PublisherAdRequest.Builder} </a>
|
||||||
|
class, enabling DoubleClick for Publishers (DFP) developers to
|
||||||
|
<a href="https://support.google.com/dfp_sb/answer/112648" class="external-link">target custom
|
||||||
|
criteria</a>
|
||||||
|
and <a href="https://support.google.com/dfp_premium/answer/2627086" class="external-link">use
|
||||||
|
ad exclusions to block ads</a>.
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://developers.google.com/mobile-ads-sdk/docs/dfp/android/banner"
|
||||||
|
class="external-link">DFP targeting developer guide</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><strong>Play Game services</strong> - The Nearby Connections API allows users to connect to
|
||||||
|
each other and exchange messages over a local network. This API supports local multiplayer
|
||||||
|
and second screen gaming.
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://developers.google.com/games/services/android/nearby.html"
|
||||||
|
class="external-link">Nearby Connections developer guide</a></li>
|
||||||
|
<li><a href="{@docRoot}reference/com/google/android/gms/nearby/connection/package-summary.html">
|
||||||
|
Nearby Connection API reference</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><strong>Google API client</strong> - This release introduces the
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html#requestServerAuthCode(java.lang.String,%20com.google.android.gms.common.api.GoogleApiClient.ServerAuthCodeCallbacks)">{@code GoogleApiClient.Builder.requestServerAuthCode()}</a> method. This API makes it significantly easier
|
||||||
|
to enable servers to be able to make Google API calls on behalf of users. This method reduces
|
||||||
|
the lines of boilerplate code that you previously had to implement.
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://developers.google.com/identity/sign-in/android/sign-in.html#enable_server-side_api_access_for_your_app"
|
||||||
|
class="external-link">Server-side API access developer guide</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Drive</strong> - This release adds
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/drive/DriveResource.html#trash(com.google.android.gms.common.api.GoogleApiClient))">
|
||||||
|
{@code trash()}</a> and
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/drive/DriveResource.html#untrash(com.google.android.gms.common.api.GoogleApiClient)">
|
||||||
|
{@code untrash()}</a> methods to the
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/drive/DriveResource.html">
|
||||||
|
{@code DriveResource}</a>
|
||||||
|
class. These methods enable you to move user-visible files and folders to the trash or
|
||||||
|
restore them from the trash. Trashing a folder recursively trashes its children. The
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/drive/Metadata.html#isExplicitlyTrashed()">
|
||||||
|
{@code isExplicitlyTrashed()}</a> method indicates whether a resource was trashed directly,
|
||||||
|
or as the result of a trashed parent.
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://developers.google.com/drive/android/trash.html"
|
||||||
|
class="external-link">Trashing and untrashing developer guide</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><strong>SafetyNet API</strong> - The API lets you check if your app is running on a device
|
||||||
|
that matches a device model that has passed Android compatibility testing. The API evaluates
|
||||||
|
both software and hardware characteristics of a device to determine whether it matches a
|
||||||
|
known-good configuration that has been previously determined to be compatible. You can use the
|
||||||
|
SafetyNet API in conjunction with other tools to determine whether the device appears capable
|
||||||
|
of handling specific features in your app.
|
||||||
|
<ul>
|
||||||
|
<li><a href="{@docRoot}reference/com/google/android/gms/safetynet/package-summary.html">
|
||||||
|
SafetyNet API reference</a></li>
|
||||||
|
<li><a href="{@docRoot}google/play/safetynet/index.html">
|
||||||
|
SafetyNet developer guide</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="toggle-content closed">
|
||||||
|
<p><a href="#" onclick="return toggleContent(this)">
|
||||||
|
<img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
|
||||||
alt=""/>Google Play services, Version 6.5</a> <em>(December 2014)</em>
|
alt=""/>Google Play services, Version 6.5</a> <em>(December 2014)</em>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -154,6 +270,8 @@ enables you to get a ready-to-use Street View panorama.
|
|||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="toggle-content closed">
|
<div class="toggle-content closed">
|
||||||
<p><a href="#" onclick="return toggleContent(this)">
|
<p><a href="#" onclick="return toggleContent(this)">
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ apply plugin: 'com.android.application'
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.android.support:appcompat-v7:21.0.3'
|
compile 'com.android.support:appcompat-v7:21.0.3'
|
||||||
<strong>compile 'com.google.android.gms:play-services:6.5.87'</strong>
|
<strong>compile 'com.google.android.gms:play-services:7.0.0'</strong>
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
<p>Be sure you update this version number each time Google Play services is updated.</p>
|
<p>Be sure you update this version number each time Google Play services is updated.</p>
|
||||||
@@ -106,14 +106,14 @@ example, to include only the Google Fit and Android Wear APIs, replace the follo
|
|||||||
<code>build.gradle</code> file:</p>
|
<code>build.gradle</code> file:</p>
|
||||||
|
|
||||||
<pre class="no-pretty-print">
|
<pre class="no-pretty-print">
|
||||||
compile 'com.google.android.gms:play-services:6.5.87'
|
compile 'com.google.android.gms:play-services:7.0.0'
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>with these lines:</p>
|
<p>with these lines:</p>
|
||||||
|
|
||||||
<pre class="no-pretty-print">
|
<pre class="no-pretty-print">
|
||||||
compile 'com.google.android.gms:play-services-fitness:6.5.87'
|
compile 'com.google.android.gms:play-services-fitness:7.0.0'
|
||||||
compile 'com.google.android.gms:play-services-wearable:6.5.87'
|
compile 'com.google.android.gms:play-services-wearable:7.0.0'
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>Table 1 shows a list of the separate APIs that you can include when compiling your app, and
|
<p>Table 1 shows a list of the separate APIs that you can include when compiling your app, and
|
||||||
@@ -131,65 +131,76 @@ you include an API that does have a separate library.)</p>
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google+</td>
|
<td>Google+</td>
|
||||||
<td>com.google.android.gms:play-services-plus:6.5.87</td>
|
<td>com.google.android.gms:play-services-plus:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Account Login</td>
|
<td>Google Account Login</td>
|
||||||
<td>com.google.android.gms:play-services-identity:6.5.87</td>
|
<td>com.google.android.gms:play-services-identity:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Activity Recognition</td>
|
<td>Google Actions, Base Client Library</td>
|
||||||
<td>com.google.android.gms:play-services-location:6.5.87</td>
|
<td>com.google.android.gms:play-services-base:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google App Indexing</td>
|
<td>Google App Indexing</td>
|
||||||
<td>com.google.android.gms:play-services-appindexing:6.5.87</td>
|
<td>com.google.android.gms:play-services-appindexing:7.0.0</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Google Analytics</td>
|
||||||
|
<td>com.google.android.gms:play-services-analytics:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Cast</td>
|
<td>Google Cast</td>
|
||||||
<td>com.google.android.gms:play-services-cast:6.5.87</td>
|
<td>com.google.android.gms:play-services-cast:7.0.0</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Google Cloud Messaging</td>
|
||||||
|
<td>com.google.android.gms:play-services-gcm:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Drive</td>
|
<td>Google Drive</td>
|
||||||
<td>com.google.android.gms:play-services-drive:6.5.87</td>
|
<td>com.google.android.gms:play-services-drive:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Fit</td>
|
<td>Google Fit</td>
|
||||||
<td>com.google.android.gms:play-services-fitness:6.5.87</td>
|
<td>com.google.android.gms:play-services-fitness:7.0.0</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Google Location, Activity Recognition, and Places</td>
|
||||||
|
<td>com.google.android.gms:play-services-location:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Maps</td>
|
<td>Google Maps</td>
|
||||||
<td>com.google.android.gms:play-services-maps:6.5.87</td>
|
<td>com.google.android.gms:play-services-maps:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Mobile Ads</td>
|
<td>Google Mobile Ads</td>
|
||||||
<td>com.google.android.gms:play-services-ads:6.5.87</td>
|
<td>com.google.android.gms:play-services-ads:7.0.0</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Google Nearby</td>
|
||||||
|
<td>com.google.android.gms:play-services-nearby:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Panorama Viewer</td>
|
<td>Google Panorama Viewer</td>
|
||||||
<td>com.google.android.gms:play-services-panorama:6.5.87</td>
|
<td>com.google.android.gms:play-services-panorama:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Play Game services</td>
|
<td>Google Play Game services</td>
|
||||||
<td>com.google.android.gms:play-services-games:6.5.87</td>
|
<td>com.google.android.gms:play-services-games:7.0.0</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>SafetyNet</td>
|
||||||
|
<td>com.google.android.gms:play-services-safetynet:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Google Wallet</td>
|
<td>Google Wallet</td>
|
||||||
<td>com.google.android.gms:play-services-wallet:6.5.87</td>
|
<td>com.google.android.gms:play-services-wallet:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Android Wear</td>
|
<td>Android Wear</td>
|
||||||
<td>com.google.android.gms:play-services-wearable:6.5.87</td>
|
<td>com.google.android.gms:play-services-wearable:7.0.0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
Google Actions<br>
|
|
||||||
Google Analytics<br>
|
|
||||||
Google Cloud Messaging<br>
|
|
||||||
</td>
|
|
||||||
<td>com.google.android.gms:play-services-base:6.5.87</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div><!-- end studio -->
|
</div><!-- end studio -->
|
||||||
@@ -199,13 +210,14 @@ you include an API that does have a separate library.)</p>
|
|||||||
<p>To make the Google Play services APIs available to your app:</p>
|
<p>To make the Google Play services APIs available to your app:</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Copy the library project at
|
<li>Copy the library project at
|
||||||
<code><android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/</code>
|
{@code <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/}
|
||||||
to the location where you maintain your Android app projects.</li>
|
to the location where you maintain your Android app projects.</li>
|
||||||
<li>Import the library project into your Eclipse workspace. Click
|
<li>Import the library project into your Eclipse workspace. Click
|
||||||
<b>File > Import</b>, select <b>Android > Existing Android Code into
|
<b>File > Import</b>, select <b>Android > Existing Android Code into
|
||||||
Workspace</b>, and browse to the copy of the library project to import it.</li>
|
Workspace</b>, and browse to the copy of the library project to import it.</li>
|
||||||
<li>In your app project, reference Google Play services library project. See
|
<li>In your app project, reference Google Play services library project. See
|
||||||
<a href="{@docRoot}tools/projects/projects-eclipse.html#ReferencingLibraryProject">Referencing a Library Project for Eclipse</a> for more information on how to
|
<a href="{@docRoot}tools/projects/projects-eclipse.html#ReferencingLibraryProject">
|
||||||
|
Referencing a Library Project for Eclipse</a> for more information on how to
|
||||||
do this.
|
do this.
|
||||||
<p class="note"><strong>Note:</strong> You should be referencing a copy of the
|
<p class="note"><strong>Note:</strong> You should be referencing a copy of the
|
||||||
library that you copied to your development workspace—you should not
|
library that you copied to your development workspace—you should not
|
||||||
@@ -232,7 +244,9 @@ you can begin developing features with the
|
|||||||
|
|
||||||
<p>To make the Google Play services APIs available to your app:</p>
|
<p>To make the Google Play services APIs available to your app:</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Copy the library project at <code><android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/</code> to the location where you maintain your Android app projects.</li>
|
<li>Copy the library project at
|
||||||
|
{@code <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/}
|
||||||
|
to the location where you maintain your Android app projects.</li>
|
||||||
|
|
||||||
<li>In your app project, reference the Google Play services library project. See
|
<li>In your app project, reference the Google Play services library project. See
|
||||||
<a href="{@docRoot}tools/projects/projects-cmdline.html#ReferencingLibraryProject">Referencing
|
<a href="{@docRoot}tools/projects/projects-cmdline.html#ReferencingLibraryProject">Referencing
|
||||||
@@ -244,7 +258,8 @@ workspace—you should not reference the library directly from the Android S
|
|||||||
<li>After you've added the Google Play services library as a dependency for
|
<li>After you've added the Google Play services library as a dependency for
|
||||||
your app project, open your app's manifest file and add the following tag as
|
your app project, open your app's manifest file and add the following tag as
|
||||||
a child of the
|
a child of the
|
||||||
<a href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a> element:
|
<a href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
|
||||||
|
element:
|
||||||
<pre>
|
<pre>
|
||||||
<meta-data android:name="com.google.android.gms.version"
|
<meta-data android:name="com.google.android.gms.version"
|
||||||
android:value="@integer/google_play_services_version" />
|
android:value="@integer/google_play_services_version" />
|
||||||
@@ -302,23 +317,39 @@ perform API transactions.</p>
|
|||||||
<strong>Important:</strong>
|
<strong>Important:</strong>
|
||||||
Because it is hard to anticipate the state of each device, you must <em>always</em> check for a
|
Because it is hard to anticipate the state of each device, you must <em>always</em> check for a
|
||||||
compatible Google Play services APK before you access Google Play services
|
compatible Google Play services APK before you access Google Play services
|
||||||
features. For many apps, the best time to check is during the
|
features.
|
||||||
{@link android.app.Activity#onResume onResume()} method of the main activity.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>The Google Play services library includes utility methods that help you determine whether or not
|
|
||||||
the Google Play services version on the device supports the version of the client library you are
|
|
||||||
using. If the version on the device is too old, the system will take the user to Google Play Store
|
|
||||||
in order to install the recent version of the Google Play services.</p>
|
|
||||||
|
|
||||||
<p>Because each app uses Google Play services differently, it's up to you decide the appropriate
|
<p>Because each app uses Google Play services differently, it's up to you decide the appropriate
|
||||||
place in your app to check verify the Google Play services version. For example, if Google Play
|
place in your app to verify the Google Play services version. For example, if Google Play
|
||||||
services is required for your app at all times, you might want to do it when your app first
|
services is required for your app at all times, you might want to do it when your app first
|
||||||
launches. On the other hand, if Google Play services is an optional part of your app, you can check
|
launches. On the other hand, if Google Play services is an optional part of your app, you can check
|
||||||
the version only once the user navigates to that portion of your app.</p>
|
the version only once the user navigates to that portion of your app.</p>
|
||||||
|
|
||||||
<p>To verify the Google Play services version, call <a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#isGooglePlayServicesAvailable(android.content.Context)"
|
<p>You are strongly encouraged to use the
|
||||||
>{@code isGooglePlayServicesAvailable()}</a>. If the result code is
|
<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">
|
||||||
|
{@code GoogleApiClient}</a> class to access Google Play services features. This approach allows
|
||||||
|
you to attach an
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.OnConnectionFailedListener.html">
|
||||||
|
{@code OnConnectionFailedListener}</a> object to your client.
|
||||||
|
To detect if the device has the appropriate version of the Google Play services APK, implement the
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.OnConnectionFailedListener.html#onConnectionFailed(com.google.android.gms.common.ConnectionResult)">
|
||||||
|
{@code onConnectionFailed()}</a>
|
||||||
|
callback method. If the connection fails due to a missing or out-of-date version of
|
||||||
|
the Google Play APK, the callback receives an error code such as
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_MISSING">
|
||||||
|
{@code SERVICE_MISSING}</a>,
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_VERSION_UPDATE_REQUIRED">
|
||||||
|
{@code SERVICE_VERSION_UPDATE_REQUIRED}</a>, or
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_DISABLED">
|
||||||
|
{@code SERVICE_DISABLED}</a>. To learn more about how to build your client and handle such
|
||||||
|
connection errors, see <a href="{@docRoot}google/auth/api-client.html">Accessing Google APIs</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>Another approach is to use the
|
||||||
|
<a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#isGooglePlayServicesAvailable(android.content.Context)"
|
||||||
|
>{@code isGooglePlayServicesAvailable()}</a> method. You might call this method in the
|
||||||
|
{@link android.app.Activity#onResume onResume()} method of the main activity. If the result code is
|
||||||
<a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SUCCESS"
|
<a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SUCCESS"
|
||||||
>{@code SUCCESS}</a>,
|
>{@code SUCCESS}</a>,
|
||||||
then the Google Play services APK is up-to-date and you can continue to make a connection.
|
then the Google Play services APK is up-to-date and you can continue to make a connection.
|
||||||
@@ -329,12 +360,11 @@ If, however, the result code is
|
|||||||
>{@code SERVICE_VERSION_UPDATE_REQUIRED}</a>,
|
>{@code SERVICE_VERSION_UPDATE_REQUIRED}</a>,
|
||||||
or
|
or
|
||||||
<a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_DISABLED"
|
<a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_DISABLED"
|
||||||
>{@code SERVICE_DISABLED}</a>, then the user needs to install an update. So,
|
>{@code SERVICE_DISABLED}</a>, then the user needs to install an update. In this case, call the
|
||||||
call <a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getErrorDialog(int, android.app.Activity, int)"
|
<a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getErrorDialog(int, android.app.Activity, int)">
|
||||||
>{@code GooglePlayServicesUtil.getErrorDialog()}</a> and pass it the result error code.
|
{@code getErrorDialog()}</a> method and pass it the result error code. The method returns a
|
||||||
This returns a {@link android.app.Dialog} you should show, which provides an appropriate message
|
{@link android.app.Dialog} you should show, which provides an appropriate message about the error
|
||||||
about the error and provides an action
|
and provides an action that takes the user to Google Play Store to install the update.</p>
|
||||||
that takes the user to Google Play Store to install the update.</p>
|
|
||||||
|
|
||||||
|
|
||||||
<p>To then begin a connection to Google Play services (required by most Google APIs such
|
<p>To then begin a connection to Google Play services (required by most Google APIs such
|
||||||
|
|||||||
Reference in New Issue
Block a user