From e36276ad976d77b53f1108277f40eca3eb5d5bee Mon Sep 17 00:00:00 2001 From: Scott Main Date: Sun, 2 Dec 2012 16:07:30 -0800 Subject: docs: update reference links and misc revisions Change-Id: Id198d04a4feaf9a3bdee82f1093edabed1c561d2 --- docs/html/google/index.jd | 37 ++++++------ docs/html/google/play-services/analytics.jd | 56 ------------------ docs/html/google/play-services/auth.jd | 92 ++++++++++++++++++++--------- docs/html/google/play-services/maps.jd | 14 +++-- docs/html/google/play-services/plus.jd | 12 ++-- docs/html/google/play-services/setup.jd | 85 ++++++++++++-------------- 6 files changed, 139 insertions(+), 157 deletions(-) delete mode 100644 docs/html/google/play-services/analytics.jd 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 {

Google Services

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.

+build new revenue streams, manage app distribution, +track app usage, and enhance your app with features such as maps, sign-in, and +cloud messaging.

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.

- +

Google Maps

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.

+ markers and overlays, control the user's perspective, draw lines + and shapes, and much more.

- +

Google+

-

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

+

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

- +

Google Cloud Messaging

-

Keep your users connected by delivering events with - lightweight messages immediately from your web server. There are no quotas or charges +

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.

@@ -83,7 +84,7 @@ and track app usage.

- +

Google Play In-App Billing

@@ -95,24 +96,26 @@ and track app usage.

- +

Google Analytics

-

Measure your success and gain deeper insights into how mobile users engage with your content -by integrating Google Analytics with your app.

+

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

- +

Google AdMob Ads

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.

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 - -
- - - -
\ 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
@@ -31,7 +31,8 @@ to carry out these basic steps for obtaining an authentication token.

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 -AccountPicker +{@code +AccountPicker} 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:

@@ -76,7 +80,6 @@ String mScope; String token; ... - try { token = GoogleAuthUtil.getToken(mActivity, mEmail, mScope); } catch { @@ -85,41 +88,62 @@ try {

Call this method off of the main UI thread since it executes network transactions. An easy way to do this - is in an AsyncTask. + 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 Handling Exceptions + If authentication is successful, the token is returned. If not, the exceptions described in +Handling Exceptions are thrown that you can catch and handle appropriately.

Using getTokenWithNotification()

-

If you are obtaining authentication tokens in a background service or sync adapter, there are three overloaded getTokenWithNotification() methods +

If you are obtaining authentication tokens in a background service or sync adapter, there + are three overloaded + {@code getTokenWithNotification()} methods that you can use:

See the sample in <android-sdk>/extras/google-play-services/samples/auth for implementation details.

+ + +

Handling Exceptions

When requesting an authentication token with - GoogleAuthUtil.getToken(), + {@code GoogleAuthUtil.getToken()}, the following exceptions can be thrown:

For more information on how to handle these exceptions and code snippets, see the reference documentation for the -GoogleAuthUtil - class. +{@code +GoogleAuthUtil} class.

+ + + +

Using the Token

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 GoogleAuthUtil.getToken(). + case, obtain a new token using {@code GoogleAuthUtil.getToken()}.

\ 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 image overlays, embed one or more maps as fragments, and much more.

The Google Maps Android API reference is available here on developer.android.com, but for more information about adding maps to your app, visit:

developers.goog

2. Run the sample

+

Once you've installed the Google Play services package, the Google Maps sample is located in <android-sdk>/extras/google-play-services/samples/maps and shows you how to use the major components of the Google Maps Android APIs.

3. Read the documentation

+ +

Read the Google Maps + API Terms of Service.

+

For quick access while developing your Android apps, the - Google Maps + Google Maps Android API reference is available here on developer.android.com.

-

Extended documentation for the Google Maps Android APIs is provided with the rest of the + +

Detailed documentation for the Google Maps Android APIs is available with the rest of the Google Maps developer documents at developers.google.com/maps.

-

Also read the Google Maps - API Terms of Service.

\ 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 share rich content with Google+.

The Google+ Android API reference is available here on developer.android.com, but for more information about integrating Google+, visit:

developers.google.com/+

3. Read the documentation

+

Read the Google+ Platform + Terms of Service.

+

For quick access while developing your Android apps, the - Google+ + Google+ API reference is available here on developer.android.com.

-

Extended documentation for the Google+ Android APIs is provided with the rest of the + +

Detailed documentation for the Google+ Android APIs is available with the rest of the Google+ developer documents at developers.google.com/+.

-

Also read the Google+ Platform - Terms of Service.

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

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

- -

- 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 SDK Download page - on the Android Developers site. + downloadable package from the SDK + Manager. The download includes the client library and code samples.

@@ -38,14 +23,15 @@ page.title=Setup <android-sdk-folder>/extras/google/google_play_services/.

  • Copy the <android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib - library project to a location in your project's source tree.
  • -
  • If you are using Eclipse, import the library project into your workspace. Click File > Import..., select Android > Existing - Android Code into Workspace, and browse to the copy of the library project to import it.
  • + library project to a location in your project's source tree. +

    If you are using Eclipse, import the library project into your workspace. Click File > Import..., select Android > Existing + Android Code into Workspace, and browse to the copy of the library project to import it.

    -
  • Reference the library project in your Android project. See the +
  • Reference the library project in your Android project. +

    See the Referencing a Library Project for Eclipse or Referencing a Library Project on the Command Line - for more information on how to do this. + for more information on how to do this.

  • If you are using ProGuard, add the following lines in the <project_directory>/proguard-project.txt file @@ -58,19 +44,21 @@ page.title=Setup

    Ensuring Devices Have the Google Play services APK

    -

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

    +

    As described in the Google Play services +introduction, 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.

    + +

    Important: - - Because it is hard to anticipate the state devices are in, you must always 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 always 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. -

    + +

    Here are four scenarios that describe the possible state of the Google Play services APK on +a user's device:

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

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

      @@ -121,22 +109,27 @@ page.title=Setup

      1. Query for the status of Google Play services on the device with the -isGooglePlayServicesAvailable() - method, which returns a result code. +{@code isGooglePlayServicesAvailable()} method, which returns a result code.
      2. If the result code is -SUCCESS, +{@code SUCCESS}, then the Google Play services APK is up-to-date, and you can proceed as normal.
      3. - If the result is -SERVICE_MISSING, -SERVICE_VERSION_UPDATE_REQUIRED, + If the result code is +{@code SERVICE_MISSING}, +{@code SERVICE_VERSION_UPDATE_REQUIRED}, or -SERVICE_DISABLED, - call getErrorDialog() - 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. +{@code SERVICE_DISABLED}, then + call {@code getErrorDialog()} + 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.
      \ No newline at end of file -- cgit v1.1