Merge "docs: Docs for Android project view. Bug: 17108468" into klp-modular-docs
diff --git a/core/java/android/hardware/Sensor.java b/core/java/android/hardware/Sensor.java
index d95bcb5..4de486b 100644
--- a/core/java/android/hardware/Sensor.java
+++ b/core/java/android/hardware/Sensor.java
@@ -345,7 +345,7 @@
* A sensor of this type returns the number of steps taken by the user since the last reboot
* while activated. The value is returned as a float (with the fractional part set to zero) and
* is reset to zero only on a system reboot. The timestamp of the event is set to the time when
- * the first step for that event was taken. This sensor is implemented in hardware and is
+ * the last step for that event was taken. This sensor is implemented in hardware and is
* expected to be low power.
* <p>
* See {@link android.hardware.SensorEvent#values SensorEvent.values} for more details.
diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml
index c5b6c24..1e32d43 100644
--- a/docs/html/_redirects.yaml
+++ b/docs/html/_redirects.yaml
@@ -1,3 +1,10 @@
+# WARNING: THIS FILE IS NOT USED IN PRODUCTION
+# CHANGES MADE HERE **DO NOT EFFECT** developer.android.com
+
+# Instead, update the following file in the current docs release branch:
+# <docs-release-branch>/vendor/google/docs/app-engine-server/v3/redirects.yaml
+
+#=============================================================================
# Redirects file.
# This file contains the list of rewrite rules that are applied when serving
# pages. Add "pattern: True" to use python regex in to or from.
@@ -59,6 +66,9 @@
- from: /guide/google/gcm/server-javadoc/...
to: /reference/com/google/android/gcm/server/package-summary.html
+- from: /google/play-services/auth.html
+ to: /google/auth/http-auth.html
+
- from: /guide/google/play/services.html
to: /google/play-services/index.html
diff --git a/docs/html/google/auth/http-auth.jd b/docs/html/google/auth/http-auth.jd
index 3b2a83f..804ba12 100644
--- a/docs/html/google/auth/http-auth.jd
+++ b/docs/html/google/auth/http-auth.jd
@@ -342,9 +342,9 @@
"{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context,%20java.lang.String,%20java.lang.String)">
{@code GoogleAuthUtil.getToken()}</a>, you must provide the app {@link android.content.Context},
the account name retrieved from the account picker, and the scope for your auth
-token request. The above sample code (and the attached sample) defines these arguments with
-class members that the host activity passes to
-the {@link android.os.AsyncTask} class constructor.</p>
+token request. The above sample code (and the attached sample) defines these
+arguments with class members that the host activity passes to the {@link android.os.AsyncTask} class constructor. For more information about setting the scope, see
+the <a href="#SpecifyingScopes">Specifying Scopes</a> section below. </p>
<p class="note"><strong>Note:</strong>
As shown by the {@code fetchToken()} method above, you must handle
@@ -397,8 +397,32 @@
"{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context,%20java.lang.String,%20java.lang.String)">
{@code GoogleAuthUtil.getToken()}</a>.</p>
-
-
+<h3 id="SpecifyingScopes">Specifying scopes</h3>
+<p>The scope string is used to specify which Google services can be accessed by
+ an app using the requested auth token. An auth token can be associated with
+ multiple scopes.</p>
+<p>When specifying the scopes in your auth token request, prefix the
+ scope string with {@code "oauth2:"} followed by a list of one or more OAuth scope
+ values. Use a space to separate each scope value in the list. To see a list of
+ valid OAuth scope values for Google services, browse
+ the <a href="https://developers.google.com/oauthplayground/"
+ class="external-link">OAuth 2.0 Playground</a>.</p>
+<p class="note"><strong>Tip:</strong> Specify {@code "oauth2:<scope>"}
+ for a single scope. Specify
+ {@code "oauth2:<scope1> <scope2> <scopeN>"} for multiple
+ scopes (using a space to separate each scope).</p>
+<p>For example, to access the Google Books API, the scope is
+ {@code "oauth2:https://www.googleapis.com/auth/books"}. To add an additional
+ scope, say for Google+ login, your code might look like this:</p>
+<pre>
+private final static String BOOKS_API_SCOPE
+ = "https://www.googleapis.com/auth/books";
+private fina; static String GPLUS_SCOPE
+ = "https://www.googleapis.com/auth/plus.login";
+private final static String mScopes
+ = "oauth2:" + BOOKS_API_SCOPE + " " + GPLUS_SCOPE;
+String token = GoogleAuthUtil.getToken(mActivity, mEmail, mScopes);
+</pre>
<h2 id="HandleExceptions">Handle Exceptions</h2>
diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd
index ebd3694..d7e449b 100644
--- a/docs/html/google/play-services/setup.jd
+++ b/docs/html/google/play-services/setup.jd
@@ -66,8 +66,8 @@
...
dependencies {
- compile 'com.android.support:appcompat-v7:+'
- <strong>compile 'com.google.android.gms:play-services:5.0.77'</strong>
+ compile 'com.android.support:appcompat-v7:20.+'
+ <strong>compile 'com.google.android.gms:play-services:5.+'</strong>
}
</pre>
<p>Be sure you update this version number each time Google Play services is updated.</p>
diff --git a/docs/html/guide/components/intents-common.jd b/docs/html/guide/components/intents-common.jd
index 3b52b0a..af9456d 100644
--- a/docs/html/guide/components/intents-common.jd
+++ b/docs/html/guide/components/intents-common.jd
@@ -1678,7 +1678,7 @@
<p><b>Example intent:</b></p>
<pre>
public void composeMmsMessage(String message, Uri attachment) {
- Intent intent = new Intent(Intent.ACTION_SEND);
+ Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setType(HTTP.PLAIN_TEXT_TYPE);
intent.putExtra("sms_body", message);
intent.putExtra(Intent.EXTRA_STREAM, attachment);
diff --git a/docs/html/guide/topics/admin/device-admin.jd b/docs/html/guide/topics/admin/device-admin.jd
index a474498..2d02e51 100644
--- a/docs/html/guide/topics/admin/device-admin.jd
+++ b/docs/html/guide/topics/admin/device-admin.jd
@@ -28,12 +28,6 @@
<li>{@link android.app.admin.DevicePolicyManager}</li>
<li>{@link android.app.admin.DeviceAdminInfo}</li>
</ol>
- <h2>Related samples</h2>
- <ol>
- <li><a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html">
-DeviceAdminSample</a></li>
-</ol>
</div>
</div>
@@ -232,18 +226,12 @@
<h2 id="sample">Sample Application</h2>
-<p>The examples used in this document are based on the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html">
-Device Administration API
-sample</a>, which is included in the SDK samples. For information on downloading and
-installing the SDK samples, see <a
-href="{@docRoot}resources/samples/get.html">
-Getting the Samples</a>. Here is the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html">
-complete code</a> for
-the sample. </p>
-<p>The
-sample application offers a demo of device admin features. It presents users
+<p>The examples used in this document are based on the Device Administration API
+sample, which is included in the SDK samples (available through the
+Android SDK Manager) and located on your system as
+<code><sdk_root>/ApiDemos/app/src/main/java/com/example/android/apis/app/DeviceAdminSample.java</code>.</p>
+
+<p>The sample application offers a demo of device admin features. It presents users
with a user interface that lets them enable the device admin application. Once
they've enabled the application, they can use the buttons in the user interface
to do the following:</p>
@@ -676,7 +664,8 @@
<p>You can also programmatically tell the device to lock immediately:</p>
<pre>
DevicePolicyManager mDPM;
-mDPM.lockNow();</pre>
+mDPM.lockNow();
+</pre>
@@ -692,12 +681,12 @@
<pre>
DevicePolicyManager mDPM;
mDPM.wipeData(0);</pre>
-<p>The {@link android.app.admin.DevicePolicyManager#wipeData wipeData()} method takes as its parameter a bit mask of
-additional options. Currently the value must be 0. </p>
+<p>The {@link android.app.admin.DevicePolicyManager#wipeData wipeData()} method takes as its
+ parameter a bit mask of additional options. Currently the value must be 0. </p>
<h4>Disable camera</h4>
<p>Beginning with Android 4.0, you can disable the camera. Note that this doesn't have to be a permanent disabling. The camera can be enabled/disabled dynamically based on context, time, and so on. </p>
-<p>You control whether the camera is disabled by using the
+<p>You control whether the camera is disabled by using the
{@link android.app.admin.DevicePolicyManager#setCameraDisabled(android.content.ComponentName, boolean) setCameraDisabled()} method. For example, this snippet sets the camera to be enabled or disabled based on a checkbox setting:</p>
<pre>private CheckBoxPreference mDisableCameraCheckbox;
@@ -708,8 +697,8 @@
</pre>
-<h4 id=storage">Storage encryption</h4>
-<p>Beginning with Android 3.0, you can use the
+<h4 id="storage">Storage encryption</h4>
+<p>Beginning with Android 3.0, you can use the
{@link android.app.admin.DevicePolicyManager#setStorageEncryption(android.content.ComponentName,boolean) setStorageEncryption()}
method to set a policy requiring encryption of the storage area, where supported.</p>
@@ -722,5 +711,5 @@
mDPM.setStorageEncryption(mDeviceAdminSample, true);
</pre>
<p>
-See the <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html"> Device Administration API sample</a> for a complete
-example of how to enable storage encryption.</p>
+See the Device Administration API sample for a complete example of how to enable storage encryption.
+</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/renderscript/compute.jd b/docs/html/guide/topics/renderscript/compute.jd
index c62510b..100894c 100644
--- a/docs/html/guide/topics/renderscript/compute.jd
+++ b/docs/html/guide/topics/renderscript/compute.jd
@@ -157,8 +157,7 @@
<ul>
<li><strong>{@link android.renderscript}</strong> - The APIs in this class package are
- available on devices running Android 3.0 (API level 11) and higher. These are the original APIs
- for RenderScript and are not currently being updated.</li>
+ available on devices running Android 3.0 (API level 11) and higher. </li>
<li><strong>{@link android.support.v8.renderscript}</strong> - The APIs in this package are
available through a <a href="{@docRoot}tools/support-library/features.html#v8">Support
Library</a>, which allows you to use them on devices running Android 2.2 (API level 8) and
@@ -166,8 +165,8 @@
</ul>
<p>We strongly recommend using the Support Library APIs for accessing RenderScript because they
- include the latest improvements to the RenderScript compute framework and provide a wider range
- of device compatibility.</p>
+ provide a wider range of device compatibility. Developers targeting specific versions of
+ Android can use {@link android.renderscript} if necessary.</p>
<h3 id="ide-setup">Using the RenderScript Support Library APIs</h3>
@@ -308,4 +307,4 @@
<li><strong>Tear down the RenderScript context.</strong> The RenderScript context can be destroyed
with {@link android.renderscript.RenderScript#destroy} or by allowing the RenderScript context
object to be garbage collected. This will cause any further use of any object belonging to that
-context to throw an exception.</li> </ol>
\ No newline at end of file
+context to throw an exception.</li> </ol>
diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd
index c868080..d69af9f 100644
--- a/docs/html/guide/topics/ui/accessibility/services.jd
+++ b/docs/html/guide/topics/ui/accessibility/services.jd
@@ -71,24 +71,30 @@
<h3 id="service-declaration">Accessibility service declaration</h3>
-<p>In order to be treated as an accessibility service, your application must include the
+<p>In order to be treated as an accessibility service, you must include a
{@code service} element (rather than the {@code activity} element) within the {@code application}
-element in its manifest. In addition, within the {@code service} element, you must also include an
+element in your manifest. In addition, within the {@code service} element, you must also include an
accessibility service intent filter. For compatiblity with Android 4.1 and higher, the manifest
must also request the {@link android.Manifest.permission#BIND_ACCESSIBILITY_SERVICE} permission
as shown in the following sample:</p>
<pre>
-<application>
- <service android:name=".MyAccessibilityService"
- android:label="@string/accessibility_service_label"
- android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
- <intent-filter>
- <action android:name="android.accessibilityservice.AccessibilityService" />
- </intent-filter>
- </service>
- <uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" />
-</application>
+<manifest>
+ ...
+ <uses-permission ... />
+ ...
+ <application>
+ ...
+ <service android:name=".MyAccessibilityService"
+ android:label="@string/accessibility_service_label"
+ android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
+ <intent-filter>
+ <action android:name="android.accessibilityservice.AccessibilityService" />
+ </intent-filter>
+ </service>
+ <uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" />
+ </application>
+</manifest>
</pre>
<p>These declarations are required for all accessibility services deployed on Android 1.6 (API Level
diff --git a/docs/html/sdk/installing/create-project.jd b/docs/html/sdk/installing/create-project.jd
index c0d523a..a7c12d4 100644
--- a/docs/html/sdk/installing/create-project.jd
+++ b/docs/html/sdk/installing/create-project.jd
@@ -76,7 +76,7 @@
<img src="{@docRoot}images/tools/wizard7.png" alt="" width="750" height="509">
<p class="img-caption"><strong>Figure 7.</strong> The default project structure for a mobile app.</p>
-<p>Now you are ready to develop your app. Fore more information, see the following links:</p>
+<p>Now you are ready to develop your app. For more information, see the following links:</p>
<ul>
<li><a href="{@docRoot}training/">Training Lessons</a></li>
diff --git a/docs/html/sdk/installing/installing-adt.jd b/docs/html/sdk/installing/installing-adt.jd
index 851827c..5a433d4 100644
--- a/docs/html/sdk/installing/installing-adt.jd
+++ b/docs/html/sdk/installing/installing-adt.jd
@@ -104,7 +104,7 @@
</tr>
<tr>
<td>
- <a href="http://dl.google.com/android/{@adtZipDownload}">{@adtZipDownload}</a>
+ <a href="https://dl.google.com/android/{@adtZipDownload}">{@adtZipDownload}</a>
</td>
<td>{@adtZipBytes} bytes</td>
<td>{@adtZipChecksum}</td>
diff --git a/docs/html/sdk/installing/studio.jd b/docs/html/sdk/installing/studio.jd
index 71d6c1c..ee14b19 100644
--- a/docs/html/sdk/installing/studio.jd
+++ b/docs/html/sdk/installing/studio.jd
@@ -251,7 +251,7 @@
<td>Windows</td>
<td>
<a onclick="return onDownload(this)" id="win-studio"
- href="http://dl.google.com/android/studio/install/0.8.6/android-studio-bundle-135.1339820-windows.exe">
+ href="https://dl.google.com/android/studio/install/0.8.6/android-studio-bundle-135.1339820-windows.exe">
android-studio-bundle-135.1339820-windows.exe
</a>
</td>
@@ -263,7 +263,7 @@
<td><nobr>Mac OS X</nobr></td>
<td>
<a onclick="return onDownload(this)" id="mac-studio"
- href="http://dl.google.com/android/studio/install/0.8.6/android-studio-bundle-135.1339820-mac.dmg">
+ href="https://dl.google.com/android/studio/install/0.8.6/android-studio-bundle-135.1339820-mac.dmg">
android-studio-bundle-135.1339820-mac.dmg
</a>
</td>
@@ -275,7 +275,7 @@
<td>Linux</td>
<td>
<a onclick="return onDownload(this)" id="linux-studio"
- href="http://dl.google.com/android/studio/install/0.8.6/android-studio-bundle-135.1339820-linux.tgz">
+ href="https://dl.google.com/android/studio/install/0.8.6/android-studio-bundle-135.1339820-linux.tgz">
android-studio-bundle-135.1339820-linux.tgz
</a>
</td>
diff --git a/docs/html/tools/testing/testing_accessibility.jd b/docs/html/tools/testing/testing_accessibility.jd
index daf9b36..20948fa 100644
--- a/docs/html/tools/testing/testing_accessibility.jd
+++ b/docs/html/tools/testing/testing_accessibility.jd
@@ -179,7 +179,7 @@
</p>
<p>For more information about using TalkBack, see
-<a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700928">Use TalkBack</a>.</p>
+<a href="https://support.google.com/accessibility/android/topic/3529932">TalkBack</a>.</p>
<h4 id="testing-ebt">Testing with Explore by Touch</h4>
@@ -207,8 +207,7 @@
</ol>
<p>For more information about using the Explore by Touch features, see
-<a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700722">Use Explore by
-Touch</a>.</p>
+<a href="https://support.google.com/accessibility/android/answer/6006598">Touch Exploration</a>.</p>
<h3 id="test-navigation">Testing focus navigation</h3>
@@ -231,7 +230,7 @@
<p>Gesture navigation is an accessibility navigation mode that allows users to navigate Android
devices and applications using specific
- <a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700718">gestures</a>. This
+ <a href="https://support.google.com/accessibility/android/answer/6006598">gestures</a>. This
navigation mode is available on Android 4.1 (API Level 16) and higher.</p>
<p class="note"><strong>Note:</strong> Accessibility gestures provide a different navigation path
@@ -248,8 +247,7 @@
</ul>
<p>For more information about using Explore by Touch accessibility gestures, see
-<a href="http://support.google.com/android/bin/topic.py?hl=en&topic=2492346">Accessibility
-gestures</a>.</p>
+<a href="https://support.google.com/accessibility/android/answer/6006598">Touch Exploration</a>.</p>
<p class="note">
<strong>Note:</strong> Accessibility services other than TalkBack may map accessibility gestures
diff --git a/docs/html/training/location/retrieve-current.jd b/docs/html/training/location/retrieve-current.jd
index 99e475f..f079040 100644
--- a/docs/html/training/location/retrieve-current.jd
+++ b/docs/html/training/location/retrieve-current.jd
@@ -167,13 +167,12 @@
"Google Play services is available.");
// Continue
return true;
- // Google Play services was not available for some reason
+ // Google Play services was not available for some reason.
+ // resultCode holds the error code.
} else {
- // Get the error code
- int errorCode = connectionResult.getErrorCode();
// Get the error dialog from Google Play services
Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(
- errorCode,
+ resultCode,
this,
CONNECTION_FAILURE_RESOLUTION_REQUEST);
diff --git a/docs/html/training/wearables/notifications/creating.jd b/docs/html/training/wearables/notifications/creating.jd
index d6ad34a..9398f96 100644
--- a/docs/html/training/wearables/notifications/creating.jd
+++ b/docs/html/training/wearables/notifications/creating.jd
@@ -208,9 +208,12 @@
<b>.setStyle(bigStyle);</b>
</pre>
-<p>Notice that you can add a large background image to any notification using the
+<p>Notice that you can add a large icon image to any notification using the
{@link android.support.v4.app.NotificationCompat.Builder#setLargeIcon setLargeIcon()}
-method. For more information about designing notifications with large images, see the
+method. However, these icons appear as large background images on a wearable and do not look
+good as they are scaled up to fit the wearable screen. To add a wearable-specific background image
+to a notification, see <a href="#AddWearableFeatures">Add Wearable Features For a Notification</a>.
+For more information about designing notifications with large images, see the
<a href="{@docRoot}design/wear/index.html">Design Principles of Android
Wear</a>.</p>
@@ -244,7 +247,8 @@
// Create a WearableExtender to add functionality for wearables
NotificationCompat.WearableExtender wearableExtender =
new NotificationCompat.WearableExtender()
- .setHintHideIcon(true);
+ .setHintHideIcon(true)
+ .setBackground(mBitmap);
// Create a NotificationCompat.Builder to build a standard notification
// then extend it with the WearableExtender
@@ -257,12 +261,21 @@
</pre>
<p>The
- {@link android.support.v4.app.NotificationCompat.WearableExtender#setHintHideIcon setHintHideIcon()}
- method is just one example of new notification features available with
- {@link android.support.v4.app.NotificationCompat.WearableExtender}.
-</p>
+{@link android.support.v4.app.NotificationCompat.WearableExtender#setHintHideIcon setHintHideIcon()}
+and {@link android.support.v4.app.NotificationCompat.WearableExtender#setBackground setBackground()}
+methods are just two examples of new notification features available with
+{@link android.support.v4.app.NotificationCompat.WearableExtender}.</p>
-<p>If you ever need to read wearable-specifc options at a later time, use the corresponding get
+<p class="note"><strong>Note:</strong> The bitmap that you use with
+{@link android.support.v4.app.NotificationCompat.WearableExtender#setBackground setBackground()}
+should have a resolution of 400x400 for non-scrolling backgrounds and 640x400 for backgrounds
+that support parallax scrolling. Place these bitmap images in the <code>res/drawable-nodpi</code>
+directory of your handheld app. Place other non-bitmap resources for wearable notifications, such
+as those used with the
+{@link android.support.v4.app.NotificationCompat.WearableExtender#setContentIcon setContentIcon()}
+method, in the <code>res/drawable-hdpi</code> directory of your handheld app.</p>
+
+<p>If you ever need to read wearable-specific options at a later time, use the corresponding get
method for the option. This example calls the
{@link android.support.v4.app.NotificationCompat.WearableExtender#getHintHideIcon()} method to
get whether or not this notification hides the icon:
@@ -272,6 +285,7 @@
boolean hintHideIcon = wearableExtender.getHintHideIcon();
</pre>
+
<h2 id="Deliver">Deliver the Notification</h2>
<p>When you want to deliver your notifications, always use the
{@link android.support.v4.app.NotificationManagerCompat} API instead of
diff --git a/docs/html/wear/images/partners/sony.png b/docs/html/wear/images/partners/sony.png
new file mode 100644
index 0000000..3e9483e
--- /dev/null
+++ b/docs/html/wear/images/partners/sony.png
Binary files differ
diff --git a/docs/html/wear/index.jd b/docs/html/wear/index.jd
index 5dd7690..c9a5cff 100644
--- a/docs/html/wear/index.jd
+++ b/docs/html/wear/index.jd
@@ -228,6 +228,10 @@
<div class="col-4">
<img src="/wear/images/partners/samsung.png" alt="Samsung">
</div>
+ <div class="col-4">
+ <img src="/wear/images/partners/sony.png" alt="Sony"
+ style="margin-left:57px;margin-top:17px;">
+ </div>
</div>
</div> <!-- end .wrap -->
</div>