diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd index d886454f3c996..413000fbb3ada 100644 --- a/docs/html/google/play-services/setup.jd +++ b/docs/html/google/play-services/setup.jd @@ -43,8 +43,8 @@ to Adding SDK Packages

@@ -60,27 +60,23 @@ to
Adding SDK PackagesBuilding Your Project with Gradle for more information about Gradle.

  • Add a new build rule under dependencies for the latest version of - play-services. -

    For example, for mobile modules:

    +play-services. For example:
     apply plugin: 'android'
     ...
     
     dependencies {
         compile 'com.android.support:appcompat-v7:20.+'
    -    compile 'com.google.android.gms:play-services:6.1.+'
    +    compile 'com.google.android.gms:play-services:6.5.+'
     }
     
    -

    For wearable modules:

    -
    -apply plugin: 'android'
    -...
    +

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

    +

    Note: If the number of method references in your app exceeds the +65K limit, your app may fail to compile. You +may be able to mitigate this problem when compiling your app by specifying only the specific Google +Play services APIs your app uses, instead of all of them. For information on how to do this, +see Selectively compiling APIs into your executable. -dependencies { - compile 'com.google.android.gms:play-services-wearable:6.1.+' -} -

    -

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

  • Save the changes and click Sync Project with Gradle Files @@ -99,13 +95,112 @@ element:

    You can now begin developing features with the Google Play services APIs.

    +

    Selectively compiling APIs into your executable

    + +

    In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs +into your app. In some cases, doing so made it more difficult to keep the number of methods +in your app (including framework APIs, library methods, and your own code) under the 65,536 limit.

    + +

    From version 6.5, you can instead selectively compile Google Play service APIs into your app. For +example, to include only the Google Fit and Android Wear APIs, replace the following line in your +build.gradle file:

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

    with these lines:

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

    Table 1 shows a list of the separate APIs that you can include when compiling your app, and +how to describe them in your build.gradle file. Some APIs do not have a separate +library; include them by including the base library. (This lib is automatically included when +you include an API that does have a separate library.)

    + +

    +Table 1. Individual APIs and corresponding build.gradle descriptions.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Google Play services APIDescription in build.gradle
    Google+com.google.android.gms:play-services-plus:6.5.+
    Google Account Logincom.google.android.gms:play-services-identity:6.5.+
    Google Activity Recognitioncom.google.android.gms:play-services-location:6.5.+
    Google App Indexingcom.google.android.gms:play-services-appindexing:6.5.+
    Google Castcom.google.android.gms:play-services-cast:6.5.+
    Google Drivecom.google.android.gms:play-services-drive:6.5.+
    Google Fitcom.google.android.gms:play-services-fitness:6.5.+
    Google Mapscom.google.android.gms:play-services-maps:6.5.+
    Google Mobile Adscom.google.android.gms:play-services-ads:6.5.+
    Google Panorama Viewercom.google.android.gms:play-services-panorama:6.5.+
    Google Play Game servicescom.google.android.gms:play-services-games:6.5.+
    Google Walletcom.google.android.gms:play-services-wallet:6.5.+
    Android Wearcom.google.android.gms:play-services-wearable:6.5.+
    + Google Actions
    + Google Analytics
    + Google Cloud Messaging
    +
    com.google.android.gms:play-services-base:6.5.+
    +

    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 + <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ + to the location where you maintain your Android app projects.
    4. 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.
    5. @@ -189,7 +284,7 @@ required classes, add the following lines in the

      Note: When using Android Studio, you must add Proguard -to your gradle.build file's build types. For more information, see the +to your build.gradle file's build types. For more information, see the Gradle Plugin User Guide.