diff options
author | Scott Main <smain@google.com> | 2012-12-03 00:22:23 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-12-03 00:22:23 -0800 |
commit | fbcb624be82e184482b547b09765a03db2305039 (patch) | |
tree | dfb682ea52fa9c729367d43d1f3003f278fcbd9e /docs | |
parent | b00e37de181dc2f816962bc9301f64dd2a773c2a (diff) | |
parent | e36276ad976d77b53f1108277f40eca3eb5d5bee (diff) | |
download | frameworks_base-fbcb624be82e184482b547b09765a03db2305039.zip frameworks_base-fbcb624be82e184482b547b09765a03db2305039.tar.gz frameworks_base-fbcb624be82e184482b547b09765a03db2305039.tar.bz2 |
Merge "docs: update reference links and misc revisions" into jb-mr1-dev
Diffstat (limited to 'docs')
-rw-r--r-- | docs/html/google/index.jd | 37 | ||||
-rw-r--r-- | docs/html/google/play-services/analytics.jd | 56 | ||||
-rw-r--r-- | docs/html/google/play-services/auth.jd | 92 | ||||
-rw-r--r-- | docs/html/google/play-services/maps.jd | 14 | ||||
-rw-r--r-- | docs/html/google/play-services/plus.jd | 12 | ||||
-rw-r--r-- | docs/html/google/play-services/setup.jd | 85 |
6 files changed, 139 insertions, 157 deletions
diff --git a/docs/html/google/index.jd b/docs/html/google/index.jd index dd6e278..e2f8f9d 100644 --- a/docs/html/google/index.jd +++ b/docs/html/google/index.jd @@ -25,8 +25,9 @@ div.cell-icon img { <h1 itemprop="name" style="margin-bottom:0;">Google Services</h1> <p itemprop="description">Google offers a variety of services that help you -enhance your app's capabilities, build new revenue streams, manage app distribution, -and track app usage.</p> +build new revenue streams, manage app distribution, +track app usage, and enhance your app with features such as maps, sign-in, and +cloud messaging.</p> <p>Because these services are offered directly by Google, they're not included in the Android platform. Some are provided by the Google Play service available on devices with Google Play, @@ -43,34 +44,34 @@ and track app usage.</p> <div class="landing-cell"> <div class="cell-icon"> - <img src="{@docRoot}images/google/maps-pin.png"> + <img src="{@docRoot}images/google/maps-pin.png" width="40" > </div> <h4><a href="{@docRoot}google/play-services/maps.html" >Google Maps</a></h4> <p>The power of Google Maps is available to your app with an embeddable map view. You can customize the map with - markers and overlays, control the user's perspective, animate the camera, and much more.</p> + markers and overlays, control the user's perspective, draw lines + and shapes, and much more.</p> </div> <div class="landing-cell"> <div class="cell-icon"> - <img src="{@docRoot}images/google/plus-one.png"> + <img src="{@docRoot}images/google/plus-one.png" width="40" > </div> <h4><a href="{@docRoot}google/play-services/plus.html" >Google+</a></h4> - <p>Authenticate your users by allowing them to sign in with Google+. - Provide +1 buttons that allow users to recommend your app content and build customized - content for posts on Google+.</p> + <p>Authenticate users and allow them to sign in, add +1 buttons so users can + recommend your app content, and allow them to share your content on Google+.</p> </div> <div class="landing-cell"> <div class="cell-icon"> - <img src="{@docRoot}images/google/gcm-cloud.png"> + <img src="{@docRoot}images/google/gcm-cloud.png" width="40" > </div> <h4><a href="{@docRoot}google/gcm/index.html" >Google Cloud Messaging</a></h4> - <p>Keep your users connected by delivering events with - lightweight messages immediately from your web server. There are no quotas or charges + <p>Immediately notify your users about timely events by delivering + lightweight messages from your web server. There are no quotas or charges to use Google Cloud Messaging.</p> </div> @@ -83,7 +84,7 @@ and track app usage.</p> <div class="landing-cell"> <div class="cell-icon"> - <img src="{@docRoot}images/google/iab-99c.png" /> + <img src="{@docRoot}images/google/iab-99c.png" width="40" /> </div> <h4><a href="{@docRoot}google/play/billing/index.html" >Google Play In-App Billing</a></h4> @@ -95,24 +96,26 @@ and track app usage.</p> <div class="landing-cell"> <div class="cell-icon"> -<img src="{@docRoot}images/google/analytics.png" /> +<img src="{@docRoot}images/google/analytics.png" width="40" /> </div> <h4><a class="external-link" href="https://developers.google.com/analytics/devguides/collection/android/v2/" >Google Analytics</a></h4> -<p>Measure your success and gain deeper insights into how mobile users engage with your content -by integrating Google Analytics with your app.</p> +<p>Measure your success and gain insights into how users engage with your app content +by integrating Google Analytics. You can track in-app purchases, the number of active users, +interaction patterns, and much more. +</p> </div> <div class="landing-cell"> <div class="cell-icon"> - <img src="{@docRoot}images/google/admob-money.png" /> + <img src="{@docRoot}images/google/admob-money.png" width="40" /> </div> <h4><a class="external-link" href="https://developers.google.com/mobile-ads-sdk/" >Google AdMob Ads</a></h4> <p>Display ads from AdMob offer you an alternative revenue opportunity that leverages - multiple ad networks. + multiple ad networks with targeted ads and several display formats. </p> </div> diff --git a/docs/html/google/play-services/analytics.jd b/docs/html/google/play-services/analytics.jd deleted file mode 100644 index df93cbe..0000000 --- a/docs/html/google/play-services/analytics.jd +++ /dev/null @@ -1,56 +0,0 @@ -page.title=Google Analytics -page.landing=true -page.landing.intro=The Google Analytics Platform lets you measure user interactions with your business across various devices and environments. The platform provides all the computing resources to collect, store, process, and report on these user-interactions. -page.landing.link=https://developers.google.com/analytics/devguides/collection/android/v2/ -page.landing.link.text=developers.google.com/analytics -page.landing.image=images/gps-analytics.png - -@jd:body - -<div class="landing-docs"> - <div class="col-6"> - <h3 style="clear:left">Key Developer Features</h3> - - <a href="https://developers.google.com/analytics/devguides/collection/android/v2/campaigns"> - <h4>Discover user geography and habits</h4> - Discover where your users are coming from and how they are accessing your app, - from the moment they download your app from the Google Play Store.</a> - - <a href="https://developers.google.com/analytics/devguides/collection/android/v2/ecommerce"> - <h4>Track monetization performance</h4> - Monitor the success of mobile marketing campaigns by taking advantage of the end-to-end visibility - into the performance of your in-app purchases and transactions. - </a> - - <a href="https://developers.google.com/analytics/devguides/collection/android/v2/screens"> - <h4>Monitor app usage</h4> - Record data about the screens your users are viewing in your app and gain insight - on what features they use most. All of this information can help you pinpoint specific - markets and enhance features to make your app the best it can be. - </a> - - </div> - - <div class="col-6 normal-links"> - <h3 style="clear:left">Getting Started</h3> - <h4>Get the Google Play services SDK</h4> - <p>The Google Analytics Android APIs are part of the Google Play services platform.</p> - <p><a href="{@docRoot}google/play-services/download.html">Download and configure</a> - the SDK to begin integrating Google Analytics into your app. - </p> - - <h4>Visit the Google Analytics developer site</h4> - <p>For instructions on how to fully integrate Google+ into your app, with code snippets, visit the - <a href="https://developers.google.com/analytics/devguides/collection/android/v2/">Google - Analytics developer documentation</a> located at developers.google.com. - </p> - - <h4>See the reference documentation</h4> - <p> - The <a href="{@docRoot}google/play-services/reference/com/google/android/gms/analytics/package-summary.html">Google - Analytics API reference</a> as well as the entire <a href="{@docRoot}google/play-services/reference/packages.html">Google - Play services platform reference</a> is provided for you on this site. - </p> - - </div> -</div>
\ No newline at end of file diff --git a/docs/html/google/play-services/auth.jd b/docs/html/google/play-services/auth.jd index 8787ec9..b1b19e9 100644 --- a/docs/html/google/play-services/auth.jd +++ b/docs/html/google/play-services/auth.jd @@ -5,10 +5,10 @@ page.title=Authentication <div id="qv"> <h2>In this document</h2> <ol> - <li><a href="#choose">Choosing an account</a></li> - <li><a href="#obtain">Obtaining an authorization token</a></li> - <li><a href="#handle">Handling exceptions</a></li> - <li><a href="#use">Using the token</a></li> + <li><a href="#choose">Choosing an Account</a></li> + <li><a href="#obtain">Obtaining an Authorization Token</a></li> + <li><a href="#handle">Handling Exceptions</a></li> + <li><a href="#use">Using the Token</a></li> </ol> </div> </div> @@ -31,7 +31,8 @@ to carry out these basic steps for obtaining an authentication token.</p> a valid Google account is required and it must exist on the device. You can ask your users which account they want to use by enumerating the Google accounts on the device or using the built-in -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/AccountPicker.html">AccountPicker</a> +<a href="{@docRoot}reference/com/google/android/gms/common/AccountPicker.html">{@code +AccountPicker}</a> class to display a standard account picker view. You'll need the {@link android.Manifest.permission#GET_ACCOUNTS} permission set in your manifest file for both methods. @@ -60,9 +61,12 @@ private String[] getAccountNames() { ways to get a token:</p> <ul> - <li>Call one of the two overloaded <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context, java.lang.String, java.lang.String)">GoogleAuthUtil.getToken()</a> methods in a foreground activity where you can + <li>Call one of the two overloaded <a + href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context, java.lang.String, java.lang.String)" + >{@code GoogleAuthUtil.getToken()}</a> methods in a foreground activity where you can display a dialog to the user to interactively handle authentication errors.</li> - <li>Call one of the three <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle)">getTokenWithNotification()</a> + <li>Call one of the three <a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle)" + >{@code getTokenWithNotification()}</a> methods if you are authenticating in a background service or sync adapter so that a notification is displayed if an authentication error occurs.</a></li> </ul> @@ -76,7 +80,6 @@ String mScope; String token; ... - try { token = GoogleAuthUtil.getToken(mActivity, mEmail, mScope); } catch { @@ -85,41 +88,62 @@ try { </pre> <p>Call this method off of the main UI thread since it executes network transactions. An easy way to do this - is in an <a href="http://developer.android.com/reference/android/os/AsyncTask.html">AsyncTask</a>. + is in an {@link android.os.AsyncTask}. The sample in the Google Play services SDK shows you how to wrap this call in an AsyncTask. - If authentication is successful, the token is returned. If not, the exceptions described in <a href="#handle">Handling Exceptions</a> + If authentication is successful, the token is returned. If not, the exceptions described in +<a href="#handle">Handling Exceptions</a> are thrown that you can catch and handle appropriately. </p> <h3>Using getTokenWithNotification()</h3> - <p>If you are obtaining authentication tokens in a background service or sync adapter, there are three overloaded <code>getTokenWithNotification()</code> methods + <p>If you are obtaining authentication tokens in a background service or sync adapter, there + are three overloaded + <a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle)" + >{@code getTokenWithNotification()}</a> methods that you can use:</p> <ul> - <li><a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle)">getTokenWithNotification(Context context, String accountName, String scope, Bundle extras)</a>: + <li><a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle)" + >{@code getTokenWithNotification(Context context, String accountName, String scope, Bundle extras)}</a>: For background services. Displays a notification to the user when authentication errors occur.</li> - <li><a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle, android.content.Intent)">getTokenWithNotification(Context context, String accountName, String scope, Bundle extras, Intent callback)</a>: - This method is for use in background services. It displays a notification to the user when authentication errors occur. If a user clicks the notification and then authorizes the app to access the account, the intent is broadcasted. When using this method: + <li><a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle, android.content.Intent)" + >{@code getTokenWithNotification(Context context, String accountName, String scope, Bundle extras, Intent callback)}</a>: + This method is for use in background services. It displays a notification to the user + when authentication errors occur. If a user clicks the notification and then authorizes the + app to access the account, the intent is broadcasted. When using this method: <ul> - <li>Create a {@link android.content.BroadcastReceiver} that registers the intent and handles it appropriately</li> - <li>In the app's manifest file, set the <code>android:exported</code> attribute to <code>true</code> for the broadcast receiver</li> - <li>Ensure that the intent is serializable using the {@link android.content.Intent#toUri toUri(Intent.URI_INTENT_SCHEME)} and + <li>Create a {@link android.content.BroadcastReceiver} that registers the intent and handles +it appropriately</li> + <li>In the app's manifest file, set the <a + href="{@docRoot}guide/topics/manifest/receiver-element.html#exported"><code>android:exported</code></a> + attribute to <code>true</code> for the broadcast receiver</li> + <li>Ensure that the intent is serializable using the {@link +android.content.Intent#toUri toUri(Intent.URI_INTENT_SCHEME)} and {@link android.content.Intent#parseUri parseUri(intentUri, Intent.URI_INTENT_SCHEME)} methods.</li> </ul> - <li><a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle, java.lang.String, android.os.Bundle)">getTokenWithNotification(Context context, String accountName, String scope, Bundle extras, String authority, Bundle syncBundle)</a>: This method is for use in sync adapters. It displays a notification to the user when authentication errors occur. If a user clicks the notification and then authorizes the app to access the account, the sync adapter retries syncing with the information + <li><a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle, java.lang.String, android.os.Bundle)" + >{@code getTokenWithNotification(Context context, String accountName, String scope, Bundle extras, String authority, Bundle syncBundle)}</a>: +This method is for use in sync adapters. It displays a notification to the user when +authentication errors occur. If a user clicks the notification and then authorizes the +app to access the account, the sync adapter retries syncing with the information contained in the <code>syncBundle</code> parameter.</li> </ul> <p>See the sample in <code><android-sdk>/extras/google-play-services/samples/auth</code> for implementation details.</p> + + + <h2 id="handle">Handling Exceptions</h2> <p> When requesting an authentication token with - <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context, java.lang.String, java.lang.String)">GoogleAuthUtil.getToken()</a>, + <a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context, java.lang.String, java.lang.String)" + >{@code GoogleAuthUtil.getToken()}</a>, the following exceptions can be thrown: </p> <ul> <li> -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/UserRecoverableAuthException.html">UserRecoverableAuthException</a>: +<a href="{@docRoot}reference/com/google/android/gms/auth/UserRecoverableAuthException.html" +>{@code UserRecoverableAuthException}</a>: This exception is thrown when an error occurs that users can resolve, such as not yet granting access to their accounts or if they changed their password. This exception class contains a {@link android.app.Activity#getIntent getIntent()} method that you can call to obtain an intent that you can use with @@ -129,8 +153,10 @@ try { callback when this activity returns to take action based on the user's actions. </li> <li> -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GooglePlayServicesAvailabilityException.html">GooglePlayServicesAvailabilityException</a>: - This exception is a special case of <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/UserRecoverableAuthException.html">UserRecoverableAuthException</a> +<a href="{@docRoot}reference/com/google/android/gms/auth/GooglePlayServicesAvailabilityException.html" +>{@code GooglePlayServicesAvailabilityException}</a>: + This exception is a special case of <a href="{@docRoot}reference/com/google/android/gms/auth/UserRecoverableAuthException.html" + >{@code UserRecoverableAuthException}</a> and occurs when the actual Google Play services APK is not installed or unavailable. This exception provides additional client support to handle and fix this issue by providing an error code that describes the exact cause of the problem. @@ -138,23 +164,31 @@ try { an activity to resolve the issue. </li> <li> -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthException.html">GoogleAuthException</a>: +<a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthException.html">{@code +GoogleAuthException}</a>: This exception is thrown when the authorization fails, such as when an invalid scope is specified or if the email address used to authenticate is actually not on the user's device. </li> <li> -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/UserRecoverableNotifiedException.html">UserRecoverableNotifiedException</a>: - This exception is thrown when the authorization fails using one of the <code>getTokenWithNotification()</code> methods and if the error +<a href="{@docRoot}reference/com/google/android/gms/auth/UserRecoverableNotifiedException.html" +>{@code UserRecoverableNotifiedException}</a>: + This exception is thrown when the authorization fails using one of the +<a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle)" + >{@code getTokenWithNotification()}</a> methods and if the error is recoverable with a user action. </li> </ul> <p> For more information on how to handle these exceptions and code snippets, see the reference documentation for the -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html">GoogleAuthUtil</a> - class. +<a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html">{@code +GoogleAuthUtil}</a> class. </p> + + + + <h2 id="use">Using the Token</h2> <p> Once you have successfully obtained a token, you can use it to access Google services. @@ -192,5 +226,7 @@ if (serverCode == 200) { Notice that you must manually invalidate the token if the response from the server signifies an authentication error (401). This could mean the authentication token being used is invalid for the service's scope or the token may have expired. If this is the - case, obtain a new token using <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context, java.lang.String, java.lang.String)">GoogleAuthUtil.getToken()</a>. + case, obtain a new token using <a +href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context, java.lang.String, java.lang.String)" +>{@code GoogleAuthUtil.getToken()}</a>. </p>
\ No newline at end of file diff --git a/docs/html/google/play-services/maps.jd b/docs/html/google/play-services/maps.jd index 69928f1..58f4c7d 100644 --- a/docs/html/google/play-services/maps.jd +++ b/docs/html/google/play-services/maps.jd @@ -17,7 +17,7 @@ header.hide=1 with <b>image overlays</b>, embed <b>one or more maps</b> as fragments, and much more.</p> <p>The <a -href="{@docRoot}google/play-services/reference/com/google/android/gms/maps/package-summary.html" +href="{@docRoot}reference/com/google/android/gms/maps/package-summary.html" >Google Maps Android API reference</a> is available here on developer.android.com, but for more information about adding maps to your app, visit:</p> <p><a class="external-link" @@ -66,21 +66,25 @@ href="https://developers.google.com/maps/documentation/android/">developers.goog </p> <h4>2. Run the sample</h4> + <p>Once you've installed the Google Play services package, the Google Maps sample is located in <code><android-sdk>/extras/google-play-services/samples/maps</code> and shows you how to use the major components of the Google Maps Android APIs. </p> <h4>3. Read the documentation</h4> + + <p>Read the <a href="https://devsite.googleplex.com/maps/terms">Google Maps + API Terms of Service</a>.</p> + <p>For quick access while developing your Android apps, the - <a href="{@docRoot}google/play-services/reference/com/google/android/gms/maps/package-summary.html">Google Maps + <a href="{@docRoot}reference/com/google/android/gms/maps/package-summary.html">Google Maps Android API reference</a> is available here on developer.android.com.</p> - <p>Extended documentation for the Google Maps Android APIs is provided with the rest of the + + <p>Detailed documentation for the Google Maps Android APIs is available with the rest of the Google Maps developer documents at <a class="external-link" href="https://developers.google.com/maps/documentation/android/">developers.google.com/maps</a>. </p> - <p>Also read the <a href="https://devsite.googleplex.com/maps/terms">Google Maps - API Terms of Service</a>.</p> </div> </div>
\ No newline at end of file diff --git a/docs/html/google/play-services/plus.jd b/docs/html/google/play-services/plus.jd index 1810843..f65abb4 100644 --- a/docs/html/google/play-services/plus.jd +++ b/docs/html/google/play-services/plus.jd @@ -18,7 +18,7 @@ header.hide=1 and allow users to <b>share rich content</b> with Google+.</p> <p>The <a -href="{@docRoot}google/play-services/reference/com/google/android/gms/plus/package-summary.html" +href="{@docRoot}reference/com/google/android/gms/plus/package-summary.html" >Google+ Android API reference</a> is available here on developer.android.com, but for more information about integrating Google+, visit:</p> <p><a class="external-link" @@ -65,13 +65,15 @@ href="https://developers.google.com/+/mobile/android/">developers.google.com/+</ </p> <h4>3. Read the documentation</h4> + <p>Read the <a href="https://developers.google.com/+/terms">Google+ Platform + Terms of Service</a>.</p> + <p>For quick access while developing your Android apps, the - <a href="{@docRoot}google/play-services/reference/com/google/android/gms/plus/package-summary.html">Google+ + <a href="{@docRoot}reference/com/google/android/gms/plus/package-summary.html">Google+ API reference</a> is available here on developer.android.com.</p> - <p>Extended documentation for the Google+ Android APIs is provided with the rest of the + + <p>Detailed documentation for the Google+ Android APIs is available with the rest of the Google+ developer documents at <a class="external-link" href="https://developers.google.com/+/mobile/android/">developers.google.com/+</a>.</p> - <p>Also read the <a href="https://developers.google.com/+/terms">Google+ Platform - Terms of Service</a>.</p> </div> </div>
\ No newline at end of file diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd index eb3618b..ec5d26f 100644 --- a/docs/html/google/play-services/setup.jd +++ b/docs/html/google/play-services/setup.jd @@ -1,26 +1,11 @@ page.title=Setup @jd:body -<div id="qv-wrapper"> - <div id="qv"> - <h2>In this document</h2> - <ol> - <li><a href="#ensure">Ensuring Devices Have the Google Play services APK</a></li> - </ol> - </div> -</div> - <p> The Google Play services SDK is an extension to the Android SDK and is available to you as a - downloadable SDK component. This download includes the client library and code samples. -</p> - -<p> - Before you get started developing, make sure that you have an updated version of the Android SDK - installed on your computer, including the SDK Tools component. If you don't have the SDK, - visit the <a href="{@docRoot}sdk/index.html">SDK Download page</a> - on the Android Developers site. + downloadable package from the <a href="{@docRoot}tools/help/sdk-manager.html">SDK + Manager</a>. The download includes the client library and code samples. </p> <p> @@ -38,14 +23,15 @@ page.title=Setup <code><android-sdk-folder>/extras/google/google_play_services/</code>. </li> <li>Copy the <code><android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib</code> - library project to a location in your project's source tree.</li> - <li>If you are using Eclipse, import the library project into your workspace. Click <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> + library project to a location in your project's source tree. + <p>If you are using Eclipse, import the library project into your workspace. Click <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.</p> </li> - <li>Reference the library project in your Android project. See the + <li>Reference the library project in your Android project. + <p>See the <a href="{@docRoot}tools/projects/projects-eclipse.html#ReferencingLibraryProject">Referencing a Library Project for Eclipse</a> or <a href="{@docRoot}tools/projects/projects-cmdline.html#ReferencingLibraryProject">Referencing a Library Project on the Command Line</a> - for more information on how to do this. + for more information on how to do this.</p> </li> <li>If you are using <a href="{@docRoot}tools/help/proguard.html">ProGuard</a>, add the following lines in the <code><project_directory>/proguard-project.txt</code> file @@ -58,19 +44,21 @@ page.title=Setup </ol> <h2 id="ensure">Ensuring Devices Have the Google Play services APK</h2> -<p> - Google Play delivers updates to the majority of the devices that support Google Play services - (Android 2.2 devices with the Google Play Store app installed). However, updates might not reach - supported devices in a timely manner, which are desribed in the following four scenarios: -<p class="note"> +<p>As described in the <a href="{@docRoot}google/play-services/index.html">Google Play services +introduction</a>, Google Play delivers service updates for users on +Android 2.2 through the Google Play Store app. However, updates might not reach +all users immediately.</p> + +<p class="caution"> <strong>Important:</strong> -<span> - Because it is hard to anticipate the state devices are in, you must <em>always</em> check for a - compatible Google Play services APK in your app when you are accessing Google Play services - features. For many apps, this is each time in the + Because it is hard to anticipate the state of each device, you must <em>always</em> check for a + compatible Google Play services APK in your app 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. -</span> </p> + +<p>Here are four scenarios that describe the possible state of the Google Play services APK on +a user's device:</p> <ol> <li> A recent version of the Google Play Store app is installed, and the most recent Google Play @@ -95,10 +83,10 @@ page.title=Setup ensure that the Google Play services APK is present, up-to-date, and enabled. </p> <p> - To help you, the Google Play services client library has utility methods to assist in - determining whether or not the Google Play services APK is recent enough to support the - version of the client library that you are using. If not, the client library sends users to the - Google Play Store to download a recent version of the Google Play services APK. + To help you, the Google Play services client library has utility methods to + determine whether or not the Google Play services APK is recent enough to support the + version of the client library you are using. If not, the client library sends users to the + Google Play Store to download the recent version of the Google Play services APK. </p> <p class="note"> @@ -121,22 +109,27 @@ page.title=Setup <ol> <li> Query for the status of Google Play services on the device with the -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/GooglePlayServicesUtil.html#isGooglePlayServicesAvailable(android.content.Context)">isGooglePlayServicesAvailable()</a> - method, which returns a result code. +<a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#isGooglePlayServicesAvailable(android.content.Context)" +>{@code isGooglePlayServicesAvailable()}</a> method, which returns a result code. </li> <li> If the result code is -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/ConnectionResult.html#SUCCESS">SUCCESS</a>, +<a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SUCCESS" +>{@code SUCCESS}</a>, then the Google Play services APK is up-to-date, and you can proceed as normal. </li> <li> - If the result is -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_MISSING">SERVICE_MISSING</a>, -<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_VERSION_UPDATE_REQUIRED">SERVICE_VERSION_UPDATE_REQUIRED</a>, + If the result code is +<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}google/play-services/reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_DISABLED">SERVICE_DISABLED</a>, - call <a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getErrorDialog(int, android.app.Activity, int)">getErrorDialog()</a> - to display an error message to the user, which will then allow the user to download the APK - from the Google Play Store or enable it in the device's system settings. +<a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_DISABLED" +>{@code SERVICE_DISABLED}</a>, then + call <a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getErrorDialog(int, android.app.Activity, int)" + >{@code getErrorDialog()}</a> + to display an error message to the user, which allows the user to download the APK + from the Google Play Store or enable it in the device's system settings. </li> </ol>
\ No newline at end of file |