From 61bfeafdef448a649aa210a4816df84a0a58b92a Mon Sep 17 00:00:00 2001 From: Joe Fernandez Date: Thu, 19 Mar 2015 16:38:05 +0000 Subject: 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."" This reverts commit 2a867108951807e467dbfe0fcd4cc48a4d7f4191. Change-Id: Ib91bf437e952e8a91f20afc63332b88952527ca4 --- docs/html/google/auth/api-client.jd | 28 +++---- docs/html/google/play-services/index.jd | 124 ++++++++++++++++++++++++++++++- docs/html/google/play-services/setup.jd | 126 ++++++++++++++++++++------------ 3 files changed, 213 insertions(+), 65 deletions(-) (limited to 'docs/html') diff --git a/docs/html/google/auth/api-client.jd b/docs/html/google/auth/api-client.jd index a0836d1..e33721d 100644 --- a/docs/html/google/auth/api-client.jd +++ b/docs/html/google/auth/api-client.jd @@ -52,8 +52,7 @@ for REST APIs.

Note: If you have an existing app that connects to Google Play services with a -subclass of {@code GooglePlayServicesClient}, you should migrate to {@code GoogleApiClient} as soon as possible.

@@ -133,7 +132,9 @@ succeeds, fails, or becomes suspended.

API Client:

-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 android.support.v4.app.FragmentActivity;
 
@@ -206,20 +207,18 @@ href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html
 
 

However, if you run this code, there's a good chance it will fail and your app will receive a call to {@code onConnectionFailed()} with the {@code SIGN_IN_REQUIRED} error because the user account has not been specified. The next section shows how to handle this error and others.

- -

Handle connection failures

-

When you receive a call to the {@code onConnectionFailed()} callback, you should call When you receive a call to the + +{@code onConnectionFailed()} callback, you should call {@code hasResolution()} on the provided -

For example, your For example, your +{@code onConnectionFailed()} callback method should now look like this:

@@ -365,9 +365,9 @@ if retained across activity instances, though. The next section explains further
 
 

Maintain state while resolving an error

-

To avoid executing the code in {@code onConnectionFailed()} while a previous attempt to resolve an +

To avoid executing the code in + +{@code onConnectionFailed()} while a previous attempt to resolve an error is ongoing, you need to retain a boolean that tracks whether your app is already attempting to resolve an error.

diff --git a/docs/html/google/play-services/index.jd b/docs/html/google/play-services/index.jd index 0b1bdd9..3d0f7f6 100644 --- a/docs/html/google/play-services/index.jd +++ b/docs/html/google/play-services/index.jd @@ -52,11 +52,8 @@ your app with the most recent version of Google Play services without worrying about your users' Android version.

- -

To start integrating Google Play services into your app, follow the Setup guide.

-

New Features

@@ -65,6 +62,125 @@ about your users' Android version.

Google Play services, Version 7.0 (March 2015) +

+ +
+
+
Highlights in Version 7.0
+
+

For a summary of the feature highlights in Google Play services 7.0, see the +announcement +blog post.

+ +
+
+
+ + +
+

+ Google Play services, Version 6.5 (December 2014)

@@ -154,6 +270,8 @@ enables you to get a ready-to-use Street View panorama. +
+

Be sure you update this version number each time Google Play services is updated.

@@ -106,14 +106,14 @@ example, to include only the Google Fit and Android Wear APIs, replace the follo build.gradle file:

-compile 'com.google.android.gms:play-services:6.5.87'
+compile 'com.google.android.gms:play-services:7.0.0'
 

with these lines:

-compile 'com.google.android.gms:play-services-fitness:6.5.87'
-compile 'com.google.android.gms:play-services-wearable:6.5.87'
+compile 'com.google.android.gms:play-services-fitness:7.0.0'
+compile 'com.google.android.gms:play-services-wearable:7.0.0'
 

Table 1 shows a list of the separate APIs that you can include when compiling your app, and @@ -129,67 +129,78 @@ you include an API that does have a separate library.)

Google Play services API Description in build.gradle - + Google+ - com.google.android.gms:play-services-plus:6.5.87 + com.google.android.gms:play-services-plus:7.0.0 Google Account Login - com.google.android.gms:play-services-identity:6.5.87 + com.google.android.gms:play-services-identity:7.0.0 - Google Activity Recognition - com.google.android.gms:play-services-location:6.5.87 + Google Actions, Base Client Library + com.google.android.gms:play-services-base:7.0.0 Google App Indexing - com.google.android.gms:play-services-appindexing:6.5.87 + com.google.android.gms:play-services-appindexing:7.0.0 + + + Google Analytics + com.google.android.gms:play-services-analytics:7.0.0 Google Cast - com.google.android.gms:play-services-cast:6.5.87 + com.google.android.gms:play-services-cast:7.0.0 + + + Google Cloud Messaging + com.google.android.gms:play-services-gcm:7.0.0 Google Drive - com.google.android.gms:play-services-drive:6.5.87 + com.google.android.gms:play-services-drive:7.0.0 Google Fit - com.google.android.gms:play-services-fitness:6.5.87 + com.google.android.gms:play-services-fitness:7.0.0 + + + Google Location, Activity Recognition, and Places + com.google.android.gms:play-services-location:7.0.0 Google Maps - com.google.android.gms:play-services-maps:6.5.87 + com.google.android.gms:play-services-maps:7.0.0 Google Mobile Ads - com.google.android.gms:play-services-ads:6.5.87 + com.google.android.gms:play-services-ads:7.0.0 + + + Google Nearby + com.google.android.gms:play-services-nearby:7.0.0 Google Panorama Viewer - com.google.android.gms:play-services-panorama:6.5.87 + com.google.android.gms:play-services-panorama:7.0.0 Google Play Game services - com.google.android.gms:play-services-games:6.5.87 + com.google.android.gms:play-services-games:7.0.0 + + + SafetyNet + com.google.android.gms:play-services-safetynet:7.0.0 Google Wallet - com.google.android.gms:play-services-wallet:6.5.87 + com.google.android.gms:play-services-wallet:7.0.0 Android Wear - com.google.android.gms:play-services-wearable:6.5.87 + com.google.android.gms:play-services-wearable:7.0.0 - - - Google Actions
- Google Analytics
- Google Cloud Messaging
- - com.google.android.gms:play-services-base:6.5.87 - - @@ -199,13 +210,14 @@ you include an API that does have a separate library.)

To make the Google Play services APIs available to your app:

  1. Copy the library project at - <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ +{@code <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/} to the location where you maintain your Android app projects.
  2. Import the library project into your Eclipse workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
  3. In your app project, reference Google Play services library project. See - Referencing a Library Project for Eclipse for more information on how to + + Referencing a Library Project for Eclipse for more information on how to do this.

    Note: You should be referencing a copy of the library that you copied to your development workspace—you should not @@ -232,7 +244,9 @@ you can begin developing features with the

    To make the Google Play services APIs available to your app:

      -
    1. Copy the library project at <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ to the location where you maintain your Android app projects.
    2. +
    3. 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.
    4. In your app project, reference the Google Play services library project. See Referencing @@ -244,7 +258,8 @@ workspace—you should not reference the library directly from the Android S
    5. 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 a child of the - {@code <application>} element: + {@code <application>} + element:
       <meta-data android:name="com.google.android.gms.version"
               android:value="@integer/google_play_services_version" />
      @@ -302,23 +317,39 @@ perform API transactions.

      Important: Because it is hard to anticipate the state of each device, you must always check for a compatible Google Play services APK before you access Google Play services - features. For many apps, the best time to check is during the - {@link android.app.Activity#onResume onResume()} method of the main activity. + features.

      -

      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.

      -

      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 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.

      -

      To verify the Google Play services version, call {@code isGooglePlayServicesAvailable()}. If the result code is +

      You are strongly encouraged to use the + +{@code GoogleApiClient} class to access Google Play services features. This approach allows +you to attach an + +{@code OnConnectionFailedListener} object to your client. +To detect if the device has the appropriate version of the Google Play services APK, implement the + +{@code onConnectionFailed()} +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 + +{@code SERVICE_MISSING}, + +{@code SERVICE_VERSION_UPDATE_REQUIRED}, or + +{@code SERVICE_DISABLED}. To learn more about how to build your client and handle such +connection errors, see Accessing Google APIs. +

      + +

      Another approach is to use the +{@code isGooglePlayServicesAvailable()} method. You might call this method in the +{@link android.app.Activity#onResume onResume()} method of the main activity. If the result code is {@code SUCCESS}, 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}, or {@code SERVICE_DISABLED}, then the user needs to install an update. So, - call {@code GooglePlayServicesUtil.getErrorDialog()} and pass it the result error code. -This returns a {@link android.app.Dialog} you should show, which provides an appropriate message -about the error and provides an action -that takes the user to Google Play Store to install the update.

      +>{@code SERVICE_DISABLED}, then the user needs to install an update. In this case, call the + +{@code getErrorDialog()} method and pass it the result error code. The method returns a +{@link android.app.Dialog} you should show, which provides an appropriate message about the error +and provides an action that takes the user to Google Play Store to install the update.

      To then begin a connection to Google Play services (required by most Google APIs such -- cgit v1.1