summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2013-09-18 17:27:52 +0530
committerAmit Pundir <amit.pundir@linaro.org>2013-09-18 17:27:52 +0530
commit49c30efafc6b450a24d7a660d368693e0e87b561 (patch)
tree34a50afd29caa368df1946349436a56cce6c8c69
parentef260a8e439efc8ac40aa54cd64c5691f765aab0 (diff)
parent79c8965bb057899e6be014d7a31aaaced3fdb0f7 (diff)
downloadbase-49c30efafc6b450a24d7a660d368693e0e87b561.tar.gz
Merge android-4.3_r3:
Android 4.3 release 3.0 * tag 'android-4.3_r3': (34 commits) Use hostname verifier directly instead of instance DO NOT MERGE If in a mobile captive portal is detected enable fail fast. Have CaptivePortalTracker use gservices updateable provisioning urls. In CaptiviePortalTracker a socket timeout is probably a captive portal. Check that hipri has started. Add new app ops method to reset all op modes. Revert "Add version identifier to app ops." Add version identifier to app ops. Allow the user to block notifications for foreground services. (DO NOT MERGE) Fix pub issue #58043: Copy crash in Android 4.3... Doc change: fix reference to getBestDateTimePattern(). Doc change: remove devices listed for vp8 hw encoder in highlights. Doc change: update carousel on develop home. Doc change: Platform highlights for Android 4.3. docs: OpenGL ES 3.0 dev guide update fix javadoc error update usb driver doc with download link; delete revision notes Doc change: Add Colopl video to carousel and spotlight. cherrypick/merge of I70b1633ea9f6c48f76f88d08b7e9fc287f7dde93 update action bar guide for support lib ABC docs: Android 4.3 Platform Release Notes ... Conflicts: core/java/android/net/ConnectivityManager.java core/java/android/net/IConnectivityManager.aidl services/java/com/android/server/AppOpsService.java services/java/com/android/server/ConnectivityService.java Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--core/java/android/bluetooth/BluetoothTetheringDataTracker.java5
-rw-r--r--core/java/android/net/BaseNetworkStateTracker.java5
-rw-r--r--core/java/android/net/CaptivePortalTracker.java41
-rw-r--r--core/java/android/net/ConnectivityManager.java33
-rw-r--r--core/java/android/net/DummyDataStateTracker.java6
-rw-r--r--core/java/android/net/EthernetDataTracker.java5
-rw-r--r--core/java/android/net/IConnectivityManager.aidl4
-rw-r--r--core/java/android/net/MobileDataStateTracker.java12
-rw-r--r--core/java/android/net/NetworkStateTracker.java5
-rw-r--r--docs/html/about/versions/android-4.3.jd685
-rw-r--r--docs/html/about/versions/jelly-bean.jd582
-rw-r--r--docs/html/design/building-blocks/tabs.jd2
-rw-r--r--docs/html/design/media/tabs_youtube.pngbin28290 -> 26073 bytes
-rw-r--r--docs/html/design/patterns/actionbar.jd2
-rw-r--r--docs/html/design/patterns/navigation.jd2
-rw-r--r--docs/html/develop/index.jd58
-rw-r--r--docs/html/distribute/googleplay/spotlight/index.jd29
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7/land_back.pngbin158936 -> 188364 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7/land_fore.pngbin33274 -> 35221 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7/land_shadow.pngbin31186 -> 29804 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7/port_back.pngbin177565 -> 217060 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7/port_fore.pngbin30824 -> 30083 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7/port_shadow.pngbin29482 -> 29106 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7/thumb.pngbin7754 -> 5734 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_back.pngbin0 -> 158936 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_fore.pngbin0 -> 33274 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_shadow.pngbin0 -> 31186 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_back.pngbin0 -> 177565 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_fore.pngbin0 -> 30824 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_shadow.pngbin0 -> 29482 bytes
-rw-r--r--docs/html/distribute/promote/device-art-resources/nexus_7_2012/thumb.pngbin0 -> 7754 bytes
-rw-r--r--docs/html/distribute/promote/device-art.jd23
-rw-r--r--docs/html/guide/guide_toc.cs2
-rw-r--r--docs/html/guide/topics/graphics/opengl.jd414
-rw-r--r--docs/html/guide/topics/manifest/activity-element.jd487
-rw-r--r--docs/html/guide/topics/manifest/uses-sdk-element.jd12
-rw-r--r--docs/html/guide/topics/ui/actionbar.jd1675
-rw-r--r--docs/html/images/jb-android-43.jpgbin0 -> 112848 bytes
-rw-r--r--docs/html/images/jb-android-43@2x.pngbin0 -> 556488 bytes
-rw-r--r--docs/html/images/jb-btle.pngbin0 -> 75456 bytes
-rw-r--r--docs/html/images/jb-gpu-profile-cal-n4.pngbin0 -> 149654 bytes
-rw-r--r--docs/html/images/jb-gpu-profile-clk-n4.pngbin0 -> 110915 bytes
-rw-r--r--docs/html/images/jb-profiles-create-n713.pngbin0 -> 122384 bytes
-rw-r--r--docs/html/images/jb-profiles-restrictions-n713.pngbin0 -> 138563 bytes
-rw-r--r--docs/html/images/jb-pseudo-locale-zz.pngbin0 -> 62963 bytes
-rw-r--r--docs/html/images/jb-rtl-arabic-n4.pngbin0 -> 44153 bytes
-rw-r--r--docs/html/images/jb-rtl-hebrew-n4.pngbin0 -> 31609 bytes
-rw-r--r--docs/html/images/jb-systrace.pngbin0 -> 53970 bytes
-rw-r--r--docs/html/images/practices/actionbar-phone-splitaction.pngbin19263 -> 18267 bytes
-rw-r--r--docs/html/images/practices/actionbar-phone-splitaction@2x.pngbin0 -> 55045 bytes
-rw-r--r--docs/html/images/ui/actionbar-dropdown.pngbin0 -> 13154 bytes
-rw-r--r--docs/html/images/ui/actionbar-dropdown@2x.pngbin0 -> 30740 bytes
-rw-r--r--docs/html/images/ui/actionbar-item-withtext.pngbin10762 -> 9258 bytes
-rw-r--r--docs/html/images/ui/actionbar-searchview.pngbin16780 -> 13153 bytes
-rw-r--r--docs/html/images/ui/actionbar-searchview@2x.pngbin0 -> 33585 bytes
-rw-r--r--docs/html/images/ui/actionbar-shareaction.pngbin70953 -> 118031 bytes
-rw-r--r--docs/html/images/ui/actionbar-shareaction@2x.pngbin0 -> 362277 bytes
-rw-r--r--docs/html/images/ui/actionbar-splitaction.pngbin0 -> 23051 bytes
-rw-r--r--docs/html/images/ui/actionbar-splitaction@2x.pngbin0 -> 68147 bytes
-rw-r--r--docs/html/images/ui/actionbar-stacked.pngbin11616 -> 0 bytes
-rw-r--r--docs/html/images/ui/actionbar-tabs-stacked.pngbin0 -> 6622 bytes
-rw-r--r--docs/html/images/ui/actionbar-tabs-stacked@2x.pngbin0 -> 16407 bytes
-rw-r--r--docs/html/images/ui/actionbar-tabs.pngbin7905 -> 10327 bytes
-rw-r--r--docs/html/images/ui/actionbar-tabs@2x.pngbin0 -> 29079 bytes
-rw-r--r--docs/html/images/ui/actionbar-up.pngbin0 -> 5961 bytes
-rw-r--r--docs/html/images/ui/actionbar.pngbin16685 -> 69537 bytes
-rw-r--r--docs/html/images/ui/actionbar@2x.pngbin0 -> 212361 bytes
-rw-r--r--docs/html/images/video-Colopl.pngbin0 -> 513773 bytes
-rw-r--r--docs/html/index.jd76
-rw-r--r--docs/html/sdk/index.jd54
-rw-r--r--docs/html/sdk/installing/installing-adt.jd8
-rw-r--r--docs/html/sdk/win-usb.jd401
-rw-r--r--docs/html/tools/revisions/platforms.jd65
-rw-r--r--docs/html/tools/sdk/eclipse-adt.jd37
-rw-r--r--docs/html/tools/sdk/ndk/index.jd435
-rw-r--r--docs/html/tools/sdk/tools-notes.jd36
-rw-r--r--docs/html/training/implementing-navigation/nav-drawer.jd6
-rw-r--r--services/java/com/android/server/AppOpsService.java18
-rw-r--r--services/java/com/android/server/ConnectivityService.java53
-rw-r--r--services/java/com/android/server/connectivity/Tethering.java7
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java18
-rw-r--r--wifi/java/android/net/wifi/WifiStateMachine.java6
-rw-r--r--wifi/java/android/net/wifi/WifiStateTracker.java5
83 files changed, 3383 insertions, 1931 deletions
diff --git a/core/java/android/bluetooth/BluetoothTetheringDataTracker.java b/core/java/android/bluetooth/BluetoothTetheringDataTracker.java
index 81c0a6a87eaf..0aedecb82dd2 100644
--- a/core/java/android/bluetooth/BluetoothTetheringDataTracker.java
+++ b/core/java/android/bluetooth/BluetoothTetheringDataTracker.java
@@ -152,6 +152,11 @@ public class BluetoothTetheringDataTracker implements NetworkStateTracker {
// not implemented
}
+ @Override
+ public void captivePortalCheckCompleted(boolean isCaptivePortal) {
+ // not implemented
+ }
+
/**
* Re-enable connectivity to a network after a {@link #teardown()}.
*/
diff --git a/core/java/android/net/BaseNetworkStateTracker.java b/core/java/android/net/BaseNetworkStateTracker.java
index 1165281e39bb..e87f84c56a21 100644
--- a/core/java/android/net/BaseNetworkStateTracker.java
+++ b/core/java/android/net/BaseNetworkStateTracker.java
@@ -102,6 +102,11 @@ public abstract class BaseNetworkStateTracker implements NetworkStateTracker {
}
@Override
+ public void captivePortalCheckCompleted(boolean isCaptivePortal) {
+ // not implemented
+ }
+
+ @Override
public boolean setRadio(boolean turnOn) {
// Base tracker doesn't handle radios
return true;
diff --git a/core/java/android/net/CaptivePortalTracker.java b/core/java/android/net/CaptivePortalTracker.java
index c60b3945f859..588eff8ae98e 100644
--- a/core/java/android/net/CaptivePortalTracker.java
+++ b/core/java/android/net/CaptivePortalTracker.java
@@ -34,6 +34,7 @@ import android.os.Message;
import android.os.RemoteException;
import android.provider.Settings;
import android.telephony.TelephonyManager;
+import android.text.TextUtils;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
@@ -42,6 +43,7 @@ import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.Inet4Address;
+import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.UnknownHostException;
@@ -52,7 +54,7 @@ import com.android.internal.R;
* @hide
*/
public class CaptivePortalTracker extends StateMachine {
- private static final boolean DBG = false;
+ private static final boolean DBG = true;
private static final String TAG = "CaptivePortalTracker";
private static final String DEFAULT_SERVER = "clients3.google.com";
@@ -270,6 +272,7 @@ public class CaptivePortalTracker extends StateMachine {
} else {
if (DBG) log("Not captive network " + mNetworkInfo);
}
+ notifyPortalCheckCompleted(mNetworkInfo, captive);
if (mDeviceProvisioned) {
if (captive) {
// Setup Wizard will assist the user in connecting to a captive
@@ -301,12 +304,26 @@ public class CaptivePortalTracker extends StateMachine {
return;
}
try {
+ if (DBG) log("notifyPortalCheckComplete: ni=" + info);
mConnService.captivePortalCheckComplete(info);
} catch(RemoteException e) {
e.printStackTrace();
}
}
+ private void notifyPortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) {
+ if (info == null) {
+ loge("notifyPortalCheckComplete on null");
+ return;
+ }
+ try {
+ if (DBG) log("notifyPortalCheckCompleted: captive=" + isCaptivePortal + " ni=" + info);
+ mConnService.captivePortalCheckCompleted(info, isCaptivePortal);
+ } catch(RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
private boolean isActiveNetwork(NetworkInfo info) {
try {
NetworkInfo active = mConnService.getActiveNetworkInfo();
@@ -338,6 +355,9 @@ public class CaptivePortalTracker extends StateMachine {
urlConnection.getInputStream();
// we got a valid response, but not from the real google
return urlConnection.getResponseCode() != 204;
+ } catch (SocketTimeoutException e) {
+ if (DBG) log("Probably a portal: exception " + e);
+ return true;
} catch (IOException e) {
if (DBG) log("Probably not a portal: exception " + e);
return false;
@@ -365,6 +385,7 @@ public class CaptivePortalTracker extends StateMachine {
private void setNotificationVisible(boolean visible) {
// if it should be hidden and it is already hidden, then noop
if (!visible && !mNotificationShown) {
+ if (DBG) log("setNotivicationVisible: false and not shown, so noop");
return;
}
@@ -376,12 +397,14 @@ public class CaptivePortalTracker extends StateMachine {
CharSequence title;
CharSequence details;
int icon;
+ String url = null;
switch (mNetworkInfo.getType()) {
case ConnectivityManager.TYPE_WIFI:
title = r.getString(R.string.wifi_available_sign_in, 0);
details = r.getString(R.string.network_available_sign_in_detailed,
mNetworkInfo.getExtraInfo());
icon = R.drawable.stat_notify_wifi_in_range;
+ url = mUrl;
break;
case ConnectivityManager.TYPE_MOBILE:
title = r.getString(R.string.network_available_sign_in, 0);
@@ -389,12 +412,24 @@ public class CaptivePortalTracker extends StateMachine {
// name has been added to it
details = mTelephonyManager.getNetworkOperatorName();
icon = R.drawable.stat_notify_rssi_in_range;
+ try {
+ url = mConnService.getMobileProvisioningUrl();
+ if (TextUtils.isEmpty(url)) {
+ url = mConnService.getMobileRedirectedProvisioningUrl();
+ }
+ } catch(RemoteException e) {
+ e.printStackTrace();
+ }
+ if (TextUtils.isEmpty(url)) {
+ url = mUrl;
+ }
break;
default:
title = r.getString(R.string.network_available_sign_in, 0);
details = r.getString(R.string.network_available_sign_in_detailed,
mNetworkInfo.getExtraInfo());
icon = R.drawable.stat_notify_rssi_in_range;
+ url = mUrl;
break;
}
@@ -402,15 +437,17 @@ public class CaptivePortalTracker extends StateMachine {
notification.when = 0;
notification.icon = icon;
notification.flags = Notification.FLAG_AUTO_CANCEL;
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(mUrl));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT |
Intent.FLAG_ACTIVITY_NEW_TASK);
notification.contentIntent = PendingIntent.getActivity(mContext, 0, intent, 0);
notification.tickerText = title;
notification.setLatestEventInfo(mContext, title, details, notification.contentIntent);
+ if (DBG) log("setNotivicationVisible: make visible");
notificationManager.notify(NOTIFICATION_ID, 1, notification);
} else {
+ if (DBG) log("setNotivicationVisible: cancel notification");
notificationManager.cancel(NOTIFICATION_ID, 1);
}
mNotificationShown = visible;
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 697bde99a2d1..aa2d4ce92e6b 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -1283,6 +1283,25 @@ public class ConnectivityManager {
}
/**
+ * Signal that the captive portal check on the indicated network
+ * is complete and whether its a captive portal or not.
+ *
+ * @param info the {@link NetworkInfo} object for the networkType
+ * in question.
+ * @param isCaptivePortal true/false.
+ *
+ * <p>This method requires the call to hold the permission
+ * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}.
+ * {@hide}
+ */
+ public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) {
+ try {
+ mService.captivePortalCheckCompleted(info, isCaptivePortal);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
* Supply the backend messenger for a network tracker
*
* @param type NetworkType to set
@@ -1360,7 +1379,7 @@ public class ConnectivityManager {
}
/**
- * Get the carrier provisioning url.
+ * Get the mobile provisioning url.
* {@hide}
*/
public String getMobileProvisioningUrl() {
@@ -1370,4 +1389,16 @@ public class ConnectivityManager {
}
return null;
}
+
+ /**
+ * Get the mobile redirected provisioning url.
+ * {@hide}
+ */
+ public String getMobileRedirectedProvisioningUrl() {
+ try {
+ return mService.getMobileRedirectedProvisioningUrl();
+ } catch (RemoteException e) {
+ }
+ return null;
+ }
}
diff --git a/core/java/android/net/DummyDataStateTracker.java b/core/java/android/net/DummyDataStateTracker.java
index 15a81f3e45e8..ee738fd9c715 100644
--- a/core/java/android/net/DummyDataStateTracker.java
+++ b/core/java/android/net/DummyDataStateTracker.java
@@ -120,10 +120,16 @@ public class DummyDataStateTracker implements NetworkStateTracker {
return true;
}
+ @Override
public void captivePortalCheckComplete() {
// not implemented
}
+ @Override
+ public void captivePortalCheckCompleted(boolean isCaptivePortal) {
+ // not implemented
+ }
+
/**
* Record the detailed state of a network, and if it is a
* change from the previous state, send a notification to
diff --git a/core/java/android/net/EthernetDataTracker.java b/core/java/android/net/EthernetDataTracker.java
index 27d5a58e4918..ac2b0d9a8bd4 100644
--- a/core/java/android/net/EthernetDataTracker.java
+++ b/core/java/android/net/EthernetDataTracker.java
@@ -279,6 +279,11 @@ public class EthernetDataTracker implements NetworkStateTracker {
// not implemented
}
+ @Override
+ public void captivePortalCheckCompleted(boolean isCaptivePortal) {
+ // not implemented
+ }
+
/**
* Turn the wireless radio off for a network.
* @param turnOn {@code true} to turn the radio on, {@code false}
diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl
index 4600c1a4dc27..3ac5f1367fc5 100644
--- a/core/java/android/net/IConnectivityManager.aidl
+++ b/core/java/android/net/IConnectivityManager.aidl
@@ -129,6 +129,8 @@ interface IConnectivityManager
void captivePortalCheckComplete(in NetworkInfo info);
+ void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal);
+
void supplyMessenger(int networkType, in Messenger messenger);
int findConnectionTypeForIface(in String iface);
@@ -136,4 +138,6 @@ interface IConnectivityManager
int checkMobileProvisioning(boolean sendNotification, int suggestedTimeOutMs, in ResultReceiver resultReceiver);
String getMobileProvisioningUrl();
+
+ String getMobileRedirectedProvisioningUrl();
}
diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java
index 5a1daed9511a..adad8decca89 100644
--- a/core/java/android/net/MobileDataStateTracker.java
+++ b/core/java/android/net/MobileDataStateTracker.java
@@ -40,6 +40,7 @@ import com.android.internal.util.AsyncChannel;
import java.io.CharArrayWriter;
import java.io.PrintWriter;
+import java.util.concurrent.atomic.AtomicBoolean;
/**
* Track the state of mobile data connectivity. This is done by
@@ -75,6 +76,8 @@ public class MobileDataStateTracker implements NetworkStateTracker {
private Handler mHandler;
private AsyncChannel mDataConnectionTrackerAc;
+ private AtomicBoolean mIsCaptivePortal = new AtomicBoolean(false);
+
/**
* Create a new MobileDataStateTracker
* @param netType the ConnectivityManager network type
@@ -377,6 +380,15 @@ public class MobileDataStateTracker implements NetworkStateTracker {
// not implemented
}
+ @Override
+ public void captivePortalCheckCompleted(boolean isCaptivePortal) {
+ if (mIsCaptivePortal.getAndSet(isCaptivePortal) != isCaptivePortal) {
+ // Captive portal change enable/disable failing fast
+ setEnableFailFastMobileData(
+ isCaptivePortal ? DctConstants.ENABLED : DctConstants.DISABLED);
+ }
+ }
+
/**
* Record the detailed state of a network, and if it is a
* change from the previous state, send a notification to
diff --git a/core/java/android/net/NetworkStateTracker.java b/core/java/android/net/NetworkStateTracker.java
index cf77a1cdbe61..9ed753371907 100644
--- a/core/java/android/net/NetworkStateTracker.java
+++ b/core/java/android/net/NetworkStateTracker.java
@@ -144,6 +144,11 @@ public interface NetworkStateTracker {
public void captivePortalCheckComplete();
/**
+ * Captive portal check has completed
+ */
+ public void captivePortalCheckCompleted(boolean isCaptive);
+
+ /**
* Turn the wireless radio off for a network.
* @param turnOn {@code true} to turn the radio on, {@code false}
*/
diff --git a/docs/html/about/versions/android-4.3.jd b/docs/html/about/versions/android-4.3.jd
index 0ca3bc658814..d0ccfbe08a53 100644
--- a/docs/html/about/versions/android-4.3.jd
+++ b/docs/html/about/versions/android-4.3.jd
@@ -7,7 +7,7 @@ sdk.platform.apiLevel=18
<div id="qv-wrapper">
<div id="qv">
-
+
<h2>In this document
<a href="#" onclick="hideNestedItems('#toc43',this);return false;" class="header-toggle">
<span class="more">show more</span>
@@ -62,7 +62,6 @@ sdk.platform.apiLevel=18
</li>
<li><a href="#UserInput">User Input</a>
<ol>
- <li><a href="#SignificantMotion">Detect significant motion</a></li>
<li><a href="#Sensors">New sensor types</a></li>
</ol>
</li>
@@ -133,7 +132,7 @@ image to test your app on the <a href="{@docRoot}tools/devices/emulator.html">An
Then build your apps against the Android {@sdkPlatformVersion} platform to begin using the
latest APIs.</p>
-
+
<h3 id="ApiLevel">Update your target API level</h3>
<p>To better optimize your app for devices running Android {@sdkPlatformVersion},
@@ -145,7 +144,7 @@ test it, then publish an update with this change.</p>
<p>You can use APIs in Android {@sdkPlatformVersion} while also supporting older versions by adding
conditions to your code that check for the system API level before executing
APIs not supported by your <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>.
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>.
To learn more about maintaining backward compatibility, read <a
href="{@docRoot}training/basics/supporting-devices/platforms.html">Supporting Different
Platform Versions</a>.</p>
@@ -172,11 +171,11 @@ be affected by changes in Android {@sdkPlatformVersion}.</p>
<p>Your app might misbehave in a restricted profile environment.</p>
-<p>Users in a <a href="#RestrictedProfiles">restricted profile</a> environment might not
-have all the standard Android apps available. For example, a restricted profile might have the
-web browser and camera app disabled. So your app should not make assumptions about which apps are
-available, because if you call {@link android.app.Activity#startActivity startActivity()} without
-verifying whether an app is available to handle the {@link android.content.Intent},
+<p>Users in a <a href="#RestrictedProfiles">restricted profile</a> environment might not
+have all the standard Android apps available. For example, a restricted profile might have the
+web browser and camera app disabled. So your app should not make assumptions about which apps are
+available, because if you call {@link android.app.Activity#startActivity startActivity()} without
+verifying whether an app is available to handle the {@link android.content.Intent},
your app might crash in a restricted profile.</p>
<p>When using an implicit intent, you should always verify that an app is available to handle the intent by calling {@link android.content.Intent#resolveActivity resolveActivity()} or {@link android.content.pm.PackageManager#queryIntentActivities queryIntentActivities()}. For example:</p>
@@ -197,20 +196,20 @@ if (intent.resolveActivity(getPackageManager()) != null) {
<p>Your app might misbehave in a restricted profile environment.</p>
<p>Users within a restricted profile environment do not have access to user accounts by default.
-If your app depends on an {@link android.accounts.Account}, then your app might crash or behave
+If your app depends on an {@link android.accounts.Account}, then your app might crash or behave
unexpectedly when used in a restricted profile.</p>
<p>If you'd like to prevent restricted profiles from using your app entirely because your
-app depends on account information that's sensitive, specify the <a
-href="{@docRoot}guide/topics/manifest/application-element.html#requiredAccountType">{@code
-android:requiredAccountType}</a> attribute in your manifest's <a
-href="{@docRoot}guide/topics/manifest/application-element.html">{@code &lt;application>}</a>
+app depends on account information that's sensitive, specify the <a
+href="{@docRoot}guide/topics/manifest/application-element.html#requiredAccountType">{@code
+android:requiredAccountType}</a> attribute in your manifest's <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code &lt;application>}</a>
element.</p>
-<p>If you’d like to allow restricted profiles to continue using your app even though they can’t
-create their own accounts, then you can either disable your app features that require an account
+<p>If you’d like to allow restricted profiles to continue using your app even though they can’t
+create their own accounts, then you can either disable your app features that require an account
or allow restricted profiles to access the accounts created by the primary user. For more
-information, see the section
+information, see the section
below about <a href="#AccountsInProfile">Supporting accounts in a restricted profile</a>.</p>
@@ -218,67 +217,67 @@ below about <a href="#AccountsInProfile">Supporting accounts in a restricted pro
<h2 id="RestrictedProfiles">Restricted Profiles</h2>
-<p>On Android tablets, users can now create restricted profiles based on the primary user.
+<p>On Android tablets, users can now create restricted profiles based on the primary user.
When users create a restricted profile, they can enable restrictions such as which apps are
available to the profile. A new set of APIs in Android 4.3 also allow you to build fine-grain
-restriction settings for the apps you develop. For example, by using the new APIs, you can
-allow users to control what type of content is available within your app when running in a
+restriction settings for the apps you develop. For example, by using the new APIs, you can
+allow users to control what type of content is available within your app when running in a
restricted profile environment.</p>
-<p>The UI for users to control the restrictions you've built is managed by the system's
+<p>The UI for users to control the restrictions you've built is managed by the system's
Settings application. To make your app's restriction settings appear to the user,
-you must declare the restrictions your app provides by creating a {@link
-android.content.BroadcastReceiver} that receives the {@link android.content.Intent#ACTION_GET_RESTRICTION_ENTRIES} intent. The system invokes this intent to query
-all apps for available restrictions, then builds the UI to allow the primary user to
+you must declare the restrictions your app provides by creating a {@link
+android.content.BroadcastReceiver} that receives the {@link android.content.Intent#ACTION_GET_RESTRICTION_ENTRIES} intent. The system invokes this intent to query
+all apps for available restrictions, then builds the UI to allow the primary user to
manage restrictions for each restricted profile. </p>
-<p>In the {@link android.content.BroadcastReceiver#onReceive onReceive()} method of
-your {@link android.content.BroadcastReceiver}, you must create a {@link
-android.content.RestrictionEntry} for each restriction your app provides. Each {@link
-android.content.RestrictionEntry} defines a restriction title, description, and one of the
+<p>In the {@link android.content.BroadcastReceiver#onReceive onReceive()} method of
+your {@link android.content.BroadcastReceiver}, you must create a {@link
+android.content.RestrictionEntry} for each restriction your app provides. Each {@link
+android.content.RestrictionEntry} defines a restriction title, description, and one of the
following data types:</p>
<ul>
- <li>{@link android.content.RestrictionEntry#TYPE_BOOLEAN} for a restriction that is
+ <li>{@link android.content.RestrictionEntry#TYPE_BOOLEAN} for a restriction that is
either true or false.
- <li>{@link android.content.RestrictionEntry#TYPE_CHOICE} for a restriction that has
+ <li>{@link android.content.RestrictionEntry#TYPE_CHOICE} for a restriction that has
multiple choices that are mutually exclusive (radio button choices).
- <li>{@link android.content.RestrictionEntry#TYPE_MULTI_SELECT} for a restriction that
+ <li>{@link android.content.RestrictionEntry#TYPE_MULTI_SELECT} for a restriction that
has multiple choices that are <em>not</em> mutually exclusive (checkbox choices).
</ul>
-<p>You then put all the {@link android.content.RestrictionEntry} objects into an {@link
-java.util.ArrayList} and put it into the broadcast receiver's result as the value for the
+<p>You then put all the {@link android.content.RestrictionEntry} objects into an {@link
+java.util.ArrayList} and put it into the broadcast receiver's result as the value for the
{@link android.content.Intent#EXTRA_RESTRICTIONS_LIST} extra.</p>
-<p>The system creates the UI for your app's restrictions in the Settings app and saves each
-restriction with the unique key you provided for each {@link android.content.RestrictionEntry}
-object. When the user opens your app, you can query for any current restrictions by
-calling {@link android.os.UserManager#getApplicationRestrictions getApplicationRestrictions()}.
+<p>The system creates the UI for your app's restrictions in the Settings app and saves each
+restriction with the unique key you provided for each {@link android.content.RestrictionEntry}
+object. When the user opens your app, you can query for any current restrictions by
+calling {@link android.os.UserManager#getApplicationRestrictions getApplicationRestrictions()}.
This returns a {@link android.os.Bundle} containing the key-value pairs for each restriction
you defined with the {@link android.content.RestrictionEntry} objects.</p>
-<p>If you want to provide more specific restrictions that can't be handled by boolean, single
-choice, and multi-choice values, then you can create an activity where the user can specify the
-restrictions and allow users to open that activity from the restriction settings. In your
-broadcast receiver, include the {@link android.content.Intent#EXTRA_RESTRICTIONS_INTENT} extra
+<p>If you want to provide more specific restrictions that can't be handled by boolean, single
+choice, and multi-choice values, then you can create an activity where the user can specify the
+restrictions and allow users to open that activity from the restriction settings. In your
+broadcast receiver, include the {@link android.content.Intent#EXTRA_RESTRICTIONS_INTENT} extra
in the result {@link android.os.Bundle}. This extra must specify an {@link android.content.Intent}
-indicating the {@link android.app.Activity} class to launch (use the
-{@link android.os.Bundle#putParcelable putParcelable()} method to pass {@link
+indicating the {@link android.app.Activity} class to launch (use the
+{@link android.os.Bundle#putParcelable putParcelable()} method to pass {@link
android.content.Intent#EXTRA_RESTRICTIONS_INTENT} with the intent).
-When the primary user enters your activity to set custom restrictions, your
-activity must then return a result containing the restriction values in an extra using either
-the {@link android.content.Intent#EXTRA_RESTRICTIONS_LIST} or {@link
+When the primary user enters your activity to set custom restrictions, your
+activity must then return a result containing the restriction values in an extra using either
+the {@link android.content.Intent#EXTRA_RESTRICTIONS_LIST} or {@link
android.content.Intent#EXTRA_RESTRICTIONS_BUNDLE} key, depending on whether you specify
{@link android.content.RestrictionEntry} objects or key-value pairs, respectively.</p>
<h3 id="AccountsInProfile">Supporting accounts in a restricted profile</h3>
-<p>Any accounts added to the primary user are available to a restricted profile, but the
-accounts are not accessible from the {@link android.accounts.AccountManager} APIs by default.
+<p>Any accounts added to the primary user are available to a restricted profile, but the
+accounts are not accessible from the {@link android.accounts.AccountManager} APIs by default.
If you attempt to add an account with {@link android.accounts.AccountManager} while in a restricted
-profile, you will get a failure result. Due to these restrictions, you have the following
+profile, you will get a failure result. Due to these restrictions, you have the following
three options:</p>
<li><strong>Allow access to the owner’s accounts from a restricted profile.</strong>
@@ -289,21 +288,25 @@ href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application>
android:restrictedAccountType="com.example.account.type" >
</pre>
-<p class="caution"><strong>Caution:</strong> Enabling this attribute provides your
-app access to the primary user's accounts from restricted profiles. So you should allow this
+<p class="caution"><strong>Caution:</strong> Enabling this attribute provides your
+app access to the primary user's accounts from restricted profiles. So you should allow this
only if the information displayed by your app does not reveal personally identifiable
-information (PII) that’s considered sensitive.</p>
+information (PII) that’s considered sensitive. The system settings will inform the primary
+user that your app grants restricted profiles to their accounts, so it should be clear to the user
+that account access is important for your app's functionality. If possible, you should also
+provide adequate restriction controls for the primary user that define how much account access
+is allowed in your app.</p>
</li>
<li><strong>Disable certain functionality when unable to modify accounts.</strong>
-<p>If you want to use accounts, but don’t actually require them for your app’s primary
-functionality, you can check for account availability and disable features when not available.
-You should first check if there is an existing account available. If not, then query whether
-it’s possible to create a new account by calling {@link
-android.os.UserManager#getUserRestrictions()} and check the {@link
-android.os.UserManager#DISALLOW_MODIFY_ACCOUNTS} extra in the result. If it is {@code true},
-then you should disable whatever functionality of your app requires access to accounts.
+<p>If you want to use accounts, but don’t actually require them for your app’s primary
+functionality, you can check for account availability and disable features when not available.
+You should first check if there is an existing account available. If not, then query whether
+it’s possible to create a new account by calling {@link
+android.os.UserManager#getUserRestrictions()} and check the {@link
+android.os.UserManager#DISALLOW_MODIFY_ACCOUNTS} extra in the result. If it is {@code true},
+then you should disable whatever functionality of your app requires access to accounts.
For example:</p>
<pre>
UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
@@ -312,15 +315,15 @@ if (restrictions.getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS, false)) {
// cannot add accounts, disable some functionality
}
</pre>
-<p class="note"><strong>Note:</strong> In this scenario, you should <em>not</em> declare
+<p class="note"><strong>Note:</strong> In this scenario, you should <em>not</em> declare
any new attributes in your manifest file.</p>
</li>
<li><strong>Disable your app when unable to access private accounts.</strong>
-<p>If it’s instead important that your app not be available to restricted profiles because
-your app depends on sensitive personal information in an account (and because restricted profiles
+<p>If it’s instead important that your app not be available to restricted profiles because
+your app depends on sensitive personal information in an account (and because restricted profiles
currently cannot add new accounts), add
-the <a href="{@docRoot}guide/topics/manifest/application-element.html#requiredAccountType">{@code
+the <a href="{@docRoot}guide/topics/manifest/application-element.html#requiredAccountType">{@code
android:requiredAccountType}</a> attribute to the <a
href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application></a> tag:</p>
<pre>
@@ -338,11 +341,11 @@ because the owner's personal email should not be available to restricted profile
<h3 id="BTLE">Bluetooth Low Energy (Smart Ready)</h3>
-<p>Android now supports Bluetooth Low Energy (LE) with new APIs in {@link android.bluetooth}.
-With the new APIs, you can build Android apps that communicate with Bluetooth Low Energy
+<p>Android now supports Bluetooth Low Energy (LE) with new APIs in {@link android.bluetooth}.
+With the new APIs, you can build Android apps that communicate with Bluetooth Low Energy
peripherals such as heart rate monitors and pedometers.</p>
-<p>Because Bluetooth LE is a hardware feature that is not available on all
+<p>Because Bluetooth LE is a hardware feature that is not available on all
Android-powered devices, you must declare in your manifest file a <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature>}</a>
element for {@code "android.hardware.bluetooth_le"}:</p>
@@ -350,11 +353,11 @@ element for {@code "android.hardware.bluetooth_le"}:</p>
&lt;uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
</pre>
-<p>If you're already familiar with Android's Classic Bluetooth APIs, notice that using the
-Bluetooth LE APIs has some differences. Most importantly is that there's now a {@link
-android.bluetooth.BluetoothManager} class that you should use for some high level operations
-such as acquiring a {@link android.bluetooth.BluetoothAdapter}, getting a list of connected
-devices, and checking the state of a device. For example, here's how you should now get the
+<p>If you're already familiar with Android's Classic Bluetooth APIs, notice that using the
+Bluetooth LE APIs has some differences. Most importantly is that there's now a {@link
+android.bluetooth.BluetoothManager} class that you should use for some high level operations
+such as acquiring a {@link android.bluetooth.BluetoothAdapter}, getting a list of connected
+devices, and checking the state of a device. For example, here's how you should now get the
{@link android.bluetooth.BluetoothAdapter}:</p>
<pre>
final BluetoothManager bluetoothManager =
@@ -362,32 +365,32 @@ final BluetoothManager bluetoothManager =
mBluetoothAdapter = bluetoothManager.getAdapter();
</pre>
-<p>To discover Bluetooth LE peripherals, call {@link android.bluetooth.BluetoothAdapter#startLeScan
-startLeScan()} on the {@link android.bluetooth.BluetoothAdapter}, passing it an implementation
-of the {@link android.bluetooth.BluetoothAdapter.LeScanCallback} interface. When the Bluetooth
-adapter detects a Bluetooth LE peripheral, your {@link
-android.bluetooth.BluetoothAdapter.LeScanCallback} implementation receives a call to the
-{@link android.bluetooth.BluetoothAdapter.LeScanCallback#onLeScan onLeScan()} method. This
-method provides you with a {@link android.bluetooth.BluetoothDevice} object representing the
-detected device, the RSSI value for the device, and a byte array containing the device's
+<p>To discover Bluetooth LE peripherals, call {@link android.bluetooth.BluetoothAdapter#startLeScan
+startLeScan()} on the {@link android.bluetooth.BluetoothAdapter}, passing it an implementation
+of the {@link android.bluetooth.BluetoothAdapter.LeScanCallback} interface. When the Bluetooth
+adapter detects a Bluetooth LE peripheral, your {@link
+android.bluetooth.BluetoothAdapter.LeScanCallback} implementation receives a call to the
+{@link android.bluetooth.BluetoothAdapter.LeScanCallback#onLeScan onLeScan()} method. This
+method provides you with a {@link android.bluetooth.BluetoothDevice} object representing the
+detected device, the RSSI value for the device, and a byte array containing the device's
advertisement record.</p>
-<p>If you want to scan for only specific types of peripherals, you can instead call {@link
-android.bluetooth.BluetoothAdapter#startLeScan startLeScan()} and include an array of {@link
+<p>If you want to scan for only specific types of peripherals, you can instead call {@link
+android.bluetooth.BluetoothAdapter#startLeScan startLeScan()} and include an array of {@link
java.util.UUID} objects that specify the GATT services your app supports.</p>
-<p class="note"><strong>Note:</strong> You can only scan for Bluetooth LE devices <em>or</em>
-scan for Classic Bluetooth devices using previous APIs. You cannot scan for both LE and Classic
+<p class="note"><strong>Note:</strong> You can only scan for Bluetooth LE devices <em>or</em>
+scan for Classic Bluetooth devices using previous APIs. You cannot scan for both LE and Classic
Bluetooth devices at once.</p>
-<p>To then connect to a Bluetooth LE peripheral, call {@link
-android.bluetooth.BluetoothDevice#connectGatt connectGatt()} on the corresponding
-{@link android.bluetooth.BluetoothDevice} object, passing it an implementation of
-{@link android.bluetooth.BluetoothGattCallback}. Your implementation of {@link
-android.bluetooth.BluetoothGattCallback} receives callbacks regarding the connectivity
-state with the device and other events. It's during the {@link
-android.bluetooth.BluetoothGattCallback#onConnectionStateChange onConnectionStateChange()}
-callback that you can begin communicating with the device if the method passes {@link
+<p>To then connect to a Bluetooth LE peripheral, call {@link
+android.bluetooth.BluetoothDevice#connectGatt connectGatt()} on the corresponding
+{@link android.bluetooth.BluetoothDevice} object, passing it an implementation of
+{@link android.bluetooth.BluetoothGattCallback}. Your implementation of {@link
+android.bluetooth.BluetoothGattCallback} receives callbacks regarding the connectivity
+state with the device and other events. It's during the {@link
+android.bluetooth.BluetoothGattCallback#onConnectionStateChange onConnectionStateChange()}
+callback that you can begin communicating with the device if the method passes {@link
android.bluetooth.BluetoothProfile#STATE_CONNECTED} as the new state.</p>
<p>Accessing Bluetooth features on a device also requires that your app request certain
@@ -397,39 +400,39 @@ href="{@docRoot}guide/topics/connectivity/bluetooth-le.html">Bluetooth Low Energ
<h3 id="WiFiScan">Wi-Fi scan-only mode</h3>
-<p>When attempting to identify the user's location, Android may use Wi-Fi to help determine
-the location by scanning nearby access points. However, users often keep Wi-Fi turned off to
-conserve battery, resulting in location data that's less accurate. Android now includes a
-scan-only mode that allows the device Wi-Fi to scan access points to help obtain the location
+<p>When attempting to identify the user's location, Android may use Wi-Fi to help determine
+the location by scanning nearby access points. However, users often keep Wi-Fi turned off to
+conserve battery, resulting in location data that's less accurate. Android now includes a
+scan-only mode that allows the device Wi-Fi to scan access points to help obtain the location
without connecting to an access point, thus greatly reducing battery usage.</p>
-<p>If you want to acquire the user's location but Wi-Fi is currently off, you can request the
-user to enable Wi-Fi scan-only mode by calling {@link android.content.Context#startActivity
-startActivity()} with the action {@link
+<p>If you want to acquire the user's location but Wi-Fi is currently off, you can request the
+user to enable Wi-Fi scan-only mode by calling {@link android.content.Context#startActivity
+startActivity()} with the action {@link
android.net.wifi.WifiManager#ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE}.</p>
<h3 id="WiFiConfig">Wi-Fi configuration</h3>
-<p>New {@link android.net.wifi.WifiEnterpriseConfig} APIs allow enterprise-oriented services to
+<p>New {@link android.net.wifi.WifiEnterpriseConfig} APIs allow enterprise-oriented services to
automate Wi-Fi configuration for managed devices.</p>
<h3 id="QuickResponse">Quick response for incoming calls</h3>
-<p>Since Android 4.0, a feature called "Quick response" allows users to respond to incoming
-calls with an immediate text message without needing to pick up the call or unlock the device.
-Until now, these quick messages were always handled by the default Messaging app. Now any app
-can declare its capability to handle these messages by creating a {@link android.app.Service}
+<p>Since Android 4.0, a feature called "Quick response" allows users to respond to incoming
+calls with an immediate text message without needing to pick up the call or unlock the device.
+Until now, these quick messages were always handled by the default Messaging app. Now any app
+can declare its capability to handle these messages by creating a {@link android.app.Service}
with an intent filter for {@link android.telephony.TelephonyManager#ACTION_RESPOND_VIA_MESSAGE}.</p>
-<p>When the user responds to an incoming call with a quick response, the Phone app sends
-the {@link android.telephony.TelephonyManager#ACTION_RESPOND_VIA_MESSAGE} intent with a URI
-describing the recipient (the caller) and the {@link android.content.Intent#EXTRA_TEXT} extra
-with the message the user wants to send. When your service receives the intent, it should deliver
+<p>When the user responds to an incoming call with a quick response, the Phone app sends
+the {@link android.telephony.TelephonyManager#ACTION_RESPOND_VIA_MESSAGE} intent with a URI
+describing the recipient (the caller) and the {@link android.content.Intent#EXTRA_TEXT} extra
+with the message the user wants to send. When your service receives the intent, it should deliver
the message and immediately stop itself (your app should not show an activity).</p>
-<p>In order to receive this intent, you must declare the {@link
+<p>In order to receive this intent, you must declare the {@link
android.Manifest.permission#SEND_RESPOND_VIA_MESSAGE} permission.</p>
@@ -438,120 +441,120 @@ android.Manifest.permission#SEND_RESPOND_VIA_MESSAGE} permission.</p>
<h3 id="DASH">MPEG DASH support</h3>
-<p>Android now supports Dynamic Adaptive Streaming over HTTP (DASH) in accordance with the
-ISO/IEC 23009-1 standard, using existing APIs in {@link android.media.MediaCodec} and {@link
-android.media.MediaExtractor}. The framework underlying these APIs has been updated to support
-parsing of fragmented MP4 files, but your app is still responsible for parsing the MPD metadata
+<p>Android now supports Dynamic Adaptive Streaming over HTTP (DASH) in accordance with the
+ISO/IEC 23009-1 standard, using existing APIs in {@link android.media.MediaCodec} and {@link
+android.media.MediaExtractor}. The framework underlying these APIs has been updated to support
+parsing of fragmented MP4 files, but your app is still responsible for parsing the MPD metadata
and passing the individual streams to {@link android.media.MediaExtractor}.</p>
-<p>If you want to use DASH with encrypted content, notice that the {@link android.media.MediaExtractor#getSampleCryptoInfo getSampleCryptoInfo()} method returns the {@link
-android.media.MediaCodec.CryptoInfo} metadata describing the structure of each encrypted media
-sample. Also, the {@link android.media.MediaExtractor#getPsshInfo()} method has been added to
-{@link android.media.MediaExtractor} so you can access the PSSH metadata for your DASH media.
-This method returns a map of {@link java.util.UUID} objects to bytes, with the
-{@link java.util.UUID} specifying the crypto scheme, and the bytes being the data specific
+<p>If you want to use DASH with encrypted content, notice that the {@link android.media.MediaExtractor#getSampleCryptoInfo getSampleCryptoInfo()} method returns the {@link
+android.media.MediaCodec.CryptoInfo} metadata describing the structure of each encrypted media
+sample. Also, the {@link android.media.MediaExtractor#getPsshInfo()} method has been added to
+{@link android.media.MediaExtractor} so you can access the PSSH metadata for your DASH media.
+This method returns a map of {@link java.util.UUID} objects to bytes, with the
+{@link java.util.UUID} specifying the crypto scheme, and the bytes being the data specific
to that scheme.</p>
<h3 id="DRM">Media DRM</h3>
<p>The new {@link android.media.MediaDrm} class provides a modular solution for digital rights
-management (DRM) with your media content by separating DRM concerns from media playback. For
-instance, this API separation allows you to play back Widevine-encrypted content without having
-to use the Widevine media format. This DRM solution also supports DASH Common Encryption so you
+management (DRM) with your media content by separating DRM concerns from media playback. For
+instance, this API separation allows you to play back Widevine-encrypted content without having
+to use the Widevine media format. This DRM solution also supports DASH Common Encryption so you
can use a variety of DRM schemes with your streaming content.</p>
-<p>You can use {@link android.media.MediaDrm} to obtain opaque key-request messages and process
-key-response messages from the server for license acquisition and provisioning. Your app is
-responsible for handling the network communication with the servers; the {@link
+<p>You can use {@link android.media.MediaDrm} to obtain opaque key-request messages and process
+key-response messages from the server for license acquisition and provisioning. Your app is
+responsible for handling the network communication with the servers; the {@link
android.media.MediaDrm} class provides only the ability to generate and process the messages.</p>
-<p>The {@link android.media.MediaDrm} APIs are intended to be used in conjunction with the
-{@link android.media.MediaCodec} APIs that were introduced in Android 4.1 (API level 16),
-including {@link android.media.MediaCodec} for encoding and decoding your content, {@link
-android.media.MediaCrypto} for handling encrypted content, and {@link android.media.MediaExtractor}
+<p>The {@link android.media.MediaDrm} APIs are intended to be used in conjunction with the
+{@link android.media.MediaCodec} APIs that were introduced in Android 4.1 (API level 16),
+including {@link android.media.MediaCodec} for encoding and decoding your content, {@link
+android.media.MediaCrypto} for handling encrypted content, and {@link android.media.MediaExtractor}
for extracting and demuxing your content.</p>
-<p>You must first construct {@link android.media.MediaExtractor} and
-{@link android.media.MediaCodec} objects. You can then access the DRM-scheme-identifying
-{@link java.util.UUID}, typically from metadata in the content, and use it to construct an
+<p>You must first construct {@link android.media.MediaExtractor} and
+{@link android.media.MediaCodec} objects. You can then access the DRM-scheme-identifying
+{@link java.util.UUID}, typically from metadata in the content, and use it to construct an
instance of a {@link android.media.MediaDrm} object with its constructor.</p>
<h3 id="EncodingSurface">Video encoding from a Surface</h3>
-<p>Android 4.1 (API level 16) added the {@link android.media.MediaCodec} class for low-level
-encoding and decoding of media content. When encoding video, Android 4.1 required that you provide
-the media with a {@link java.nio.ByteBuffer} array, but Android 4.3 now allows you to use a {@link
-android.view.Surface} as the input to an encoder. For instance, this allows you to encode input
+<p>Android 4.1 (API level 16) added the {@link android.media.MediaCodec} class for low-level
+encoding and decoding of media content. When encoding video, Android 4.1 required that you provide
+the media with a {@link java.nio.ByteBuffer} array, but Android 4.3 now allows you to use a {@link
+android.view.Surface} as the input to an encoder. For instance, this allows you to encode input
from an existing video file or using frames generated from OpenGL ES.</p>
-<p>To use a {@link android.view.Surface} as the input to your encoder, first call {@link
-android.media.MediaCodec#configure configure()} for your {@link android.media.MediaCodec}.
-Then call {@link android.media.MediaCodec#createInputSurface()} to receive the {@link
+<p>To use a {@link android.view.Surface} as the input to your encoder, first call {@link
+android.media.MediaCodec#configure configure()} for your {@link android.media.MediaCodec}.
+Then call {@link android.media.MediaCodec#createInputSurface()} to receive the {@link
android.view.Surface} upon which you can stream your media.</p>
-<p>For example, you can use the given {@link android.view.Surface} as the window for an OpenGL
-context by passing it to {@link android.opengl.EGL14#eglCreateWindowSurface
-eglCreateWindowSurface()}. Then while rendering the surface, call {@link
-android.opengl.EGL14#eglSwapBuffers eglSwapBuffers()} to pass the frame to the {@link
+<p>For example, you can use the given {@link android.view.Surface} as the window for an OpenGL
+context by passing it to {@link android.opengl.EGL14#eglCreateWindowSurface
+eglCreateWindowSurface()}. Then while rendering the surface, call {@link
+android.opengl.EGL14#eglSwapBuffers eglSwapBuffers()} to pass the frame to the {@link
android.media.MediaCodec}.</p>
-<p>To begin encoding, call {@link android.media.MediaCodec#start()} on the {@link
-android.media.MediaCodec}. When done, call {@link android.media.MediaCodec#signalEndOfInputStream}
-to terminate encoding, and call {@link android.view.Surface#release()} on the
+<p>To begin encoding, call {@link android.media.MediaCodec#start()} on the {@link
+android.media.MediaCodec}. When done, call {@link android.media.MediaCodec#signalEndOfInputStream}
+to terminate encoding, and call {@link android.view.Surface#release()} on the
{@link android.view.Surface}.</p>
<h3 id="MediaMuxing">Media muxing</h3>
-<p>The new {@link android.media.MediaMuxer} class enables multiplexing between one audio stream
-and one video stream. These APIs serve as a counterpart to the {@link android.media.MediaExtractor}
+<p>The new {@link android.media.MediaMuxer} class enables multiplexing between one audio stream
+and one video stream. These APIs serve as a counterpart to the {@link android.media.MediaExtractor}
class added in Android 4.2 for de-multiplexing (demuxing) media.</p>
-<p>Supported output formats are defined in {@link android.media.MediaMuxer.OutputFormat}. Currently,
-MP4 is the only supported output format and {@link android.media.MediaMuxer} currently supports
+<p>Supported output formats are defined in {@link android.media.MediaMuxer.OutputFormat}. Currently,
+MP4 is the only supported output format and {@link android.media.MediaMuxer} currently supports
only one audio stream and/or one video stream at a time.</p>
-<p>{@link android.media.MediaMuxer} is mostly designed to work with {@link android.media.MediaCodec}
-so you can perform video processing through {@link android.media.MediaCodec} then save the
-output to an MP4 file through {@link android.media.MediaMuxer}. You can also use {@link
-android.media.MediaMuxer} in combination with {@link android.media.MediaExtractor} to perform
+<p>{@link android.media.MediaMuxer} is mostly designed to work with {@link android.media.MediaCodec}
+so you can perform video processing through {@link android.media.MediaCodec} then save the
+output to an MP4 file through {@link android.media.MediaMuxer}. You can also use {@link
+android.media.MediaMuxer} in combination with {@link android.media.MediaExtractor} to perform
media editing without the need to encode or decode.</p>
<h3 id="ProgressAndScrubbing">Playback progress and scrubbing for RemoteControlClient</h3>
-<p>In Android 4.0 (API level 14), the {@link android.media.RemoteControlClient} was added to
-enable media playback controls from remote control clients such as the controls available on the
-lock screen. Android 4.3 now provides the ability for such controllers to display the playback
-position and controls for scrubbing the playback. If you've enabled remote control for your
-media app with the {@link android.media.RemoteControlClient} APIs, then you can allow playback
+<p>In Android 4.0 (API level 14), the {@link android.media.RemoteControlClient} was added to
+enable media playback controls from remote control clients such as the controls available on the
+lock screen. Android 4.3 now provides the ability for such controllers to display the playback
+position and controls for scrubbing the playback. If you've enabled remote control for your
+media app with the {@link android.media.RemoteControlClient} APIs, then you can allow playback
scrubbing by implementing two new interfaces.</p>
-<p>First, you must enable the {@link
-android.media.RemoteControlClient#FLAG_KEY_MEDIA_POSITION_UPDATE} flag by passing it to
-{@link android.media.RemoteControlClient#setTransportControlFlags setTransportControlsFlags()}.</p>
+<p>First, you must enable the {@link
+android.media.RemoteControlClient#FLAG_KEY_MEDIA_POSITION_UPDATE} flag by passing it to
+{@link android.media.RemoteControlClient#setTransportControlFlags setTransportControlsFlags()}.</p>
<p>Then implement the following two new interfaces:</p>
<dl>
<dt>{@link android.media.RemoteControlClient.OnGetPlaybackPositionListener}</dt>
- <dd>This includes the callback {@link android.media.RemoteControlClient.OnGetPlaybackPositionListener#onGetPlaybackPosition}, which requests the current position
+ <dd>This includes the callback {@link android.media.RemoteControlClient.OnGetPlaybackPositionListener#onGetPlaybackPosition}, which requests the current position
of your media when the remote control needs to update the progress in its UI.</dd>
<dt>{@link android.media.RemoteControlClient.OnPlaybackPositionUpdateListener}</dt>
- <dd>This includes the callback {@link android.media.RemoteControlClient.OnPlaybackPositionUpdateListener#onPlaybackPositionUpdate onPlaybackPositionUpdate()}, which
- tells your app the new time code for your media when the user scrubs the playback with the
+ <dd>This includes the callback {@link android.media.RemoteControlClient.OnPlaybackPositionUpdateListener#onPlaybackPositionUpdate onPlaybackPositionUpdate()}, which
+ tells your app the new time code for your media when the user scrubs the playback with the
remote control UI.
- <p>Once you update your playback with the new position, call {@link
- android.media.RemoteControlClient#setPlaybackState setPlaybackState()} to indicate the
+ <p>Once you update your playback with the new position, call {@link
+ android.media.RemoteControlClient#setPlaybackState setPlaybackState()} to indicate the
new playback state, position, and speed.</p>
</dd>
</dl>
-<p>With these interfaces defined, you can set them for your {@link
-android.media.RemoteControlClient} by calling {@link android.media.RemoteControlClient#setOnGetPlaybackPositionListener setOnGetPlaybackPositionListener()} and
-{@link android.media.RemoteControlClient#setPlaybackPositionUpdateListener
+<p>With these interfaces defined, you can set them for your {@link
+android.media.RemoteControlClient} by calling {@link android.media.RemoteControlClient#setOnGetPlaybackPositionListener setOnGetPlaybackPositionListener()} and
+{@link android.media.RemoteControlClient#setPlaybackPositionUpdateListener
setPlaybackPositionUpdateListener()}, respectively.</p>
@@ -560,7 +563,7 @@ setPlaybackPositionUpdateListener()}, respectively.</p>
<h3 id="OpenGL">Support for OpenGL ES 3.0</h3>
-<p>Android 4.3 adds Java interfaces and native support for OpenGL ES 3.0. Key new functionality
+<p>Android 4.3 adds Java interfaces and native support for OpenGL ES 3.0. Key new functionality
provided in OpenGL ES 3.0 includes:</p>
<ul>
<li>Acceleration of advanced visual effects</li>
@@ -570,8 +573,8 @@ provided in OpenGL ES 3.0 includes:</p>
<li>Broader standardization of texture size and render-buffer formats</li>
</ul>
-<p>The Java interface for OpenGL ES 3.0 on Android is provided with {@link android.opengl.GLES30}.
-When using OpenGL ES 3.0, be sure that you declare it in your manifest file with the
+<p>The Java interface for OpenGL ES 3.0 on Android is provided with {@link android.opengl.GLES30}.
+When using OpenGL ES 3.0, be sure that you declare it in your manifest file with the
<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">&lt;uses-feature></a>
tag and the {@code android:glEsVersion} attribute. For example:</p>
<pre>
@@ -586,16 +589,16 @@ tag and the {@code android:glEsVersion} attribute. For example:</p>
<h3 id="MipMap">Mipmapping for drawables</h3>
-<p>Using a mipmap as the source for your bitmap or drawable is a simple way to provide a
-quality image and various image scales, which can be particularly useful if you expect your
+<p>Using a mipmap as the source for your bitmap or drawable is a simple way to provide a
+quality image and various image scales, which can be particularly useful if you expect your
image to be scaled during an animation.</p>
-<p>Android 4.2 (API level 17) added support for mipmaps in the {@link android.graphics.Bitmap}
-class&mdash;Android swaps the mip images in your {@link android.graphics.Bitmap} when you've
-supplied a mipmap source and have enabled {@link android.graphics.Bitmap#setHasMipMap
-setHasMipMap()}. Now in Android 4.3, you can enable mipmaps for a {@link
-android.graphics.drawable.BitmapDrawable} object as well, by providing a mipmap asset and
-setting the {@code android:mipMap} attribute in a bitmap resource file or by calling {@link
+<p>Android 4.2 (API level 17) added support for mipmaps in the {@link android.graphics.Bitmap}
+class&mdash;Android swaps the mip images in your {@link android.graphics.Bitmap} when you've
+supplied a mipmap source and have enabled {@link android.graphics.Bitmap#setHasMipMap
+setHasMipMap()}. Now in Android 4.3, you can enable mipmaps for a {@link
+android.graphics.drawable.BitmapDrawable} object as well, by providing a mipmap asset and
+setting the {@code android:mipMap} attribute in a bitmap resource file or by calling {@link
android.graphics.drawable.BitmapDrawable#hasMipMap hasMipMap()}.
</p>
@@ -605,36 +608,36 @@ android.graphics.drawable.BitmapDrawable#hasMipMap hasMipMap()}.
<h3 id="ViewOverlay">View overlays</h3>
-<p>The new {@link android.view.ViewOverlay} class provides a transparent layer on top of
-a {@link android.view.View} on which you can add visual content and which does not affect
-the layout hierarchy. You can get a {@link android.view.ViewOverlay} for any {@link
-android.view.View} by calling {@link android.view.View#getOverlay}. The overlay
-always has the same size and position as its host view (the view from which it was created),
-allowing you to add content that appears in front of the host view, but which cannot extend
+<p>The new {@link android.view.ViewOverlay} class provides a transparent layer on top of
+a {@link android.view.View} on which you can add visual content and which does not affect
+the layout hierarchy. You can get a {@link android.view.ViewOverlay} for any {@link
+android.view.View} by calling {@link android.view.View#getOverlay}. The overlay
+always has the same size and position as its host view (the view from which it was created),
+allowing you to add content that appears in front of the host view, but which cannot extend
the bounds of that host view.
</p>
-<p>Using a {@link android.view.ViewOverlay} is particularly useful when you want to create
-animations such as sliding a view outside of its container or moving items around the screen
-without affecting the view hierarchy. However, because the usable area of an overlay is
-restricted to the same area as its host view, if you want to animate a view moving outside
-its position in the layout, you must use an overlay from a parent view that has the desired
+<p>Using a {@link android.view.ViewOverlay} is particularly useful when you want to create
+animations such as sliding a view outside of its container or moving items around the screen
+without affecting the view hierarchy. However, because the usable area of an overlay is
+restricted to the same area as its host view, if you want to animate a view moving outside
+its position in the layout, you must use an overlay from a parent view that has the desired
layout bounds.</p>
-<p>When you create an overlay for a widget view such as a {@link android.widget.Button}, you
-can add {@link android.graphics.drawable.Drawable} objects to the overlay by calling
-{@link android.view.ViewOverlay#add(Drawable)}. If you call {@link
+<p>When you create an overlay for a widget view such as a {@link android.widget.Button}, you
+can add {@link android.graphics.drawable.Drawable} objects to the overlay by calling
+{@link android.view.ViewOverlay#add(Drawable)}. If you call {@link
android.view.ViewGroup#getOverlay} for a layout view, such as {@link android.widget.RelativeLayout},
the object returned is a {@link android.view.ViewGroupOverlay}. The
-{@link android.view.ViewGroupOverlay} class is a subclass
-of {@link android.view.ViewOverlay} that also allows you to add {@link android.view.View}
+{@link android.view.ViewGroupOverlay} class is a subclass
+of {@link android.view.ViewOverlay} that also allows you to add {@link android.view.View}
objects by calling {@link android.view.ViewGroupOverlay#add(View)}.
</p>
-<p class="note"><strong>Note:</strong> All drawables and views that you add to an overlay
+<p class="note"><strong>Note:</strong> All drawables and views that you add to an overlay
are visual only. They cannot receive focus or input events.</p>
-<p>For example, the following code animates a view sliding to the right by placing the view
+<p>For example, the following code animates a view sliding to the right by placing the view
in the parent view's overlay, then performing a translation animation on that view:</p>
<pre>
View view = findViewById(R.id.view_to_remove);
@@ -647,17 +650,17 @@ anim.start();
<h3 id="OpticalBounds">Optical bounds layout</h3>
-<p>For views that contain nine-patch background images, you can now specify that they should
-be aligned with neighboring views based on the "optical" bounds of the background image rather
+<p>For views that contain nine-patch background images, you can now specify that they should
+be aligned with neighboring views based on the "optical" bounds of the background image rather
than the "clip" bounds of the view.</p>
-<p>For example, figures 1 and 2 each show the same layout, but the version in figure 1 is
-using clip bounds (the default behavior), while figure 2 is using optical bounds. Because the
-nine-patch images used for the button and the photo frame include padding around the edges,
+<p>For example, figures 1 and 2 each show the same layout, but the version in figure 1 is
+using clip bounds (the default behavior), while figure 2 is using optical bounds. Because the
+nine-patch images used for the button and the photo frame include padding around the edges,
they don’t appear to align with each other or the text when using clip bounds.</p>
-<p class="note"><strong>Note:</strong> The screenshot in figures 1 and 2 have the "Show
-layout bounds" developer setting enabled. For each view, red lines indicate the optical
+<p class="note"><strong>Note:</strong> The screenshot in figures 1 and 2 have the "Show
+layout bounds" developer setting enabled. For each view, red lines indicate the optical
bounds, blue lines indicate the clip bounds, and pink indicates margins.</p>
<script type="text/javascript">
@@ -725,30 +728,30 @@ optical bounds.
</p>
</div>
-<p>For this to work, the nine-patch images applied to the background of your views must specify
-the optical bounds using red lines along the bottom and right-side of the nine-patch file (as
-shown in figure 3). The red lines indicate the region that should be subtracted from
+<p>For this to work, the nine-patch images applied to the background of your views must specify
+the optical bounds using red lines along the bottom and right-side of the nine-patch file (as
+shown in figure 3). The red lines indicate the region that should be subtracted from
the clip bounds, leaving the optical bounds of the image.</p>
-<p>When you enable optical bounds for a {@link android.view.ViewGroup} in your layout, all
-descendant views inherit the optical bounds layout mode unless you override it for a group by
-setting {@code android:layoutMode} to {@code "clipBounds"}. All layout elements also honor the
-optical bounds of their child views, adapting their own bounds based on the optical bounds of
-the views within them. However, layout elements (subclasses of {@link android.view.ViewGroup})
+<p>When you enable optical bounds for a {@link android.view.ViewGroup} in your layout, all
+descendant views inherit the optical bounds layout mode unless you override it for a group by
+setting {@code android:layoutMode} to {@code "clipBounds"}. All layout elements also honor the
+optical bounds of their child views, adapting their own bounds based on the optical bounds of
+the views within them. However, layout elements (subclasses of {@link android.view.ViewGroup})
currently do not support optical bounds for nine-patch images applied to their own background.</p>
<p>If you create a custom view by subclassing {@link android.view.View}, {@link android.view.ViewGroup}, or any subclasses thereof, your view will inherit these optical bound behaviors.</p>
<p class="note"><strong>Note:</strong> All widgets supported by the Holo theme have been updated
-with optical bounds, including {@link android.widget.Button}, {@link android.widget.Spinner},
+with optical bounds, including {@link android.widget.Button}, {@link android.widget.Spinner},
{@link android.widget.EditText}, and others. So you can immediately benefit by setting the
-{@code android:layoutMode} attribute to {@code "opticalBounds"} if your app applies a Holo theme
-({@link android.R.style#Theme_Holo Theme.Holo}, {@link android.R.style#Theme_Holo_Light
+{@code android:layoutMode} attribute to {@code "opticalBounds"} if your app applies a Holo theme
+({@link android.R.style#Theme_Holo Theme.Holo}, {@link android.R.style#Theme_Holo_Light
Theme.Holo.Light}, etc.).
</p>
-<p>To specify optical bounds for your own nine-patch images with the <a
-href="{@docRoot}tools/help/draw9patch.html">Draw 9-patch</a> tool, hold CTRL when clicking on
+<p>To specify optical bounds for your own nine-patch images with the <a
+href="{@docRoot}tools/help/draw9patch.html">Draw 9-patch</a> tool, hold CTRL when clicking on
the border pixels.</p>
@@ -756,59 +759,59 @@ the border pixels.</p>
<h3 id="AnimationRect">Animation for Rect values</h3>
-<p>You can now animate between two {@link android.graphics.Rect} values with the new {@link
-android.animation.RectEvaluator}. This new class is an implementation of {@link
-android.animation.TypeEvaluator} that you can pass to {@link
+<p>You can now animate between two {@link android.graphics.Rect} values with the new {@link
+android.animation.RectEvaluator}. This new class is an implementation of {@link
+android.animation.TypeEvaluator} that you can pass to {@link
android.animation.ValueAnimator#setEvaluator ValueAnimator.setEvaluator()}.
</p>
<h3 id="AttachFocus">Window attach and focus listener</h3>
-<p>Previously, if you wanted to listen for when your view attached/detached to the window or
-when its focus changed, you needed to override the {@link android.view.View} class to
-implement {@link android.view.View#onAttachedToWindow onAttachedToWindow()} and {@link
-android.view.View#onDetachedFromWindow onDetachedFromWindow()}, or {@link
+<p>Previously, if you wanted to listen for when your view attached/detached to the window or
+when its focus changed, you needed to override the {@link android.view.View} class to
+implement {@link android.view.View#onAttachedToWindow onAttachedToWindow()} and {@link
+android.view.View#onDetachedFromWindow onDetachedFromWindow()}, or {@link
android.view.View#onWindowFocusChanged onWindowFocusChanged()}, respectively.
</p>
-<p>Now, to receive attach and detach events you can instead implement {@link
-android.view.ViewTreeObserver.OnWindowAttachListener} and set it on a view with
-{@link android.view.ViewTreeObserver#addOnWindowAttachListener addOnWindowAttachListener()}.
-And to receive focus events, you can implement {@link
-android.view.ViewTreeObserver.OnWindowFocusChangeListener} and set it on a view with
-{@link android.view.ViewTreeObserver#addOnWindowFocusChangeListener
+<p>Now, to receive attach and detach events you can instead implement {@link
+android.view.ViewTreeObserver.OnWindowAttachListener} and set it on a view with
+{@link android.view.ViewTreeObserver#addOnWindowAttachListener addOnWindowAttachListener()}.
+And to receive focus events, you can implement {@link
+android.view.ViewTreeObserver.OnWindowFocusChangeListener} and set it on a view with
+{@link android.view.ViewTreeObserver#addOnWindowFocusChangeListener
addOnWindowFocusChangeListener()}.
</p>
<h3 id="Overscan">TV overscan support</h3>
-<p>To be sure your app fills the entire screen on every television, you can now enable overscan
-for you app layout. Overscan mode is determined by the {@link android.view.WindowManager.LayoutParams#FLAG_LAYOUT_IN_OVERSCAN} flag, which you can enable with platform themes such as
-{@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan} or by enabling the
+<p>To be sure your app fills the entire screen on every television, you can now enable overscan
+for you app layout. Overscan mode is determined by the {@link android.view.WindowManager.LayoutParams#FLAG_LAYOUT_IN_OVERSCAN} flag, which you can enable with platform themes such as
+{@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan} or by enabling the
{@link android.R.attr#windowOverscan} style in a custom theme.</p>
<h3 id="Orientation">Screen orientation</h3>
-<p>The <a
+<p>The <a
href="{@docRoot}guide/topics/manifest/activity-element.html">{@code &lt;activity>}</a>
-tag's <a
+tag's <a
href="{@docRoot}guide/topics/manifest/activity-element.html#screen">{@code screenOrientation}</a>
attribute now supports additional values to honor the user's preference for auto-rotation:</p>
<dl>
<dt>{@code "userLandscape"}</dt>
-<dd>Behaves the same as {@code "sensorLandscape"}, except if the user disables auto-rotate
+<dd>Behaves the same as {@code "sensorLandscape"}, except if the user disables auto-rotate
then it locks in the normal landscape orientation and will not flip.
</dd>
<dt>{@code "userPortrait"}</dt>
-<dd>Behaves the same as {@code "sensorPortrait"}, except if the user disables auto-rotate then
+<dd>Behaves the same as {@code "sensorPortrait"}, except if the user disables auto-rotate then
it locks in the normal portrait orientation and will not flip.
</dd>
<dt>{@code "fullUser"}</dt>
-<dd>Behaves the same as {@code "fullSensor"} and allows rotation in all four directions, except
+<dd>Behaves the same as {@code "fullSensor"} and allows rotation in all four directions, except
if the user disables auto-rotate then it locks in the user's preferred orientation.
</dd></dl>
@@ -818,8 +821,8 @@ the screen's current orientation.</p>
<h3 id="RotationAnimation">Rotation animations</h3>
-<p>The new {@link android.view.WindowManager.LayoutParams#rotationAnimation} field in
-{@link android.view.WindowManager} allows you to select between one of three animations you
+<p>The new {@link android.view.WindowManager.LayoutParams#rotationAnimation} field in
+{@link android.view.WindowManager} allows you to select between one of three animations you
want to use when the system switches screen orientations. The three animations are:</p>
<ul>
<li>{@link android.view.WindowManager.LayoutParams#ROTATION_ANIMATION_CROSSFADE}</li>
@@ -844,25 +847,17 @@ protected void onCreate(Bundle savedInstanceState) {
<h2 id="UserInput">User Input</h2>
-<h3 id="SignificantMotion">Detect significant motion</h3>
-
-<p>The {@link android.hardware.SensorManager} APIs now allow you to request a callback when the
-device sensors detect "significant motion." For instance, this event may be triggered by new
-motion such as when the user starts to walk.</p>
-
-<p>To register a listener for significant motion, extend the {@link android.hardware.TriggerEventListener} class and implement the {@link android.hardware.TriggerEventListener#onTrigger onTrigger()} callback method. Then register your event listener with the {@link android.hardware.SensorManager} by passing it to {@link android.hardware.SensorManager#requestTriggerSensor requestTriggerSensor()}, passing it your {@link android.hardware.TriggerEventListener} and {@link android.hardware.Sensor#TYPE_SIGNIFICANT_MOTION}.</p>
-
<h3 id="Sensors">New sensor types</h3>
<p>The new {@link android.hardware.Sensor#TYPE_GAME_ROTATION_VECTOR} sensor allows you to detect the device's rotations without worrying about magnetic interferences. Unlike the {@link android.hardware.Sensor#TYPE_ROTATION_VECTOR} sensor, the {@link android.hardware.Sensor#TYPE_GAME_ROTATION_VECTOR} is not based on magnetic north.</p>
-<p>The new {@link android.hardware.Sensor#TYPE_GYROSCOPE_UNCALIBRATED} and {@link
-android.hardware.Sensor#TYPE_MAGNETIC_FIELD_UNCALIBRATED} sensors provide raw sensor data without
-consideration for bias estimations. That is, the existing {@link
-android.hardware.Sensor#TYPE_GYROSCOPE} and {@link android.hardware.Sensor#TYPE_MAGNETIC_FIELD}
-sensors provide sensor data that takes into account estimated bias from gyro-drift and hard iron
-in the device, respectively. Whereas the new "uncalibrated" versions of these sensors instead provide
-the raw sensor data and offer the estimated bias values separately. These sensors allow you to
-provide your own custom calibration for the sensor data by enhancing the estimated bias with
+<p>The new {@link android.hardware.Sensor#TYPE_GYROSCOPE_UNCALIBRATED} and {@link
+android.hardware.Sensor#TYPE_MAGNETIC_FIELD_UNCALIBRATED} sensors provide raw sensor data without
+consideration for bias estimations. That is, the existing {@link
+android.hardware.Sensor#TYPE_GYROSCOPE} and {@link android.hardware.Sensor#TYPE_MAGNETIC_FIELD}
+sensors provide sensor data that takes into account estimated bias from gyro-drift and hard iron
+in the device, respectively. Whereas the new "uncalibrated" versions of these sensors instead provide
+the raw sensor data and offer the estimated bias values separately. These sensors allow you to
+provide your own custom calibration for the sensor data by enhancing the estimated bias with
external data.</p>
@@ -891,13 +886,13 @@ external data.</p>
<p>To track which contacts have been deleted, the new table {@link android.provider.ContactsContract.DeletedContacts} provides a log of contacts that have been deleted (but each contact deleted is held in this table for a limited time). Similar to {@link android.provider.ContactsContract.ContactsColumns#CONTACT_LAST_UPDATED_TIMESTAMP}, you can use the new selection parameter, {@link android.provider.ContactsContract.DeletedContacts#CONTACT_DELETED_TIMESTAMP} to check which contacts have been deleted since the last time you queried the provider. The table also contains the constant {@link android.provider.ContactsContract.DeletedContacts#DAYS_KEPT_MILLISECONDS} containing the number of days (in milliseconds) that the log will be kept.</p>
-<p>Additionally, the Contacts Provider now broadcasts the {@link
-android.provider.ContactsContract.Intents#CONTACTS_DATABASE_CREATED} action when the user
-clears the contacts storage through the system settings menu, effectively recreating the
-Contacts Provider database. It’s intended to signal apps that they need to drop all the contact
+<p>Additionally, the Contacts Provider now broadcasts the {@link
+android.provider.ContactsContract.Intents#CONTACTS_DATABASE_CREATED} action when the user
+clears the contacts storage through the system settings menu, effectively recreating the
+Contacts Provider database. It’s intended to signal apps that they need to drop all the contact
information they’ve stored and reload it with a new query.</p>
-<p>For sample code using these APIs to check for changes to the contacts, look in the ApiDemos
+<p>For sample code using these APIs to check for changes to the contacts, look in the ApiDemos
sample available in the <a href="{@docRoot}tools/samples/index.html">SDK Samples</a> download.</p>
@@ -905,13 +900,13 @@ sample available in the <a href="{@docRoot}tools/samples/index.html">SDK Samples
<h3 id="BiDi">Improved support for bi-directional text</h3>
-<p>Previous versions of Android support right-to-left (RTL) languages and layout,
-but sometimes don't properly handle mixed-direction text. So Android 4.3 adds the {@link
-android.text.BidiFormatter} APIs that help you properly format text with opposite-direction
+<p>Previous versions of Android support right-to-left (RTL) languages and layout,
+but sometimes don't properly handle mixed-direction text. So Android 4.3 adds the {@link
+android.text.BidiFormatter} APIs that help you properly format text with opposite-direction
content without garbling any parts of it.</p>
-<p>For example, when you want to create a sentence with a string variable, such as "Did you mean
-15 Bay Street, Laurel, CA?", you normally pass a localized string resource and the variable to
+<p>For example, when you want to create a sentence with a string variable, such as "Did you mean
+15 Bay Street, Laurel, CA?", you normally pass a localized string resource and the variable to
{@link java.lang.String#format String.format()}:</p>
<pre>
Resources res = getResources();
@@ -922,8 +917,8 @@ String suggestion = String.format(res.getString(R.string.did_you_mean), address)
<p dir="rtl">האם התכוונת ל 15 Bay Street, Laurel, CA?</p>
-<p>That's wrong because the "15" should be left of "Bay Street." The solution is to use {@link
-android.text.BidiFormatter} and its {@link android.text.BidiFormatter#unicodeWrap(String)
+<p>That's wrong because the "15" should be left of "Bay Street." The solution is to use {@link
+android.text.BidiFormatter} and its {@link android.text.BidiFormatter#unicodeWrap(String)
unicodeWrap()} method. For example, the code above becomes:</p>
<pre>
Resources res = getResources();
@@ -933,11 +928,11 @@ String suggestion = String.format(res.getString(R.string.did_you_mean),
</pre>
<p>
-By default, {@link android.text.BidiFormatter#unicodeWrap(String) unicodeWrap()} uses the
-first-strong directionality estimation heuristic, which can get things wrong if the first
-signal for text direction does not represent the appropriate direction for the content as a whole.
-If necessary, you can specify a different heuristic by passing one of the {@link
-android.text.TextDirectionHeuristic} constants from {@link android.text.TextDirectionHeuristics}
+By default, {@link android.text.BidiFormatter#unicodeWrap(String) unicodeWrap()} uses the
+first-strong directionality estimation heuristic, which can get things wrong if the first
+signal for text direction does not represent the appropriate direction for the content as a whole.
+If necessary, you can specify a different heuristic by passing one of the {@link
+android.text.TextDirectionHeuristic} constants from {@link android.text.TextDirectionHeuristics}
to {@link android.text.BidiFormatter#unicodeWrap(String,TextDirectionHeuristic) unicodeWrap()}.</p>
<p class="note"><strong>Note:</strong> These new APIs are also available for previous versions
@@ -950,31 +945,31 @@ Library</a>, with the {@link android.support.v4.text.BidiFormatter} class and re
<h3 id="A11yKeyEvents">Handle key events</h3>
-<p>An {@link android.accessibilityservice.AccessibilityService} can now receive a callback for
-key input events with the {@link android.accessibilityservice.AccessibilityService#onKeyEvent
-onKeyEvent()} callback method. This allows your accessibility service to handle input for
-key-based input devices such as a keyboard and translate those events to special actions that
+<p>An {@link android.accessibilityservice.AccessibilityService} can now receive a callback for
+key input events with the {@link android.accessibilityservice.AccessibilityService#onKeyEvent
+onKeyEvent()} callback method. This allows your accessibility service to handle input for
+key-based input devices such as a keyboard and translate those events to special actions that
previously may have been possible only with touch input or the device's directional pad.</p>
<h3 id="A11yText">Select text and copy/paste</h3>
-<p>The {@link android.view.accessibility.AccessibilityNodeInfo} now provides APIs that allow
-an {@link android.accessibilityservice.AccessibilityService} to select, cut, copy, and paste
+<p>The {@link android.view.accessibility.AccessibilityNodeInfo} now provides APIs that allow
+an {@link android.accessibilityservice.AccessibilityService} to select, cut, copy, and paste
text in a node.</p>
-<p>To specify the selection of text to cut or copy, your accessibility service can use the new
-action, {@link android.view.accessibility.AccessibilityNodeInfo#ACTION_SET_SELECTION}, passing
-with it the selection start and end position with {@link
-android.view.accessibility.AccessibilityNodeInfo#ACTION_ARGUMENT_SELECTION_START_INT} and {@link
-android.view.accessibility.AccessibilityNodeInfo#ACTION_ARGUMENT_SELECTION_END_INT}.
-Alternatively you can select text by manipulating the cursor position using the existing
-action, {@link android.view.accessibility.AccessibilityNodeInfo#ACTION_NEXT_AT_MOVEMENT_GRANULARITY}
-(previously only for moving the cursor position), and adding the argument {@link
+<p>To specify the selection of text to cut or copy, your accessibility service can use the new
+action, {@link android.view.accessibility.AccessibilityNodeInfo#ACTION_SET_SELECTION}, passing
+with it the selection start and end position with {@link
+android.view.accessibility.AccessibilityNodeInfo#ACTION_ARGUMENT_SELECTION_START_INT} and {@link
+android.view.accessibility.AccessibilityNodeInfo#ACTION_ARGUMENT_SELECTION_END_INT}.
+Alternatively you can select text by manipulating the cursor position using the existing
+action, {@link android.view.accessibility.AccessibilityNodeInfo#ACTION_NEXT_AT_MOVEMENT_GRANULARITY}
+(previously only for moving the cursor position), and adding the argument {@link
android.view.accessibility.AccessibilityNodeInfo#ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN}.</p>
-<p>You can then cut or copy with {@link android.view.accessibility.AccessibilityNodeInfo#ACTION_CUT},
-{@link android.view.accessibility.AccessibilityNodeInfo#ACTION_COPY}, then later paste with
+<p>You can then cut or copy with {@link android.view.accessibility.AccessibilityNodeInfo#ACTION_CUT},
+{@link android.view.accessibility.AccessibilityNodeInfo#ACTION_COPY}, then later paste with
{@link android.view.accessibility.AccessibilityNodeInfo#ACTION_PASTE}.</p>
@@ -987,14 +982,14 @@ class.</p>
<h3 id="A11yFeatures">Declare accessibility features</h3>
-<p>Beginning with Android 4.3, an accessibility service must declare accessibility capabilities
-in its metadata file in order to use certain accessibility features. If the capability is not
-requested in the metadata file, then the feature will be a no-op. To declare your service's
-accessibility capabilities, you must use XML attributes that correspond to the various
-"capability" constants in the {@link android.accessibilityservice.AccessibilityServiceInfo}
+<p>Beginning with Android 4.3, an accessibility service must declare accessibility capabilities
+in its metadata file in order to use certain accessibility features. If the capability is not
+requested in the metadata file, then the feature will be a no-op. To declare your service's
+accessibility capabilities, you must use XML attributes that correspond to the various
+"capability" constants in the {@link android.accessibilityservice.AccessibilityServiceInfo}
class.</p>
-<p>For example, if a service does not request the {@link android.R.styleable#AccessibilityService_canRequestFilterKeyEvents flagRequestFilterKeyEvents} capability,
+<p>For example, if a service does not request the {@link android.R.styleable#AccessibilityService_canRequestFilterKeyEvents flagRequestFilterKeyEvents} capability,
then it will not receive key events.</p>
@@ -1002,36 +997,36 @@ then it will not receive key events.</p>
<h3 id="UiAutomation">Automated UI testing</h3>
-<p>The new {@link android.app.UiAutomation} class provides APIs that allow you to simulate user
-actions for test automation. By using the platform's {@link
-android.accessibilityservice.AccessibilityService} APIs, the {@link android.app.UiAutomation}
+<p>The new {@link android.app.UiAutomation} class provides APIs that allow you to simulate user
+actions for test automation. By using the platform's {@link
+android.accessibilityservice.AccessibilityService} APIs, the {@link android.app.UiAutomation}
APIs allow you to inspect the screen content and inject arbitrary keyboard and touch events.</p>
-<p>To get an instance of {@link android.app.UiAutomation}, call {@link
-android.app.Instrumentation#getUiAutomation Instrumentation.getUiAutomation()}. In order
-for this to work, you must supply the {@code -w} option with the {@code instrument} command
-when running your {@link android.test.InstrumentationTestCase} from <a
+<p>To get an instance of {@link android.app.UiAutomation}, call {@link
+android.app.Instrumentation#getUiAutomation Instrumentation.getUiAutomation()}. In order
+for this to work, you must supply the {@code -w} option with the {@code instrument} command
+when running your {@link android.test.InstrumentationTestCase} from <a
href="{@docRoot}tools/help/adb.html#am">{@code adb shell}</a>.</p>
-<p>With the {@link android.app.UiAutomation} instance, you can execute arbitrary events to test
-your app by calling {@link android.app.UiAutomation#executeAndWaitForEvent
-executeAndWaitForEvent()}, passing it a {@link java.lang.Runnable} to perform, a timeout
-period for the operation, and an implementation of the {@link
-android.app.UiAutomation.AccessibilityEventFilter} interface. It's within your {@link
-android.app.UiAutomation.AccessibilityEventFilter} implementation that you'll receive a call
-that allows you to filter the events that you're interested in and determine the success or
+<p>With the {@link android.app.UiAutomation} instance, you can execute arbitrary events to test
+your app by calling {@link android.app.UiAutomation#executeAndWaitForEvent
+executeAndWaitForEvent()}, passing it a {@link java.lang.Runnable} to perform, a timeout
+period for the operation, and an implementation of the {@link
+android.app.UiAutomation.AccessibilityEventFilter} interface. It's within your {@link
+android.app.UiAutomation.AccessibilityEventFilter} implementation that you'll receive a call
+that allows you to filter the events that you're interested in and determine the success or
failure of a given test case.</p>
-<p>To observe all the events during a test, create an implementation of {@link
-android.app.UiAutomation.OnAccessibilityEventListener} and pass it to {@link
-android.app.UiAutomation#setOnAccessibilityEventListener setOnAccessibilityEventListener()}.
-Your listener interface then receives a call to {@link
-android.app.UiAutomation.OnAccessibilityEventListener#onAccessibilityEvent onAccessibilityEvent()}
-each time an event occurs, receiving an {@link android.view.accessibility.AccessibilityEvent} object
+<p>To observe all the events during a test, create an implementation of {@link
+android.app.UiAutomation.OnAccessibilityEventListener} and pass it to {@link
+android.app.UiAutomation#setOnAccessibilityEventListener setOnAccessibilityEventListener()}.
+Your listener interface then receives a call to {@link
+android.app.UiAutomation.OnAccessibilityEventListener#onAccessibilityEvent onAccessibilityEvent()}
+each time an event occurs, receiving an {@link android.view.accessibility.AccessibilityEvent} object
that describes the event.</p>
-<p>There is a variety of other operations that the {@link android.app.UiAutomation} APIs expose
-at a very low level to encourage the development of UI test tools such as <a href="{@docRoot}tools/help/uiautomator/index.html">uiautomator</a>. For instance,
+<p>There is a variety of other operations that the {@link android.app.UiAutomation} APIs expose
+at a very low level to encourage the development of UI test tools such as <a href="{@docRoot}tools/help/uiautomator/index.html">uiautomator</a>. For instance,
{@link android.app.UiAutomation} can also:</p>
<ul>
<li>Inject input events
@@ -1039,16 +1034,16 @@ at a very low level to encourage the development of UI test tools such as <a hre
<li>Take screenshots
</ul>
-<p>And most importantly for UI test tools, the {@link android.app.UiAutomation} APIs work
+<p>And most importantly for UI test tools, the {@link android.app.UiAutomation} APIs work
across application boundaries, unlike those in {@link android.app.Instrumentation}.</p>
<h3 id="Systrace">Systrace events for apps</h3>
-<p>Android 4.3 adds the {@link android.os.Trace} class with two static methods,
-{@link android.os.Trace#beginSection beginSection()} and {@link android.os.Trace#endSection()},
-which allow you to define blocks of code to include with the systrace report. By creating
-sections of traceable code in your app, the systrace logs provide you a much more detailed
+<p>Android 4.3 adds the {@link android.os.Trace} class with two static methods,
+{@link android.os.Trace#beginSection beginSection()} and {@link android.os.Trace#endSection()},
+which allow you to define blocks of code to include with the systrace report. By creating
+sections of traceable code in your app, the systrace logs provide you a much more detailed
analysis of where slowdown occurs within your app.</p>
<p>For information about using the Systrace tool, read <a href="{@docRoot}tools/debugging/systrace.html">Analyzing Display and Performance with Systrace</a>.</p>
@@ -1058,31 +1053,31 @@ analysis of where slowdown occurs within your app.</p>
<h3 id="KeyStore">Android key store for app-private keys</h3>
-<p>Android now offers a custom Java Security Provider in the {@link java.security.KeyStore}
-facility, called Android Key Store, which allows you to generate and save private keys that
-may be seen and used by only your app. To load the Android Key Store, pass
-{@code "AndroidKeyStore"} to {@link java.security.KeyStore#getInstance(String)
+<p>Android now offers a custom Java Security Provider in the {@link java.security.KeyStore}
+facility, called Android Key Store, which allows you to generate and save private keys that
+may be seen and used by only your app. To load the Android Key Store, pass
+{@code "AndroidKeyStore"} to {@link java.security.KeyStore#getInstance(String)
KeyStore.getInstance()}.</p>
-<p>To manage your app's private credentials in the Android Key Store, generate a new key with
-{@link java.security.KeyPairGenerator} with {@link android.security.KeyPairGeneratorSpec}. First
-get an instance of {@link java.security.KeyPairGenerator} by calling {@link
-java.security.KeyPairGenerator#getInstance getInstance()}. Then call
-{@link java.security.KeyPairGenerator#initialize initialize()}, passing it an instance of
-{@link android.security.KeyPairGeneratorSpec}, which you can get using
-{@link android.security.KeyPairGeneratorSpec.Builder KeyPairGeneratorSpec.Builder}.
-Finally, get your {@link java.security.KeyPair} by calling {@link
+<p>To manage your app's private credentials in the Android Key Store, generate a new key with
+{@link java.security.KeyPairGenerator} with {@link android.security.KeyPairGeneratorSpec}. First
+get an instance of {@link java.security.KeyPairGenerator} by calling {@link
+java.security.KeyPairGenerator#getInstance getInstance()}. Then call
+{@link java.security.KeyPairGenerator#initialize initialize()}, passing it an instance of
+{@link android.security.KeyPairGeneratorSpec}, which you can get using
+{@link android.security.KeyPairGeneratorSpec.Builder KeyPairGeneratorSpec.Builder}.
+Finally, get your {@link java.security.KeyPair} by calling {@link
java.security.KeyPairGenerator#generateKeyPair generateKeyPair()}.</p>
<h3 id="HardwareKeyChain">Hardware credential storage</h3>
-<p>Android also now supports hardware-backed storage for your {@link android.security.KeyChain}
-credentials, providing more security by making the keys unavailable for extraction. That is, once
-keys are in a hardware-backed key store (Secure Element, TPM, or TrustZone), they can be used for
-cryptographic operations but the private key material cannot be exported. Even the OS kernel
-cannot access this key material. While not all Android-powered devices support storage on
-hardware, you can check at runtime if hardware-backed storage is available by calling
+<p>Android also now supports hardware-backed storage for your {@link android.security.KeyChain}
+credentials, providing more security by making the keys unavailable for extraction. That is, once
+keys are in a hardware-backed key store (Secure Element, TPM, or TrustZone), they can be used for
+cryptographic operations but the private key material cannot be exported. Even the OS kernel
+cannot access this key material. While not all Android-powered devices support storage on
+hardware, you can check at runtime if hardware-backed storage is available by calling
{@link android.security.KeyChain#isBoundKeyAlgorithm KeyChain.IsBoundKeyAlgorithm()}.</p>
@@ -1091,9 +1086,9 @@ hardware, you can check at runtime if hardware-backed storage is available by ca
<h3 id="ManifestFeatures">Declarable required features</h3>
-<p>The following values are now supported in the <a
+<p>The following values are now supported in the <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature>}</a>
-element so you can ensure that your app is installed only on devices that provide the features
+element so you can ensure that your app is installed only on devices that provide the features
your app needs.</p>
<dl>
@@ -1137,8 +1132,8 @@ Example:
<h3 id="ManifestPermissions">User permissions</h3>
-<p>The following values are now supported in the <a
-href="{@docRoot}guide/topics/manifest/uses-permission-element.html">{@code &lt;uses-permission>}</a>
+<p>The following values are now supported in the <a
+href="{@docRoot}guide/topics/manifest/uses-permission-element.html">{@code &lt;uses-permission>}</a>
to declare the
permissions your app requires in order to access certain APIs.</p>
diff --git a/docs/html/about/versions/jelly-bean.jd b/docs/html/about/versions/jelly-bean.jd
index 5812f3db2f5c..985a26634b17 100644
--- a/docs/html/about/versions/jelly-bean.jd
+++ b/docs/html/about/versions/jelly-bean.jd
@@ -1,8 +1,10 @@
page.title=Jelly Bean
-tab1=Android 4.2
-tab1.link=#android-42
-tab2=Android 4.1
-tab2.link=#android-41
+tab1=Android 4.3
+tab1.link=#android-43
+tab2=Android 4.2
+tab2.link=#android-42
+tab3=Android 4.1
+tab3.link=#android-41
@jd:body
<div id="butterbar-wrapper" >
@@ -16,6 +18,7 @@ tab2.link=#android-41
<style>
#android-41 {display:none;}
+#android-42 {display:none;}
</style>
<script>
@@ -60,6 +63,573 @@ window.onhashchange = function () {
</script>
+<!-- BEGIN ANDROID 4.3 -->
+<div id="android-43" class="version-section">
+
+<div style="float:right;padding:0px 0px 10px 28px;width:480px;">
+<div>
+<a href="{@docRoot}images/jb-android-43@2x.png"><img src="{@docRoot}images/jb-android-43.jpg" alt="Android 4.3 on phone and tablet" width="472"></a>
+
+</div>
+</div>
+<p>Welcome to Android 4.3, a sweeter version of <span
+style="white-space:nowrap;">Jelly Bean!</span></p>
+
+<p>Android 4.3 includes performance optimizations and great
+new features for users and developers. This document provides a glimpse of what's new for
+developers.
+
+<p>See the <a href="{@docRoot}about/versions/android-4.3.html">Android 4.3 APIs</a>
+document for a detailed look at the new developer APIs.</p>
+
+<p>Find out more about the new Jelly Bean features for users at <a
+href="http://www.android.com/whatsnew">www.android.com</a>.</p>
+
+
+<h2 id="43-performance" style="line-height:1.25em;">Faster, Smoother, More
+Responsive</h2>
+
+<p>Android 4.3 builds on the performance improvements already included in Jelly
+Bean &mdash; <strong>vsync timing</strong>, <strong>triple buffering</strong>,
+<strong>reduced touch latency</strong>, <strong>CPU input boost</strong>, and
+<strong>hardware-accelerated 2D rendering</strong> &mdash; and adds new
+optimizations that make Android even faster.</p>
+
+<p>For a graphics performance boost, the hardware-accelerated 2D renderer now
+<strong>optimizes the stream of drawing commands</strong>, transforming it into
+a more efficient GPU format by rearranging and merging draw operations. For
+multithreaded processing, the renderer can also now use <strong>multithreading
+across multiple CPU cores</strong> to perform certain tasks.</p>
+
+<p>Android 4.3 also improves <strong>rendering for shapes and text</strong>.
+Shapes such as circles and rounded rectangles are now rendered at higher quality
+in a more efficient manner. Optimizations for text include increased performance
+when using multiple fonts or complex glyph sets (CJK), higher rendering quality
+when scaling text, and faster rendering of drop shadows.</p>
+
+<p><strong>Improved window buffer allocation</strong> results in a faster image
+buffer allocation for your apps, reducing the time taken to start rendering when
+you create a window.</p>
+
+<p>For highest-performance graphics, Android 4.3 introduces support for
+<strong>OpenGL ES 3.0</strong> and makes it accessible to apps through both
+framework and native APIs. On supported devices, the hardware accelerated 2D
+rendering engine takes advantage of OpenGL ES 3.0 to optimize <strong>texture
+management</strong> and increase <strong>gradient rendering
+fidelity</strong>.</p>
+
+
+<h2 id="43-graphics">OpenGL ES 3.0 for High-Performance Graphics</h2>
+
+<p>Android 4.3 introduces platform support for <a class="external-link"
+href="http://www.khronos.org/opengles/3_X/" target="_android">Khronos OpenGL ES 3.0</a>,
+providing games and other apps with highest-performance 2D and 3D graphics
+capabilities on supported devices. You can take advantage of OpenGL ES 3.0
+and related EGL extensions using either <strong>framework APIs</strong>
+or <strong>native API bindings</strong> through the Android Native Development
+Kit (NDK).</p>
+
+<p>Key new functionality provided in OpenGL ES 3.0 includes acceleration of
+advanced visual effects, high quality ETC2/EAC texture compression as a standard
+feature, a new version of the GLSL ES shading language with integer and 32-bit
+floating point support, advanced texture rendering, and standardized texture
+size and render-buffer formats.
+
+<p>You can use the OpenGL ES 3.0 APIs to create highly complex, highly efficient
+graphics that run across a range of compatible Android devices, and you can
+support a single, standard texture-compression format across those devices.</p>
+
+<p>OpenGL ES 3.0 is an optional feature that depends on underlying graphics
+hardware. Support is already available on Nexus 7 (2013), Nexus 4, and
+Nexus 10 devices.</p>
+
+
+<h2 id="43-bluetooth" style="clear:both;">Enhanced Bluetooth Connectivity</h2>
+
+<h4 id="43-bt-le">Connectivity with Bluetooth Smart devices and sensors</h4>
+
+<p>Now you can design and build apps that interact with the latest generation
+of small, low-power devices and sensors that use <a
+href="http://www.bluetooth.com/Pages/Bluetooth-Smart-Devices.aspx"
+class="external-link" target="_android">Bluetooth Smart technology</a>. </p>
+
+<div style="float:right;margin:0px 0px 32px 0px;width:460px;">
+<img src="{@docRoot}images/jb-btle.png" alt="" width="450" style="padding-left:1.5em;margin-bottom:0">
+<p class="img-caption" style="padding-top:1.5em;line-height:1.25em;margin-bottom:0;padding-left:1.5em;">Android 4.3 gives you a single, standard API for interacting with Bluetooth Smart devices. </p>
+</div>
+
+<p>Android 4.3 introduces built-in platform support for <strong>Bluetooth Smart
+Ready</strong> in the central role and provides a standard set of APIs that
+apps can use to discover nearby devices, query for GATT services, and read/write
+characteristics.</p>
+
+<p>With the new APIs, your apps can efficiently scan for devices and services of
+interest. For each device, you can check for supported GATT services by UUID and
+manage connections by device ID and signal strength. You can connect to a GATT
+server hosted on the device and read or write characteristics, or register a
+listener to receive notifications whenever those characteristics change.</p>
+
+<p>You can implement support for any GATT profile. You can read or write
+standard characteristics or add support for custom characteristics as needed.
+Your app can function as either client or server and can transmit and receive
+data in either mode. The APIs are generic, so you’ll be able to support
+interactions with a variety of devices such as proximity tags, watches, fitness
+meters, game controllers, remote controls, health devices, and more.
+</p>
+
+<p>Support for Bluetooth Smart Ready is already available on Nexus 7 (2013)
+and Nexus 4 devices and will be supported in a growing number of
+Android-compatible devices in the months ahead.</p>
+
+<h4 id="43-bt-avrcp">AVRCP 1.3 Profile</h4>
+
+<p>Android 4.3 adds built-in support for <strong>Bluetooth AVRCP 1.3</strong>,
+so your apps can support richer interactions with remote streaming media
+devices. Apps such as media players can take advantage of AVRCP 1.3 through the
+<strong>remote control client APIs</strong> introduced in Android 4.0. In
+addition to exposing playback controls on the remote devices connected over
+Bluetooth, apps can now transmit metadata such as track name, composer, and
+other types of media metadata. </p>
+
+<p>Platform support for AVRCP 1.3 is built on the Bluedroid Bluetooth stack
+introduced by Google and Broadcom in Android 4.2. Support is available right
+away on Nexus devices and other Android-compatible devices that offer A2DP/AVRCP
+capability. </p>
+
+
+<h2 id="43-profiles">Support for Restricted Profiles</h2>
+
+<div style="float:right;margin:22px 0px 0px 24px;width:340px;">
+<img src="{@docRoot}images/jb-profiles-create-n713.png" alt="Setting up a Restricted Profile" width="340" style="margin-bottom:0">
+<p class="img-caption" style="padding-top:1.5em;line-height:1.25em;margin-bottom:0;">A tablet owner can set up one or more restricted profiles in Settings and manage them independently. </p>
+<img src="{@docRoot}images/jb-profiles-restrictions-n713.png" alt="Setting Restrictions in a Profile" width="340" style="margin-bottom:0;padding-top:1em;">
+<p class="img-caption" style="padding-top:1.5em;line-height:1.25em;">Your app can offer restrictions to let owners manage your app content when it's running in a profile. </p>
+</div>
+
+<p>Android 4.3 extends the multiuser feature for tablets with <strong>restricted
+profiles</strong>, a new way to manage users and their capabilities on a single
+device. With restricted profiles, tablet owners can quickly set up
+<strong>separate environments</strong> for each user, with the ability to
+manage <strong>finer-grained restrictions</strong> in the apps that are
+available in those environments. Restricted profiles are ideal for friends and
+family, guest users, kiosks, point-of-sale devices, and more. </p>
+
+<p>Each restricted profile offers an isolated and secure space with its own
+local storage, home screens, widgets, and settings. Unlike with
+users, profiles are created from the tablet owner’s environment, based on the
+owner’s installed apps and system accounts. The owner controls which installed
+apps are enabled in the new profile, and access to the owner’s accounts is
+disabled by default. </p>
+
+<p>Apps that need to access the owner’s accounts &mdash; for sign-in,
+preferences, or other uses &mdash; can opt-in by declaring a manifest attribute,
+and the owner can review and manage those apps from the profile configuration
+settings.</p>
+
+<p>For developers, restricted profiles offer a new way to deliver more value and
+control to your users. You can implement <strong>app restrictions</strong>
+&mdash; content or capabilities controls that are supported by your app &mdash;
+and advertise them to tablet owners in the profile configuration settings.
+</p>
+
+<p>You can add app restrictions directly to the profile configuration settings
+using predefined boolean, select, and multi-select types. If you want more
+flexibility, you can even launch your own UI from profile configuration settings
+to offer any type of restriction you want. </p>
+
+<p>When your app runs in a profile, it can check for any restrictions configured
+by the owner and enforce them appropriately. For example, a media app
+might offer a restriction to let the owner set a maturity level for the profile.
+At run time, the app could check for the maturity setting and then manage
+content according to the preferred maturity level. </p>
+
+<p>If your app is not designed for use in restricted profiles, you can opt
+out altogether, so that your app can't be enabled in any restricted profile.</p>
+
+
+<h2 id="43-optimized-location">Optimized Location and Sensor Capabilities</h2>
+
+<p><a href="{@docRoot}google/play-services/index.html">Google Play services</a>
+offers advanced location APIs that you can use in your apps. Android 4.3
+<strong>optimizes these APIs</strong> on supported devices with new hardware and
+software capabilities that minimize use of the battery. </p>
+
+
+<div style="float:left;margin:22px 24px 36px 22px;width:250px;">
+<a href=""><img src="{@docRoot}images/google/gps-location.png" alt="" height="160" style="padding-right:1.5em;margin-bottom:0"></a>
+</div>
+
+<p><strong>Hardware geofencing</strong> optimizes for power efficiency by
+performing location computation in the device hardware, rather than in
+software. On devices that support hardware geofencing, Google Play services
+geofence APIs will be able to take advantage of this optimization to save
+battery while the device is moving. </p>
+
+<p><strong>Wi-Fi scan-only mode</strong> is a new platform optimization that
+lets users keep Wi-Fi scan on without connecting to a Wi-Fi network, to improve
+location accuracy while conserving battery. Apps that depend on Wi-Fi for
+location services can now ask users to enable scan-only mode from Wi-Fi
+advanced settings. Wi-Fi scan-only mode is not dependent on device hardware and
+is available as part of the Android 4.3 platform.</p>
+
+<p>New sensor types allow apps to better manage sensor readings. A <strong>game
+rotation vector</strong> lets game developers sense the device’s rotation
+without having to worry about magnetic interference. <strong>Uncalibrated
+gyroscope</strong> and <strong>uncalibrated magnetometer</strong> sensors report
+raw measurements as well as estimated biases to apps. </p>
+
+<p>The new hardware capabilities are already available on Nexus 7 (2013) and
+Nexus 4 devices, and any device manufacturer or chipset vendor can build them
+into their devices.</p>
+
+
+<h2 id="43-media">New Media Capabilities</h2>
+
+<h4 id="43-modular-drm">Modular DRM framework</h4>
+
+<p>To meet the needs of the next generation of media services, Android 4.3
+introduces a <strong>modular DRM framework</strong> that enables media application
+developers to more easily integrate DRM into their own streaming protocols, such
+as MPEG DASH (Dynamic Adaptive Streaming over HTTP, ISO/IEC 23009-1).</p>
+
+<p>Through a combination of new APIs and enhancements to existing APIs, the
+media DRM framework provides an <strong>integrated set of services</strong> for
+managing licensing and provisioning, accessing low-level codecs, and decoding
+encrypted media data. A new MediaExtractor API lets you get the PSSH metadata
+for DASH media. Apps using the media DRM framework manage the network
+communication with a license server and handle the streaming of encrypted data
+from a content library. </p>
+
+<h4 id="43-vp8-encoder">VP8 encoder</h4>
+
+<p>Android 4.3 introduces built-in support for <strong>VP8 encoding</strong>,
+accessible from framework and native APIs. For apps using native APIs, the
+platform includes <strong>OpenMAX 1.1.2 extension headers</strong> to support
+VP8 profiles and levels. VP8 encoding support includes settings for target
+bitrate, rate control, frame rate, token partitioning, error resilience,
+reconstruction and loop filters. The platform API introduces VP8 encoder support
+in a range of formats, so you can take advantage of the best format for your
+content. </p>
+
+<p>VP8 encoding is available in software on all compatible devices running
+Android 4.3. For highest performance, the platform also supports
+hardware-accelerated VP8 encoding on capable devices.</p>
+
+<h4 id="43-surface">Video encoding from a surface</h4>
+
+<p>Starting in Android 4.3 you can use a surface as the input to a video
+encoder. For example, you can now direct a stream from an OpenGL ES surface
+to the encoder, rather than having to copy between buffers.</p>
+
+<h4 id="43-media-muxer">Media muxer</h4>
+
+<p>Apps can use new media muxer APIs to combine elementary audio and video
+streams into a single output file. Currently apps can multiplex a single MPEG-4
+audio stream and a single MPEG-4 video stream into a <strong>single MPEG-4 ouput
+file</strong>. The new APIs are a counterpart to the media demuxing APIs
+introduced in Android 4.2. </p>
+
+<h4 id="43-progress-scrubbing">Playback progress and scrubbing in remote control
+clients</h4>
+
+<p>Since Android 4.0, media players and similar applications have been able to
+offer playback controls from remote control clients such as the device lock
+screen, notifications, and remote devices connected over Bluetooth. Starting in
+Android 4.3, those applications can now also expose playback <strong>progress
+and speed</strong> through their remote control clients, and receive commands to
+jump to a specific <strong>playback position</strong>. </p>
+
+
+<h2 id="43-beautiful-apps">New Ways to Build Beautiful Apps</h2>
+
+
+<h3 id="43-notification-access">Access to notifications</h3>
+
+<p>Notifications have long been a popular Android feature because they let users
+see information and updates from across the system, all in one place. Now in
+Android 4.3, apps can <strong>observe the stream of notifications</strong> with the
+user's permission and display the notifications in any way they want, including
+sending them to nearby devices connected over Bluetooth. </p>
+
+<p>You can access notifications through new APIs that let you <strong>register a
+notification listener</strong> service and with permission of the user, receive
+notifications as they are displayed in the status bar. Notifications are
+delivered to you in full, with all details on the originating app, the post
+time, the content view and style, and priority. You can evaluate fields of
+interest in the notifications, process or add context from your app, and route
+them for display in any way you choose.</p>
+
+<p>The new API gives you callbacks when a notification is added, updated, and
+removed (either because the user dismissed it or the originating app withdrew it).
+You'll be able to launch any intents attached to the notification or its actions,
+as well as dismiss it from the system, allowing your app to provide a complete
+user interface to notifications.</p>
+
+<p><strong>Users remain in control</strong> of which apps can receive
+notifications. At any time, they can look in Settings to see which apps have
+notification access and <strong>enable or disable access</strong> as needed.
+Notification access is disabled by default &mdash; apps can use a new Intent to
+take the user directly to the Settings to enable the listener service after
+installation.</p>
+
+<h4 id="43-view-overlays">View overlays</h4>
+
+<p>You can now create <strong>transparent overlays</strong> on top of Views and
+ViewGroups to render a temporary View hierarchy or transient animation effects
+without disturbing the underlying layout hierarchy. Overlays are particularly
+useful when you want to create animations such as sliding a view outside of its
+container or dragging items on the screen without affecting the view
+hierarchy. </p>
+
+<h4 id="43-optical-bounds">Optical bounds layout mode</h4>
+
+<p>A new layout mode lets you manage the positioning of Views inside ViewGroups
+according to their <strong>optical bounds</strong>, rather than their clip
+bounds. Clip bounds represent a widget’s actual outer boundary, while the new
+optical bounds describe the where the widget appears to be, within the clip
+bounds. You can use the optical bounds layout mode to properly align widgets
+that use outer visual effects such as shadows and glows.</p>
+
+<h4 id="43-rotation-animation">Custom rotation animation types</h4>
+
+<p>Apps can now define the exit and entry animation types used on a window when the
+device is rotated. You can set window properties to enable
+<strong>jump-cut</strong>, <strong>cross-fade</strong>, or
+<strong>standard</strong> window rotation. The system uses the custom animation
+types when the window is fullscreen and is not covered by other windows.</p>
+
+<h4 id="43-screen-orientations">Screen orientation modes</h4>
+
+<p>Apps can set new orientation modes for Activities to ensure that they are
+displayed in the proper orientation when the device is flipped. Additionally,
+apps can use a new mode to <strong>lock the screen</strong> to its current
+orientation. This is useful for apps using the camera that want to
+<strong>disable rotation</strong> while shooting video. </p>
+
+<h4 id="43-quick-responses-intent">Intent for handling Quick Responses</h4>
+
+<p>Android 4.3 introduces a new public Intent that lets any app <strong>handle
+Quick Responses</strong> &mdash; text messages sent by the user in response to
+an incoming call, without needing to pick up the call or unlock the device. Your
+app can listen for the intent and send the message to the caller over your
+messaging system. The intent includes the recipient (caller) as well as the
+message itself. </p>
+
+
+<h2 id="43-intl">Support for International Users</h2>
+
+<div style="float:right;margin:22px 0px 0px 24px;width:380px;">
+<img src="{@docRoot}images/jb-rtl-arabic-n4.png" alt="" width="180" style="margin-bottom:0;">
+<img src="{@docRoot}images/jb-rtl-hebrew-n4.png" alt="" width="180" style="margin-bottom:0;padding-left:10px;">
+<p class="img-caption" style="padding-top:1.5em;line-height:1.25em;">More parts of Android 4.3 are optimized for RTL languages.</p>
+</div>
+
+<h4 id="43-rtl">RTL improvements</h4>
+
+<p>Android 4.3 includes RTL performance enhancements and broader RTL support
+across framework UI widgets, including ProgressBar/Spinner and
+ExpandableListView. More debugging information visible through the
+<code>uiautomatorviewer</code> tool. In addition, more system UI components are
+now RTL aware, such as notifications, navigation bar and the Action Bar.</p>
+
+<p>To provide a better systemwide experience in RTL scripts, more default system
+apps now support RTL layouts, including Launcher, Quick Settings, Phone, People,
+SetupWizard, Clock, Downloads, and more.</p>
+
+<h4 id="43-localization">Utilities for localization</h4>
+
+<div style="float:right;margin:16px 12px 0px 32px;width:260px;clear:both;">
+<img src="{@docRoot}images/jb-pseudo-locale-zz.png" alt="" width="260" style="margin-bottom:0;">
+<p class="img-caption" style="padding-top:1.5em;line-height:1.25em;">Pseudo-locales make it easier to test your app's localization.</p>
+</div>
+
+<p>Android 4.3 also includes new utilities and APIs for creating better RTL
+strings and testing your localized UIs. A new <strong>BidiFormatter</strong>
+provides a set of simple APIs for wrapping Unicode strings so that you can
+fine-tune your text rendering in RTL scripts. To let you use this utility more
+broadly in your apps, the BidiFormatter APIs are also now available for earlier
+platform versions through the Support Package in the Android SDK. </p>
+
+<p>To assist you with managing date formatting across locales, Android 4.3
+includes a new <strong>getBestDateTimePattern()</strong> method that automatically
+generates the best possible localized form of a Unicode UTS date for a locale
+that you specify. It’s a convenient way to provide a more localized experience
+for your users. </p>
+
+<p>To help you test your app more easily in other locales, Android 4.3
+introduces <strong>pseudo-locales</strong> as a new developer option.
+Pseudo-locales simulate the language, script, and display characteristics
+associated with a locale or language group. Currently, you can test with a
+pseudo-locale for <strong>Accented English</strong>, which lets you see how your
+UI works with script accents and characters used in a variety of European
+languages. <!--To use the pseudo-locale, enable “Developer options” in Settings
+and then select Accented English from Language and Input settings. --></p>
+
+
+<h2 id="43-accessibility">Accessibility and UI Automation</h2>
+
+<p>Starting in Android 4.3, accessibility services can <strong>observe and
+filter key events</strong>, such as to handle keyboard shortcuts or provide
+navigation parity with gesture-based input. The service receives the events and
+can process them as needed before they are passed to the system or other
+installed apps.</p>
+
+<p>Accessibility services can declare <strong>new capability attributes</strong>
+to describe what their services can do and what platform features they use. For
+example, they can declare the capability to filter key events, retrieve window
+content, enable explore-by-touch, or enable web accessibility features. In some
+cases, services must declare a capability attribute before they can access
+related platform features. The system uses the service’s capability attributes
+to generate an opt-in dialog for users, so they can see and agree to the
+capabilities before launch.</p>
+
+<p>Building on the accessibility framework in Android 4.3, a new <strong>UI
+automation framework</strong> lets tests interact with the device’s UI by
+simulating user actions and introspecting the screen content. Through the UI
+automation framework you can perform basic operations, set rotation of the
+screen, generate input events, take screenshots, and much more. It’s a powerful
+way to automate testing in realistic user scenarios, including actions or
+sequences that span multiple apps.</p>
+
+
+<h2 id="43-enterprise-security">Enterprise and Security</h2>
+
+<h4 id="43-wpa2">Wi-Fi configuration for WPA2-Enterprise networks</h4>
+
+<p>Apps can now configure the <strong>Wi-Fi credentials</strong> they need for
+connections to <strong>WPA2 enterprise access points</strong>. Developers can
+use new APIs to configure Extensible Authentication Protocol (EAP) and
+Encapsulated EAP (Phase 2) credentials for authentication methods used in the
+enterprise. Apps with permission to access and change Wi-Fi can configure
+authentication credentials for a variety of EAP and Phase 2 authentication
+methods. </p>
+
+<h4 id="43-selinux">Android sandbox reinforced with SELinux</h4>
+
+<p>Android now uses <strong>SELinux</strong>, a mandatory access control (MAC)
+system in the Linux kernel to augment the UID based application sandbox.
+This protects the operating system against potential security vulnerabilities.</p>
+
+<h4 id="43-keychain">KeyChain enhancements</h4>
+
+<p>The KeyChain API now provides a method that allows applications to confirm
+that system-wide keys are bound to a <strong>hardware root of trust</strong> for
+the device. This provides a place to create or store private keys that
+<strong>cannot be exported</strong> off the device, even in the event of a root or
+kernel compromise.</p>
+
+<h4 id="43-keystore">Android Keystore Provider</h4>
+
+<p>Android 4.3 introduces a keystore provider and APIs that allow applications
+to create exclusive-use keys. Using the APIs, apps can create or store private
+keys that <strong>cannot be seen or used by other apps</strong>, and can be
+added to the keystore without any user interaction. </p>
+
+<p>The keystore provider provides the same security benefits that the KeyChain
+API provides for system-wide credentials, such as binding credentials to a
+device. Private keys in the keystore cannot be exported off the device.</p>
+
+<h4 id="43-seuid">Restrict Setuid from Android Apps</h4>
+
+<p>The <code>/system</code> partition is now mounted <code>nosuid</code> for
+zygote-spawned processes, preventing Android applications from executing
+<code>setuid</code> programs. This reduces root attack surface and likelihood of
+potential security vulnerabilities.</p>
+
+
+<h2 id="43-tools">New Ways to Analyze Performance</h2>
+
+<div style="float:right;margin:16px 6px 0px 32px;width:390px;">
+<img src="{@docRoot}images/jb-systrace.png" alt="" width="390" style="margin-bottom:0;">
+<p class="img-caption" style="padding-top:1.5em;line-height:1.25em;">Systrace uses a new command syntax and lets you collect more types of profiling data.</p>
+</div>
+
+<h4 id="43-systrace">Enhanced Systrace logging</h4>
+
+<p>Android 4.3 supports an enhanced version of the <strong>Systrace</strong>
+tool that’s easier to use and that gives you access to more types of information
+to profile the performance of your app. You can now collect trace data from
+<strong>hardware modules</strong>, <strong>kernel functions</strong>,
+<strong>Dalvik VM</strong> including garbage collection, <strong>resources
+loading</strong>, and more. </p>
+
+<p>Android 4.3 also includes new Trace APIs that you can use in your apps to mark
+specific sections of code to trace using Systrace <strong>begin/end
+events</strong>. When the marked sections of code execute, the system writes the
+begin/end events to the trace log. There's minimal impact on the performance of
+your app, so timings reported give you an accurate view of what your app is
+doing.</p>
+
+<p>You can visualize app-specific events in a timeline in the Systrace output
+file and analyze the events in the context of other kernel and user space trace
+data. Together with existing Systrace tags, custom app sections can give you new
+ways to understand the performance and behavior of your apps.</p>
+
+<div style="float:right;margin:6px 0px 0px 32px;width:380px;">
+<img src="{@docRoot}images/jb-gpu-profile-clk-n4.png" alt="" width="180" style="margin-bottom:0;">
+<img src="{@docRoot}images/jb-gpu-profile-cal-n4.png" alt="" width="180" style="margin-bottom:0;padding-left:10px;">
+<p class="img-caption" style="padding-top:1.5em;line-height:1.25em;">On-screen GPU profiling in Android 4.3.</p>
+</div>
+
+<h4 id="43-gpu-profiling" >On-screen GPU profiling</h4>
+
+<p>Android 4.3 adds new developer options to help you analyze your app’s
+performance and pinpoint rendering issues on any device or emulator.</p>
+
+<p>In the <strong>Profile GPU rendering</strong> option you can now visualize
+your app’s effective framerate on-screen, while the app is running. You can
+choose to display profiling data as on-screen <strong>bar or line
+graphs</strong>, with colors indicating time spent creating drawing commands
+(blue), issuing the commands (orange), and waiting for the commands to complete
+(yellow). The system updates the on-screen graphs continuously, displaying a
+graph for each visible Activity, including the navigation bar and notification
+bar. </p>
+
+<p>A green line highlights the <strong>60ms threshold</strong> for rendering
+operations, so you can assess the your app’s effective framerate relative
+to a 60 fps goal. If you see operations that cross the green line, you
+can analyze them further using Systrace and other tools.</p>
+
+<p class="caution" style="clear:both">On devices running Android 4.2 and higher,
+developer options are hidden by default. You can reveal them at any time by
+tapping 7 times on <strong>Settings &gt; About phone &gt; Build number</strong>
+on any compatible Android device.</p>
+
+<h4 id="43-strictmode">StrictMode warning for file URIs</h4>
+
+<p>The latest addition to the StrictMode tool is a policy constraint that warns
+when your app exposes a <code>file://</code> URI to the system or another app.
+In some cases the receiving app may not have access to the <code>file://</code>
+URI path, so when sharing files between apps, a <code>content://</code> URI should
+be used (with the appropriate permission). This new policy helps you catch and fix
+such cases. If you’re looking for a convenient way to store and expose files to other
+apps, try using the <code>FileProvider</code> content provider that’s available
+in the <a href="{@docRoot}tools/support-library/index.html">Support Library</a>.</p>
+
+</div><!-- END ANDROID 4.3 -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<!-- BEGIN ANDROID 4.2 -->
<div id="android-42" class="version-section">
@@ -75,7 +645,7 @@ style="white-space:nowrap;">Jelly Bean!</span></p>
new features for users and developers. This document provides a glimpse of what's new for
developers.
-<p>See the <a href="/about/versions/android-4.2.html">Android 4.2 APIs</a>
+<p>See the <a href="{@docRoot}about/versions/android-4.2.html">Android 4.2 APIs</a>
document for a detailed look at the new developer APIs.</p>
<p>Find out more about the new Jelly Bean features for users at <a
@@ -158,7 +728,7 @@ in a single-user environment. </p>
<div>
<img src="{@docRoot}images/jb-lock-calendar.png" alt="Calendar lock screen widget" width="280" height="543" style="padding-left:1em;margin-bottom:0">
</div>
-<p class="image-caption" style="padding:1.5em">You can extend <strong>app widgets</strong> to run on the lock screen, for instant access to your content.</p>
+<p class="img-caption" style="padding-top:1.5em;line-height:1.25em;">You can extend <strong>app widgets</strong> to run on the lock screen, for instant access to your content.</p>
</div>
<h3 id="42-lockscreen-widgets">Lock screen widgets</h3>
diff --git a/docs/html/design/building-blocks/tabs.jd b/docs/html/design/building-blocks/tabs.jd
index 47784009b035..2bc90ab34d43 100644
--- a/docs/html/design/building-blocks/tabs.jd
+++ b/docs/html/design/building-blocks/tabs.jd
@@ -53,7 +53,7 @@ to the next/previous view, swipe left or right.</p>
<img src="{@docRoot}design/media/tabs_youtube.png">
<div class="figure-caption">
- Tabs in the YouTube app.
+ Tabs in the Google Play Movies app.
</div>
diff --git a/docs/html/design/media/tabs_youtube.png b/docs/html/design/media/tabs_youtube.png
index 4ea6c1c7a4f1..a4c1ae5f455c 100644
--- a/docs/html/design/media/tabs_youtube.png
+++ b/docs/html/design/media/tabs_youtube.png
Binary files differ
diff --git a/docs/html/design/patterns/actionbar.jd b/docs/html/design/patterns/actionbar.jd
index 60200345f055..ceb5a4c3803e 100644
--- a/docs/html/design/patterns/actionbar.jd
+++ b/docs/html/design/patterns/actionbar.jd
@@ -123,7 +123,7 @@ the top bar.</p>
</div>
</div>
-<h2>Action Buttons</h2>
+<h2 id="ActionButtons">Action Buttons</h2>
<p><em>Action buttons</em> on the action bar surface your app's most important activities. Think about which
buttons will get used most often, and order them accordingly. Depending on available screen real
estate, the system shows your most important actions as action buttons and moves the rest to the
diff --git a/docs/html/design/patterns/navigation.jd b/docs/html/design/patterns/navigation.jd
index 4da87b934bc4..6f2215a28b1d 100644
--- a/docs/html/design/patterns/navigation.jd
+++ b/docs/html/design/patterns/navigation.jd
@@ -1,5 +1,5 @@
page.title=Navigation with Back and Up
-page.tags="navigation","activity","task"
+page.tags="navigation","activity","task","up navigation","back navigation"
@jd:body
<a class="notice-developers" href="{@docRoot}training/implementing-navigation/index.html">
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
index f96e868d03b1..7e2337c28f3c 100644
--- a/docs/html/develop/index.jd
+++ b/docs/html/develop/index.jd
@@ -41,6 +41,20 @@ position:absolute;top:50%;left:0;width:100%;z-index:-1;text-align:center;display
<li class="item carousel-home">
<div class="col-8">
+ <img
+src="//lh4.ggpht.com/-lfjzgG5Dqrk/UHMThRtpRwI/AAAAAAAABpk/h4d3nsmkgPM/s400/mint.png"
+class="play no-shadow no-transform" />
+ </div>
+ <div class="content-right col-6">
+ <h2>Building Great Apps for Tablets</h2>
+ <p>Tablets are a fast-growing part of the Android installed base and they offer new opportunities for user engagement and monetization. If you are targeting tablets, check out this list of tips and techniques on how to deliver a great app experience for tablet users. </p>
+ <p><a
+href="//android-developers.blogspot.com/2012/11/designing-for-tablets-were-here-to-help.html" class="button">Read
+more</a></p>
+ </div>
+ </li>
+ <li class="item carousel-home">
+ <div class="col-8">
<img src="{@docRoot}images/google/gps-location.png"
class="play no-shadow no-transform" style="margin:0 0 0 70px;height:230px;width:340px" />
</div>
@@ -90,20 +104,6 @@ class="play no-shadow no-transform" style="margin:0 0 0 40px;max-height:250px;he
href="{@docRoot}google/play-services/maps.html" class="button">Read more</a></p>
</div>
</li>
- <li class="item carousel-home">
- <div class="col-8">
- <img
-src="//lh4.ggpht.com/-lfjzgG5Dqrk/UHMThRtpRwI/AAAAAAAABpk/h4d3nsmkgPM/s400/mint.png"
-class="play no-shadow no-transform" />
- </div>
- <div class="content-right col-6">
- <h2>Building Great Apps for Tablets</h2>
- <p>Tablets are a growing part of the Android installed base and they offer new opportunities for user engagement and monetization. If you are targeting tablets, check out the <strong>Tablet App Quality Checklist</strong> for tips and techniques on how to deliver a great app experience for tablet users. </p>
- <p><a
-href="/distribute/googleplay/quality/tablet.html" class="button">Read
-more</a></p>
- </div>
- </li>
<li class="item carousel-home">
<div class="col-8">
<img
@@ -132,26 +132,26 @@ more</a></p>
<div class="feed-frame">
<!-- DEVELOPER NEWS -->
<ul>
+ <li><a href="//android-developers.blogspot.com/2013/07/making-beautiful-android-app-icons.html">
+ <div class="feed-image" style="background:url('//2.bp.blogspot.com/-HfoO6KNFBKA/UeiyRoELb7I/AAAAAAAAAFs/bHR-5viktU4/s1000/icons.png') no-repeat 0 0;background-size:500px;background-position:center center;"></div>
+ <h4>Making Beautiful Android App Icons</h4>
+ <p>As higher density screens gain popularity, it's important to make sure your launcher icon is crisp and high quality...</p>
+ </a></li>
+ <li><a href="//android-developers.blogspot.com/2013/07/beautiful-design-collection-summer-2013.html">
+ <div class="feed-image" style="background:url('//1.bp.blogspot.com/-k8DZYu0daT4/UdRt1AzstvI/AAAAAAAAAFM/CvEkb2yh-i0/s965/beautifulapps_4.png') no-repeat 0 0"></div>
+ <h4>The Beautiful Design Summer 2013 Collection</h4>
+ <p>See the apps chosen by the Android Design for their masterfully crafted design details...</p>
+ </a></li>
+ <li><a href="//android-developers.blogspot.com/2013/06/google-play-developer-8-step-checkup.html">
+ <div class="feed-image" style="background:url('//4.bp.blogspot.com/-LeK74UYY1eM/UbD8L-2DpFI/AAAAAAAACZA/YMjwndr-ZgM/s400/DoctorDroidV2.png') no-repeat 0 0;background-size:130px;background-position:8px -4px;"></div>
+ <h4>Google Play Developer 8-Step Checkup</h4>
+ <p>Give your Google Play developer account this quick checkup to keep it in good order and help you deliver a more successful product to users...</p>
+ </a></li>
<li><a href="//android-developers.blogspot.com/2013/05/new-ways-to-optimize-your-business-in.html">
<div class="feed-image" style="background:url('//4.bp.blogspot.com/-VmHMT66JjxU/UZZdfPUaJsI/AAAAAAAACQc/kDx5-Ep5YRo/s1600/framed_designed-tablets.png') no-repeat 0 0;background-size:180px"></div>
<h4>New Ways to Optimize Your Business in Google Play</h4>
<p>Many of you have invested in making great tablet experiences for your users, and we want to ensure that that work pays off...</p>
</a></li>
- <li><a href="//android-developers.blogspot.com/2013/05/android-studio-ide-built-for-android.html">
- <div class="feed-image" style="background:url('//1.bp.blogspot.com/-u5dfSsMOMC0/UZO_5DC_W9I/AAAAAAAACM8/YCMn15HPzpE/s320/Studio_table.png') no-repeat 0 0;background-size:180px"></div>
- <h4>Android Studio: An IDE built for Android</h4>
- <p>To develop Android Studio, we cooperated with JetBrains, creators of one of the most advanced Java IDEs available today...</p>
- </a></li>
- <li><a href="//android-developers.blogspot.com/2013/01/verifying-back-end-calls-from-android.html">
- <div class="feed-image" style="background:url('//lh4.ggpht.com/7z4NItEg-X21zvFGAarKonk-VaysBYthJ30u1JjaQ0-5fjyHNawnmoNeG--4FCACog=w124') no-repeat 0 0"></div>
- <h4>Verifying Back-End Calls from Android Apps</h4>
- <p>You can take advantage of the auth APIs in Google Play services to let your back end know which app is calling and for which user....</p>
- </a></li>
- <li><a href="//android-developers.blogspot.com/2012/12/daydream-interactive-screen-savers.html">
- <div class="feed-image" style="background:url('//lh4.ggpht.com/-wVsUOo4xGE0/UNy9mZ1nmMI/AAAAAAAAB4w/f6rhyLn5KbI/s1600/daydream-example.jpg') no-repeat 0 0;background-position:right top;"></div>
- <h4>Daydream: Interactive Screen Savers</h4>
- <p>Daydream is an interactive screen-saver mode introduced in Android 4.2. Learn how to add Daydreams to your apps...</p>
- </a></li>
</ul>
<!-- FEATURED DOCS -->
<ul>
diff --git a/docs/html/distribute/googleplay/spotlight/index.jd b/docs/html/distribute/googleplay/spotlight/index.jd
index 88cdec4fc98e..7004b0a63cb4 100644
--- a/docs/html/distribute/googleplay/spotlight/index.jd
+++ b/docs/html/distribute/googleplay/spotlight/index.jd
@@ -22,6 +22,35 @@ header.hide=0
margin-bottom:40px;
margin-top:30px;">
<div style="padding:0 0 0 29px;">
+ <h4>Developer Story: Colopl</h4>
+ <img alt="" class="screenshot thumbnail" style="-webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px height:78px;
+ width: 78px;
+ float: left;
+ margin: 17px 20px 9px 0;"
+ src="//lh3.ggpht.com/sx2ILNaXQYOsHfR91T5tUWGlfXE1FutHCBN02Fll6mi9gIaG6RZCGbeJMtIvOoegCPTh=w124" >
+ <div style="width:700px;">
+ <p style="margin-top:26px;
+ margin-bottom:12px;">
+ The creators of Kuma The Bear, Japan-based <a href="https://play.google.com/store/apps/developer?id=COLOPL,+Inc." target="_android">Colopl</a>, talk about how Google Play and Android allowed them to grow their business to become one of the most profitable games publishers in APAC to date. </p>
+ </div>
+ <iframe style="float:left;
+ margin-right:24px;
+ margin-top:14px;" width="700" height="394" src=
+ "http://www.youtube.com/embed/CbpoZeQCNe4?HD=1;rel=0;origin=developer.android.com;" frameborder="0" allowfullscreen>
+ </iframe>
+ </div>
+</div>
+
+<div style="background: #F0F0F0;
+ border-top: 1px solid #DDD;
+ padding: 0px 0 24px 0;
+ overflow: auto;
+ clear:both;
+ margin-bottom:40px;
+ margin-top:30px;">
+ <div style="padding:0 0 0 29px;">
<h4>Developer Story: redBus.in</h4>
<img alt="" class="screenshot thumbnail" style="-webkit-border-radius: 5px;
-moz-border-radius: 5px;
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/land_back.png b/docs/html/distribute/promote/device-art-resources/nexus_7/land_back.png
index 697fb7dfede2..cc5b1af3766b 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_7/land_back.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7/land_back.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/land_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_7/land_fore.png
index 735262f696e4..2625edb3c3a3 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_7/land_fore.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7/land_fore.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/land_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_7/land_shadow.png
index cfb7952d4b7d..9d91475fc54e 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_7/land_shadow.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7/land_shadow.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/port_back.png b/docs/html/distribute/promote/device-art-resources/nexus_7/port_back.png
index 5bb815a57f3d..f54a8afedc14 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_7/port_back.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7/port_back.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/port_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_7/port_fore.png
index 1be3b210a77d..230bad4462bb 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_7/port_fore.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7/port_fore.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/port_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_7/port_shadow.png
index 7e8aff2bfa7e..2401d20e4da5 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_7/port_shadow.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7/port_shadow.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/thumb.png b/docs/html/distribute/promote/device-art-resources/nexus_7/thumb.png
index b5db82e3f462..57b4c0331244 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_7/thumb.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7/thumb.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_back.png b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_back.png
new file mode 100644
index 000000000000..697fb7dfede2
--- /dev/null
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_back.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_fore.png
new file mode 100644
index 000000000000..735262f696e4
--- /dev/null
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_fore.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_shadow.png
new file mode 100644
index 000000000000..cfb7952d4b7d
--- /dev/null
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/land_shadow.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_back.png b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_back.png
new file mode 100644
index 000000000000..5bb815a57f3d
--- /dev/null
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_back.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_fore.png
new file mode 100644
index 000000000000..1be3b210a77d
--- /dev/null
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_fore.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_shadow.png
new file mode 100644
index 000000000000..7e8aff2bfa7e
--- /dev/null
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/port_shadow.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7_2012/thumb.png b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/thumb.png
new file mode 100644
index 000000000000..b5db82e3f462
--- /dev/null
+++ b/docs/html/distribute/promote/device-art-resources/nexus_7_2012/thumb.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art.jd b/docs/html/distribute/promote/device-art.jd
index 58e183c9fcd4..09a39417fe46 100644
--- a/docs/html/distribute/promote/device-art.jd
+++ b/docs/html/distribute/promote/device-art.jd
@@ -173,12 +173,13 @@ feature image or screenshots for your Google Play app listing.</p>
title: 'Nexus 7',
url: 'http://www.google.com/nexus/7/',
physicalSize: 7,
- physicalHeight: 7.81,
- density: '213dpi',
+ physicalHeight: 8,
+ actualResolution: [1200,1920],
+ density: 'XHDPI',
landRes: ['shadow', 'back', 'fore'],
- landOffset: [315,270],
+ landOffset: [326,245],
portRes: ['shadow', 'back', 'fore'],
- portOffset: [264,311],
+ portOffset: [244,326],
portSize: [800,1280]
},
{
@@ -210,6 +211,20 @@ feature image or screenshots for your Google Play app listing.</p>
archived: true
},
{
+ id: 'nexus_7_2012',
+ title: 'Nexus 7 (2012)',
+ url: 'http://www.google.com/nexus/7/',
+ physicalSize: 7,
+ physicalHeight: 7.81,
+ density: '213dpi',
+ landRes: ['shadow', 'back', 'fore'],
+ landOffset: [315,270],
+ portRes: ['shadow', 'back', 'fore'],
+ portOffset: [264,311],
+ portSize: [800,1280],
+ archived: true
+ },
+ {
id: 'galaxy_nexus',
title: 'Galaxy Nexus',
url: 'http://www.android.com/devices/detail/galaxy-nexus',
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 6d95338e2a31..db08c3e62645 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -312,7 +312,7 @@
<span class="en">Canvas and Drawables</span>
</a></li>
<li><a href="<?cs var:toroot ?>guide/topics/graphics/opengl.html">
- <span class="en">OpenGL</span>
+ <span class="en">OpenGL ES</span>
</a></li>
<li><a href="<?cs var:toroot ?>guide/topics/graphics/hardware-accel.html">
<span class="en">Hardware Acceleration</span>
diff --git a/docs/html/guide/topics/graphics/opengl.jd b/docs/html/guide/topics/graphics/opengl.jd
index 469eae26568d..f46113d2a9a5 100644
--- a/docs/html/guide/topics/graphics/opengl.jd
+++ b/docs/html/guide/topics/graphics/opengl.jd
@@ -1,4 +1,4 @@
-page.title=OpenGL
+page.title=OpenGL ES
page.tags="games"
@jd:body
@@ -9,21 +9,21 @@ page.tags="games"
<ol>
<li><a href="#basics">The Basics</a>
<ol>
- <li><a href="#packages">OpenGL packages</a></li>
+ <li><a href="#packages">OpenGL ES packages</a></li>
</ol>
<li><a href="#manifest">Declaring OpenGL Requirements</a></li>
- </li>
<li><a href="#coordinate-mapping">Mapping Coordinates for Drawn Objects</a>
<ol>
<li><a href="#proj-es1">Projection and camera in ES 1.0</a></li>
- <li><a href="#proj-es1">Projection and camera in ES 2.0</a></li>
+ <li><a href="#proj-es2">Projection and camera in ES 2.0 and higher</a></li>
</ol>
</li>
- <li><a href="#faces-winding">Shape Faces and Winding</li>
+ <li><a href="#faces-winding">Shape Faces and Winding</a></li>
<li><a href="#compatibility">OpenGL Versions and Device Compatibility</a>
<ol>
<li><a href="#textures">Texture compression support</a></li>
- <li><a href="#gl-extension-query">Determining OpenGL Extensions</a></li>
+ <li><a href="#gl-extension-query">Determining OpenGL extensions</a></li>
+ <li><a href="#version-check">Checking OpenGL ES Version</a></li>
</ol>
</li>
<li><a href="#choosing-version">Choosing an OpenGL API Version</a></li>
@@ -48,20 +48,37 @@ href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics
<li><a href="http://www.khronos.org/opengles/">OpenGL ES</a></li>
<li><a href="http://www.khronos.org/opengles/1_X/">OpenGL ES 1.x Specification</a></li>
<li><a href="http://www.khronos.org/opengles/2_X/">OpenGL ES 2.x specification</a></li>
+ <li><a href="http://www.khronos.org/opengles/3_X/">OpenGL ES 3.x specification</a></li>
</ol>
</div>
</div>
<p>Android includes support for high performance 2D and 3D graphics with the Open Graphics Library
-(OpenGL), specifically, the OpenGL ES API. OpenGL is a cross-platform graphics API that specifies a
+(OpenGL&reg;), specifically, the OpenGL ES API. OpenGL is a cross-platform graphics API that specifies a
standard software interface for 3D graphics processing hardware. OpenGL ES is a flavor of the OpenGL
-specification intended for embedded devices. The OpenGL ES 1.0 and 1.1 API specifications have been
-supported since Android 1.0. Beginning with Android 2.2 (API Level 8), the framework supports the
-OpenGL ES 2.0 API specification.</p>
+specification intended for embedded devices. Android supports several versions of the OpenGL ES
+API:</p>
+
+<ul>
+ <li>OpenGL ES 1.0 and 1.1 - This API specification is supported by Android 1.0 and higher.</li>
+ <li>OpenGL ES 2.0 - This API specification is supported by Android 2.2 (API level 8) and higher.
+ </li>
+ <li>OpenGL ES 3.0 - This API specification is supported by Android 4.3 (API level 18) and higher.
+ </li>
+</ul>
+
+<p class="caution"><strong>Caution:</strong>
+ Support of the OpenGL ES 3.0 API on a device requires an implementation of this graphics
+ pipeline provided by the device manufacturer. A device running Android 4.3 or higher <em>may
+ not support</em> the OpenGL ES 3.0 API. For information on checking what version of OpenGL ES
+ is supported at run time, see <a href="#version-check">Checking OpenGL ES Version</a>.
+</p>
+
+<p class="note"><strong>Note:</strong>
+ The specific API provided by the Android framework is similar to the J2ME JSR239 OpenGL ES API,
+ but is not identical. If you are familiar with J2ME JSR239 specification, be alert for
+ variations.</p>
-<p class="note"><b>Note:</b> The specific API provided by the Android framework is similar to the
- J2ME JSR239 OpenGL ES API, but is not identical. If you are familiar with J2ME JSR239
- specification, be alert for variations.</p>
<h2 id="basics">The Basics</h2>
@@ -87,7 +104,7 @@ understanding how to implement these classes in an activity should be your first
<a href="{@docRoot}training/graphics/opengl/touch.html">Responding to Touch Events</a>.</dd>
<dt><strong>{@link android.opengl.GLSurfaceView.Renderer}</strong></dt>
- <dd>This interface defines the methods required for drawing graphics in an OpenGL {@link
+ <dd>This interface defines the methods required for drawing graphics in a {@link
android.opengl.GLSurfaceView}. You must provide an implementation of this interface as a
separate class and attach it to your {@link android.opengl.GLSurfaceView} instance using
{@link android.opengl.GLSurfaceView#setRenderer(android.opengl.GLSurfaceView.Renderer)
@@ -123,51 +140,59 @@ understanding how to implement these classes in an activity should be your first
</dd>
</dl>
-<h3 id="packages">OpenGL packages</h3>
-<p>Once you have established a container view for OpenGL using {@link
+<h3 id="packages">OpenGL ES packages</h3>
+<p>Once you have established a container view for OpenGL ES using {@link
android.opengl.GLSurfaceView} and {@link android.opengl.GLSurfaceView.Renderer}, you can begin
calling OpenGL APIs using the following classes:</p>
<ul>
<li>OpenGL ES 1.0/1.1 API Packages
<ul>
- <li>{@link android.opengl} - This package provides a static interface to the OpenGL ES
-1.0/1.1 classes and better performance than the javax.microedition.khronos package interfaces.
- <ul>
- <li>{@link android.opengl.GLES10}</li>
- <li>{@link android.opengl.GLES10Ext}</li>
- <li>{@link android.opengl.GLES11}</li>
- <li>{@link android.opengl.GLES11Ext}</li>
- </ul>
- </li>
+ <li>{@link android.opengl} - This package provides a static interface to the OpenGL ES
+ 1.0/1.1 classes and better performance than the {@code javax.microedition.khronos} package
+ interfaces.
+ <ul>
+ <li>{@link android.opengl.GLES10}</li>
+ <li>{@link android.opengl.GLES10Ext}</li>
+ <li>{@link android.opengl.GLES11}</li>
+ <li>{@link android.opengl.GLES11Ext}</li>
+ </ul>
+ </li>
<li>{@link javax.microedition.khronos.opengles} - This package provides the standard
-implementation of OpenGL ES 1.0/1.1.
- <ul>
- <li>{@link javax.microedition.khronos.opengles.GL10}</li>
- <li>{@link javax.microedition.khronos.opengles.GL10Ext}</li>
- <li>{@link javax.microedition.khronos.opengles.GL11}</li>
- <li>{@link javax.microedition.khronos.opengles.GL11Ext}</li>
- <li>{@link javax.microedition.khronos.opengles.GL11ExtensionPack}</li>
- </ul>
+ implementation of OpenGL ES 1.0/1.1.
+ <ul>
+ <li>{@link javax.microedition.khronos.opengles.GL10}</li>
+ <li>{@link javax.microedition.khronos.opengles.GL10Ext}</li>
+ <li>{@link javax.microedition.khronos.opengles.GL11}</li>
+ <li>{@link javax.microedition.khronos.opengles.GL11Ext}</li>
+ <li>{@link javax.microedition.khronos.opengles.GL11ExtensionPack}</li>
+ </ul>
</li>
</ul>
</li>
<li>OpenGL ES 2.0 API Class
<ul>
<li>{@link android.opengl.GLES20 android.opengl.GLES20} - This package provides the
-interface to OpenGL ES 2.0 and is available starting with Android 2.2 (API Level 8).</li>
+ interface to OpenGL ES 2.0 and is available starting with Android 2.2 (API level 8).</li>
+ </ul>
+ </li>
+ <li>OpenGL ES 3.0 API Class
+ <ul>
+ <li>{@link android.opengl.GLES30 android.opengl.GLES30} - This package provides the
+ interface to OpenGL ES 3.0 and is available starting with Android 4.3 (API level 18).</li>
</ul>
</li>
</ul>
-<p>If you'd like to start building an app with OpenGL right away, follow the
-<a href="{@docRoot}training/graphics/opengl/index.html">Displaying Graphics with OpenGL ES</a> class.
+<p>If you want to start building an app with OpenGL ES right away, follow the
+<a href="{@docRoot}training/graphics/opengl/index.html">Displaying Graphics with OpenGL ES</a>
+class.
</p>
<h2 id="manifest">Declaring OpenGL Requirements</h2>
<p>If your application uses OpenGL features that are not available on all devices, you must include
these requirements in your <a
-href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a></code> file.
+href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a> file.
Here are the most common OpenGL manifest declarations:</p>
<ul>
@@ -176,12 +201,28 @@ Here are the most common OpenGL manifest declarations:</p>
shown below.
<pre>
- &lt;!-- Tell the system this app requires OpenGL ES 2.0. --&gt;
- &lt;uses-feature android:glEsVersion="0x00020000" android:required="true" /&gt;
+&lt;!-- Tell the system this app requires OpenGL ES 2.0. --&gt;
+&lt;uses-feature android:glEsVersion="0x00020000" android:required="true" /&gt;
+</pre>
+
+ <p>Adding this declaration causes Google Play to restrict your application from being
+ installed on devices that do not support OpenGL ES 2.0. If your application is exclusively for
+ devices that support OpenGL ES 3.0, you can also specify this in your manifest:</p>
+
+<pre>
+&lt;!-- Tell the system this app requires OpenGL ES 3.0. --&gt;
+&lt;uses-feature android:glEsVersion="0x00030000" android:required="true" /&gt;
</pre>
- <p>Adding this declaration causes Google Play to restrict your application from being
- installed on devices that do not support OpenGL ES 2.0.</p>
+ <p class="note"><strong>Note:</strong>
+ The OpenGL ES 3.0 API is backwards-compatible with the 2.0 API, which means you can be more
+ flexible with your implementation of OpenGL ES in your application. By declaring the OpenGL
+ ES 2.0 API as a requirement in your manifest, you can use that API version as a default, check
+ for the availability of the 3.0 API at run time and then use OpenGL ES 3.0 features if the
+ device supports it. For more information about checking the OpenGL ES version supported by a
+ device, see <a href="#version-check">Checking OpenGL ES Version</a>.
+ </p>
+
</li>
<li><strong>Texture compression requirements</strong> - If your application uses texture
compression formats, you must declare the formats your application supports in your manifest file
@@ -221,6 +262,7 @@ matrix and apply them to the OpenGL rendering pipeline. The projection matrix re
coordinates of your graphics so that they map correctly to Android device screens. The camera view
matrix creates a transformation that renders objects from a specific eye position.</p>
+
<h3 id="proj-es1">Projection and camera view in OpenGL ES 1.0</h3>
<p>In the ES 1.0 API, you apply projection and camera view by creating each matrix and then
adding them to the OpenGL environment.</p>
@@ -235,15 +277,15 @@ implementation to create a projection matrix based on the screen's aspect ratio
OpenGL rendering environment.
<pre>
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- gl.glViewport(0, 0, width, height);
-
- // make adjustments for screen ratio
- float ratio = (float) width / height;
- gl.glMatrixMode(GL10.GL_PROJECTION); // set matrix to projection mode
- gl.glLoadIdentity(); // reset the matrix to its default state
- gl.glFrustumf(-ratio, ratio, -1, 1, 3, 7); // apply the projection matrix
- }
+public void onSurfaceChanged(GL10 gl, int width, int height) {
+ gl.glViewport(0, 0, width, height);
+
+ // make adjustments for screen ratio
+ float ratio = (float) width / height;
+ gl.glMatrixMode(GL10.GL_PROJECTION); // set matrix to projection mode
+ gl.glLoadIdentity(); // reset the matrix to its default state
+ gl.glFrustumf(-ratio, ratio, -1, 1, 3, 7); // apply the projection matrix
+}
</pre>
</li>
@@ -258,24 +300,25 @@ float, float, float, float, float, float) GLU.gluLookAt()} utility to create a v
which simulates a camera position.
<pre>
- public void onDrawFrame(GL10 gl) {
- ...
- // Set GL_MODELVIEW transformation mode
- gl.glMatrixMode(GL10.GL_MODELVIEW);
- gl.glLoadIdentity(); // reset the matrix to its default state
-
- // When using GL_MODELVIEW, you must set the camera view
- GLU.gluLookAt(gl, 0, 0, -5, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
- ...
- }
+public void onDrawFrame(GL10 gl) {
+ ...
+ // Set GL_MODELVIEW transformation mode
+ gl.glMatrixMode(GL10.GL_MODELVIEW);
+ gl.glLoadIdentity(); // reset the matrix to its default state
+
+ // When using GL_MODELVIEW, you must set the camera view
+ GLU.gluLookAt(gl, 0, 0, -5, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
+ ...
+}
</pre>
</li>
</ol>
-<h3 id="proj-es2">Projection and camera view in OpenGL ES 2.0</h3>
-<p>In the ES 2.0 API, you apply projection and camera view by first adding a matrix member to
-the vertex shaders of your graphics objects. With this matrix member added, you can then
+<h3 id="proj-es2">Projection and camera view in OpenGL ES 2.0 and higher</h3>
+
+<p>In the ES 2.0 and 3.0 APIs, you apply projection and camera view by first adding a matrix member
+to the vertex shaders of your graphics objects. With this matrix member added, you can then
generate and apply projection and camera viewing matrices to your objects.</p>
<ol>
@@ -285,20 +328,20 @@ code, the included {@code uMVPMatrix} member allows you to apply projection and
matrices to the coordinates of objects that use this shader.
<pre>
- private final String vertexShaderCode =
+private final String vertexShaderCode =
- // This matrix member variable provides a hook to manipulate
- // the coordinates of objects that use this vertex shader.
- "uniform mat4 uMVPMatrix; \n" +
+ // This matrix member variable provides a hook to manipulate
+ // the coordinates of objects that use this vertex shader.
+ "uniform mat4 uMVPMatrix; \n" +
- "attribute vec4 vPosition; \n" +
- "void main(){ \n" +
- // The matrix must be included as part of gl_Position
- // Note that the uMVPMatrix factor *must be first* in order
- // for the matrix multiplication product to be correct.
- " gl_Position = uMVPMatrix * vPosition; \n" +
+ "attribute vec4 vPosition; \n" +
+ "void main(){ \n" +
+ // The matrix must be included as part of gl_Position
+ // Note that the uMVPMatrix factor *must be first* in order
+ // for the matrix multiplication product to be correct.
+ " gl_Position = uMVPMatrix * vPosition; \n" +
- "} \n";
+ "} \n";
</pre>
<p class="note"><strong>Note:</strong> The example above defines a single transformation matrix
member in the vertex shader into which you apply a combined projection matrix and camera view
@@ -315,38 +358,35 @@ android.opengl.GLSurfaceView.Renderer} implementation to access the matrix
variable defined in the vertex shader above.
<pre>
- public void onSurfaceCreated(GL10 unused, EGLConfig config) {
- ...
- muMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
- ...
- }
+public void onSurfaceCreated(GL10 unused, EGLConfig config) {
+ ...
+ muMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
+ ...
+}
</pre>
</li>
<li><strong>Create projection and camera viewing matrices</strong> - Generate the projection and
viewing matrices to be applied the graphic objects. The following example code shows how to modify
-the {@link
-android.opengl.GLSurfaceView.Renderer#onSurfaceCreated(javax.microedition.khronos.opengles.GL10,
-javax.microedition.khronos.egl.EGLConfig) onSurfaceCreated()} and {@link
-android.opengl.GLSurfaceView.Renderer#onSurfaceChanged(javax.microedition.khronos.opengles.GL10,
-int, int) onSurfaceChanged()} methods of a {@link android.opengl.GLSurfaceView.Renderer}
-implementation to create camera view matrix and a projection matrix based on the screen aspect ratio
-of the device.
+the {@link android.opengl.GLSurfaceView.Renderer#onSurfaceCreated onSurfaceCreated()} and
+{@link android.opengl.GLSurfaceView.Renderer#onSurfaceChanged onSurfaceChanged()} methods of a
+{@link android.opengl.GLSurfaceView.Renderer} implementation to create camera view matrix and a
+projection matrix based on the screen aspect ratio of the device.
<pre>
- public void onSurfaceCreated(GL10 unused, EGLConfig config) {
- ...
- // Create a camera view matrix
- Matrix.setLookAtM(mVMatrix, 0, 0, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
- }
+public void onSurfaceCreated(GL10 unused, EGLConfig config) {
+ ...
+ // Create a camera view matrix
+ Matrix.setLookAtM(mVMatrix, 0, 0, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
+}
- public void onSurfaceChanged(GL10 unused, int width, int height) {
- GLES20.glViewport(0, 0, width, height);
+public void onSurfaceChanged(GL10 unused, int width, int height) {
+ GLES20.glViewport(0, 0, width, height);
- float ratio = (float) width / height;
+ float ratio = (float) width / height;
- // create a projection matrix from device screen geometry
- Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 3, 7);
- }
+ // create a projection matrix from device screen geometry
+ Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 3, 7);
+}
</pre>
</li>
@@ -359,23 +399,24 @@ the projection matrix and camera view created in the code above and then apply i
objects to be rendered by OpenGL.
<pre>
- public void onDrawFrame(GL10 unused) {
- ...
- // Combine the projection and camera view matrices
- Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mVMatrix, 0);
+public void onDrawFrame(GL10 unused) {
+ ...
+ // Combine the projection and camera view matrices
+ Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mVMatrix, 0);
- // Apply the combined projection and camera view transformations
- GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
+ // Apply the combined projection and camera view transformations
+ GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
- // Draw objects
- ...
- }
+ // Draw objects
+ ...
+}
</pre>
</li>
</ol>
<p>For a complete example of how to apply projection and camera view with OpenGL ES 2.0, see the <a
href="{@docRoot}training/graphics/opengl/index.html">Displaying Graphics with OpenGL ES</a> class.</p>
+
<h2 id="faces-winding">Shape Faces and Winding</h2>
<p>In OpenGL, the face of a shape is a surface defined by three or more points in three-dimensional
@@ -414,35 +455,55 @@ So, always define the coordinates of your OpenGL shapes in a counterclockwise dr
clockwise face as the front face, but doing so requires more code and is likely to confuse
experienced OpenGL developers when you ask them for help. So don’t do that.</p>
+
<h2 id="compatibility">OpenGL Versions and Device Compatibility</h2>
<p>The OpenGL ES 1.0 and 1.1 API specifications have been supported since Android 1.0.
-Beginning with Android 2.2 (API Level 8), the framework supports the OpenGL ES 2.0 API
+Beginning with Android 2.2 (API level 8), the framework supports the OpenGL ES 2.0 API
specification. OpenGL ES 2.0 is supported by most Android devices and is recommended for new
-applications being developed with OpenGL. For information about the relative number of
-Android-powered devices that support a given version of OpenGL ES, see the <a
-href="{@docRoot}resources/dashboard/opengl.html">OpenGL ES Versions Dashboard</a>.</p>
+applications being developed with OpenGL. OpenGL ES 3.0 is supported with Android 4.3
+(API level 18) and higher, on devices that provide an implementation of the OpenGL ES 3.0 API.
+For information about the relative number of Android-powered devices
+that support a given version of OpenGL ES, see the
+<a href="{@docRoot}about/dashboards/index.html#OpenGL">OpenGL ES Version Dashboard</a>.</p>
+
+<p>Graphics programming with OpenGL ES 1.0/1.1 API is significantly different than using the 2.0
+and higher versions. The 1.x version of the API has more convenience methods and a fixed graphics
+pipeline, while the OpenGL ES 2.0 and 3.0 APIs provide more direct control of the pipeline through
+use of OpenGL shaders. You should carefully consider the graphics requirements and choose the API
+version that works best for your application. For more information, see
+<a href="#choosing-version">Choosing an OpenGL API Version</a>.</p>
+
+<p>The OpenGL ES 3.0 API provides additional features and better performance than the 2.0 API and is
+also backward compatible. This means that you can potentially write your application targeting
+OpenGL ES 2.0 and conditionally include OpenGL ES 3.0 graphics features if they are available. For
+more information on checking for availability of the 3.0 API, see
+<a href="#version-check">Checking OpenGL ES Version</a></p>
<h3 id="textures">Texture compression support</h3>
+
<p>Texture compression can significantly increase the performance of your OpenGL application by
reducing memory requirements and making more efficient use of memory bandwidth. The Android
framework provides support for the ETC1 compression format as a standard feature, including a {@link
android.opengl.ETC1Util} utility class and the {@code etc1tool} compression tool (located in the
Android SDK at {@code &lt;sdk&gt;/tools/}). For an example of an Android application that uses
-texture compression, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/CompressedTextureActivity.html"
->CompressedTextureActivity</a> code sample.</p>
+texture compression, see the {@code CompressedTextureActivity} code sample in Android SDK
+({@code &lt;sdk&gt;/samples/&lt;version&gt;/ApiDemos/src/com/example/android/apis/graphics/}).</p>
-<p>The ETC format is supported by most Android devices, but it not guarranteed to be available. To
-check if the ETC1 format is supported on a device, call the {@link
-android.opengl.ETC1Util#isETC1Supported() ETC1Util.isETC1Supported()} method.</p>
+<p class="caution"><strong>Caution:</strong> The ETC1 format is supported by most Android devices,
+but it not guaranteed to be available. To check if the ETC1 format is supported on a device, call
+the {@link android.opengl.ETC1Util#isETC1Supported() ETC1Util.isETC1Supported()} method.</p>
<p class="note"><b>Note:</b> The ETC1 texture compression format does not support textures with an
-alpha channel. If your application requires textures with an alpha channel, you should
+transparency (alpha channel). If your application requires textures with transparency, you should
investigate other texture compression formats available on your target devices.</p>
-<p>Beyond the ETC1 format, Android devices have varied support for texture compression based on
+<p>The ETC2/EAC texture compression formats are guaranteed to be available when using the OpenGL ES
+3.0 API. This texture format offers excellent compression ratios with high visual quality and the
+format also supports transparency (alpha channel).</p>
+
+<p>Beyond the ETC formats, Android devices have varied support for texture compression based on
their GPU chipsets and OpenGL implementations. You should investigate texture compression support on
the devices you are are targeting to determine what compression types your application should
support. In order to determine what texture formats are supported on a given device, you must <a
@@ -479,11 +540,12 @@ names, for example:
</ul>
</li>
<li><strong>3DC</strong> - 3DC texture compression (3DC) is a less widely available format that
-supports RGB textures with an an alpha channel. This format is represented by the following OpenGL
-extension name:</li>
+supports RGB textures with an alpha channel. This format is represented by the following OpenGL
+extension name:
<ul>
<li>{@code GL_AMD_compressed_3DC_texture}</li>
</ul>
+ </li>
</ul>
<p class="warning"><strong>Warning:</strong> These texture compression formats are <em>not
@@ -500,6 +562,7 @@ your app is installed only on devices that support the formats your app requires
<a
href="{@docRoot}guide/topics/graphics/opengl.html#manifest">OpenGL manifest declarations</a>.</p>
+
<h3 id="gl-extension-query">Determining OpenGL extensions</h3>
<p>Implementations of OpenGL vary by Android device in terms of the extensions to the OpenGL ES API
that are supported. These extensions include texture compressions, but typically also include other
@@ -511,9 +574,10 @@ particular device:</p>
<li>Run the following code on your target devices to determine what texture compression
formats are supported:
<pre>
- String extensions = javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
+String extensions = javax.microedition.khronos.opengles.GL10.glGetString(
+ GL10.GL_EXTENSIONS);
</pre>
- <p class="warning"><b>Warning:</b> The results of this call <em>vary by device!</em> You
+ <p class="warning"><b>Warning:</b> The results of this call <em>vary by device model!</em> You
must run this call on several target devices to determine what compression types are commonly
supported.</p>
</li>
@@ -522,31 +586,105 @@ device.</li>
</ol>
+<h3 id="version-check">Checking OpenGL ES Version</h3>
+
+<p>There are several versions of the OpenGL ES available on Android devices. You can specify the
+minimum version of the API your application requires in your <a href="#manifest">manifest</a>, but
+you may also want to take advantage of features in a newer API at the same time. For example,
+the OpenGL ES 3.0 API is backward-compatible with the 2.0 version of the API, so you may want to
+write your application so that it uses OpenGL ES 3.0 features, but falls back to the 2.0 API if the
+3.0 API is not available.</p>
+
+<p>Before using OpenGL ES features from a version higher than the minimum required in your
+application manifest, your application should check the version of the API available on the device.
+You can do this in one of two ways:</p>
+
+<ol>
+ <li>Attempt create the higher-level OpenGL ES context ({@link android.opengl.EGLContext}) and
+ check the result.</li>
+ <li>Create a minimum-supported OpenGL ES context and check the version value.</li>
+</ol>
+
+<p>The following example code demonstrates how to check the available OpenGL ES version by creating
+an {@link android.opengl.EGLContext} and checking the result. This example shows how to check for
+OpenGL ES 3.0 version:</p>
+
+<pre>
+private static double glVersion = 3.0;
+
+private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
+
+ private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
+
+ public EGLContext createContext(
+ EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
+
+ Log.w(TAG, "creating OpenGL ES " + glVersion + " context");
+ int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, (int) glVersion,
+ EGL10.EGL_NONE };
+ // attempt to create a OpenGL ES 3.0 context
+ EGLContext context = egl.eglCreateContext(
+ display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
+ return context; // returns null if 3.0 is not supported;
+ }
+}
+</pre>
+
+<p>If the {@code createContext()} method show above returns null, your code should create a OpenGL
+ES 2.0 context instead and fall back to using only that API.</p>
+
+<p>The following code example demonstrates how to check the OpenGL ES version by creating a minimum
+supported context first, and then checking the version string:</p>
+
+<pre>
+// Create a minimum supported OpenGL ES context, then check:
+String version = javax.microedition.khronos.opengles.GL10.glGetString(
+ GL10.GL_VERSION);
+Log.w(TAG, "Version: " + version );
+// The version format is displayed as: "OpenGL ES &lt;major&gt;.&lt;minor&gt;"
+// followed by optional content provided by the implementation.
+</pre>
+
+<p>With this approach, if you discover that the device supports a higher-level API version, you
+must destroy the minimum OpenGL ES context and create a new context with the higher
+available API version.</p>
+
+
<h2 id="choosing-version">Choosing an OpenGL API Version</h2>
-<p>OpenGL ES API version 1.0 (and the 1.1 extensions) and version 2.0 both provide high
+<p>OpenGL ES 1.0 API version (and the 1.1 extensions), version 2.0, and version 3.0 all provide high
performance graphics interfaces for creating 3D games, visualizations and user interfaces. Graphics
-programming for the OpenGL ES 1.0/1.1 API versus ES 2.0 differs significantly, and so developers
-should carefully consider the following factors before starting development with either API:</p>
+progamming for OpenGL ES 2.0 and 3.0 is largely similar, with version 3.0 representing a superset
+of the 2.0 API with additional features. Programming for the OpenGL ES 1.0/1.1 API versus OpenGL ES
+2.0 and 3.0 differs significantly, and so developers should carefully consider the following
+factors before starting development with these APIs:</p>
<ul>
- <li><strong>Performance</strong> - In general, OpenGL ES 2.0 provides faster graphics performance
-than the ES 1.0/1.1 APIs. However, the performance difference can vary depending on the Android
-device your OpenGL application is running on, due to differences in the implementation of the OpenGL
-graphics pipeline.</li>
+ <li><strong>Performance</strong> - In general, OpenGL ES 2.0 and 3.0 provide faster graphics
+ performance than the ES 1.0/1.1 APIs. However, the performance difference can vary depending on
+ the Android device your OpenGL application is running on, due to differences in hardware
+ manufacturer's implementation of the OpenGL ES graphics pipeline.</li>
<li><strong>Device Compatibility</strong> - Developers should consider the types of devices,
-Android versions and the OpenGL ES versions available to their customers. For more information
-on OpenGL compatibility across devices, see the <a href="#compatibility">OpenGL Versions and Device
-Compatibility</a> section.</li>
+ Android versions and the OpenGL ES versions available to their customers. For more information
+ on OpenGL compatibility across devices, see the <a href="#compatibility">OpenGL Versions and
+ Device Compatibility</a> section.</li>
<li><strong>Coding Convenience</strong> - The OpenGL ES 1.0/1.1 API provides a fixed function
-pipeline and convenience functions which are not available in the ES 2.0 API. Developers who are new
-to OpenGL may find coding for OpenGL ES 1.0/1.1 faster and more convenient.</li>
- <li><strong>Graphics Control</strong> - The OpenGL ES 2.0 API provides a higher degree
-of control by providing a fully programmable pipeline through the use of shaders. With more
-direct control of the graphics processing pipeline, developers can create effects that would be
-very difficult to generate using the 1.0/1.1 API.</li>
+ pipeline and convenience functions which are not available in the OpenGL ES 2.0 or 3.0 APIs.
+ Developers who are new to OpenGL ES may find coding for version 1.0/1.1 faster and more
+ convenient.</li>
+ <li><strong>Graphics Control</strong> - The OpenGL ES 2.0 and 3.0 APIs provide a higher degree
+ of control by providing a fully programmable pipeline through the use of shaders. With more
+ direct control of the graphics processing pipeline, developers can create effects that would be
+ very difficult to generate using the 1.0/1.1 API.</li>
+ <li><strong>Texture Support</strong> - The OpenGL ES 3.0 API has the best support for texture
+ compression because it guarantees availability of the ETC2 compression format, which supports
+ transparency. The 1.x and 2.0 API implementations usually include support for ETC1, however
+ this texture format does not support transparency and so you must typically provide resources
+ in other compression formats supported by the devices you are targeting. For more information,
+ see <a href="#textures">Texture compression support</a>.</li>
</ul>
<p>While performance, compatibility, convenience, control and other factors may influence your
decision, you should pick an OpenGL API version based on what you think provides the best experience
for your users.</p>
+
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index adc795d6437f..8df1fdff8ffa 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -54,85 +54,85 @@ parent.link=manifest-intro.html
<br/><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a></code></dd>
<dt>description:</dt>
-<dd>Declares an activity (an {@link android.app.Activity} subclass) that
-implements part of the application's visual user interface. All activities
-must be represented by {@code &lt;activity&gt;}
-elements in the manifest file. Any that are not declared there will not be seen
+<dd>Declares an activity (an {@link android.app.Activity} subclass) that
+implements part of the application's visual user interface. All activities
+must be represented by {@code &lt;activity&gt;}
+elements in the manifest file. Any that are not declared there will not be seen
by the system and will never be run.
<dt>attributes:</dt>
<dd><dl class="attr">
<dt><a name="reparent"></a>{@code android:allowTaskReparenting}</dt>
-<dd>Whether or not the activity can move from the task that started it to
-the task it has an affinity for when that task is next brought to the
-front &mdash; "{@code true}" if it can move, and "{@code false}" if it
-must remain with the task where it started.
+<dd>Whether or not the activity can move from the task that started it to
+the task it has an affinity for when that task is next brought to the
+front &mdash; "{@code true}" if it can move, and "{@code false}" if it
+must remain with the task where it started.
<p>
-If this attribute is not set, the value set by the corresponding
+If this attribute is not set, the value set by the corresponding
<code><a href="{@docRoot}guide/topics/manifest/application-element.html#reparent">allowTaskReparenting</a></code>
-attribute of the <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element
+attribute of the <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element
applies to the activity. The default value is "{@code false}".
</p>
<p>
-Normally when an activity is started, it's associated with the task of
-the activity that started it and it stays there for its entire lifetime.
-You can use this attribute to force it to be re-parented to the task it
-has an affinity for when its current task is no longer displayed.
-Typically, it's used to cause the activities of an application to move
+Normally when an activity is started, it's associated with the task of
+the activity that started it and it stays there for its entire lifetime.
+You can use this attribute to force it to be re-parented to the task it
+has an affinity for when its current task is no longer displayed.
+Typically, it's used to cause the activities of an application to move
to the main task associated with that application.
</p>
<p>
-For example, if an e-mail message contains a link to a web page, clicking
-the link brings up an activity that can display the page. That activity
-is defined by the browser application, but is launched as part of the e-mail
-task. If it's reparented to the browser task, it will be shown when the
-browser next comes to the front, and will be absent when the e-mail task
+For example, if an e-mail message contains a link to a web page, clicking
+the link brings up an activity that can display the page. That activity
+is defined by the browser application, but is launched as part of the e-mail
+task. If it's reparented to the browser task, it will be shown when the
+browser next comes to the front, and will be absent when the e-mail task
again comes forward.
</p>
<p>
-The affinity of an activity is defined by the
-<code><a href="#aff">taskAffinity</a></code> attribute. The affinity
+The affinity of an activity is defined by the
+<code><a href="#aff">taskAffinity</a></code> attribute. The affinity
of a task is determined by reading the affinity of its root activity.
Therefore, by definition, a root activity is always in a task with the
-same affinity. Since activities with "{@code singleTask}" or
+same affinity. Since activities with "{@code singleTask}" or
"{@code singleInstance}" launch modes can only be at the root of a task,
-re-parenting is limited to the "{@code standard}" and "{@code singleTop}"
-modes. (See also the <code><a href="#lmode">launchMode</a></code>
+re-parenting is limited to the "{@code standard}" and "{@code singleTop}"
+modes. (See also the <code><a href="#lmode">launchMode</a></code>
attribute.)
</p></dd>
<dt><a name="always"></a>{@code android:alwaysRetainTaskState}</dt>
-<dd>Whether or not the state of the task that the activity is in will always
-be maintained by the system &mdash; "{@code true}" if it will be, and
-"{@code false}" if the system is allowed to reset the task to its initial
-state in certain situations. The default value is "{@code false}". This
-attribute is meaningful only for the root activity of a task; it's ignored
+<dd>Whether or not the state of the task that the activity is in will always
+be maintained by the system &mdash; "{@code true}" if it will be, and
+"{@code false}" if the system is allowed to reset the task to its initial
+state in certain situations. The default value is "{@code false}". This
+attribute is meaningful only for the root activity of a task; it's ignored
for all other activities.
<p>
-Normally, the system clears a task (removes all activities from the stack
-above the root activity) in certain situations when the user re-selects that
-task from the home screen. Typically, this is done if the user hasn't visited
+Normally, the system clears a task (removes all activities from the stack
+above the root activity) in certain situations when the user re-selects that
+task from the home screen. Typically, this is done if the user hasn't visited
the task for a certain amount of time, such as 30 minutes.
</p>
<p>
-However, when this attribute is "{@code true}", users will always return
-to the task in its last state, regardless of how they get there. This is
-useful, for example, in an application like the web browser where there is
+However, when this attribute is "{@code true}", users will always return
+to the task in its last state, regardless of how they get there. This is
+useful, for example, in an application like the web browser where there is
a lot of state (such as multiple open tabs) that users would not like to lose.
</p></dd>
<dt><a name="clear"></a>{@code android:clearTaskOnLaunch}</dt>
-<dd>Whether or not all activities will be removed from the task, except for
-the root activity, whenever it is re-launched from the home screen &mdash;
-"{@code true}" if the task is always stripped down to its root activity, and
-"{@code false}" if not. The default value is "{@code false}". This attribute
-is meaningful only for activities that start a new task (the root activity);
+<dd>Whether or not all activities will be removed from the task, except for
+the root activity, whenever it is re-launched from the home screen &mdash;
+"{@code true}" if the task is always stripped down to its root activity, and
+"{@code false}" if not. The default value is "{@code false}". This attribute
+is meaningful only for activities that start a new task (the root activity);
it's ignored for all other activities in the task.
<p>
@@ -140,24 +140,24 @@ When the value is "{@code true}", every time users start the task again, they
are brought to its root activity regardless of what they were last doing in
the task and regardless of whether they used the <em>Back</em> or <em>Home</em> button to
leave it. When the value is "{@code false}", the task may be cleared of activities in
-some situations (see the
-<code><a href="#always">alwaysRetainTaskState</a></code> attribute), but not always.
+some situations (see the
+<code><a href="#always">alwaysRetainTaskState</a></code> attribute), but not always.
</p>
<p>
-Suppose, for example, that someone launches activity P from the home screen,
-and from there goes to activity Q. The user next presses <em>Home</em>, and then returns
-to activity P. Normally, the user would see activity Q, since that is what they
-were last doing in P's task. However, if P set this flag to "{@code true}", all
-of the activities on top of it (Q in this case) were removed when the user pressed
-<em>Home</em> and the task went to the background. So the user sees only P when returning
+Suppose, for example, that someone launches activity P from the home screen,
+and from there goes to activity Q. The user next presses <em>Home</em>, and then returns
+to activity P. Normally, the user would see activity Q, since that is what they
+were last doing in P's task. However, if P set this flag to "{@code true}", all
+of the activities on top of it (Q in this case) were removed when the user pressed
+<em>Home</em> and the task went to the background. So the user sees only P when returning
to the task.
</p>
<p>
-If this attribute and <code><a href="#reparent">allowTaskReparenting</a></code>
-are both "{@code true}", any activities that can be re-parented are moved to
-the task they share an affinity with; the remaining activities are then dropped,
+If this attribute and <code><a href="#reparent">allowTaskReparenting</a></code>
+are both "{@code true}", any activities that can be re-parented are moved to
+the task they share an affinity with; the remaining activities are then dropped,
as described above.
</p></dd>
@@ -169,7 +169,7 @@ activity remains running and its <code>{@link android.app.Activity#onConfigurati
onConfigurationChanged()}</code> method is called.
<p class="note"><strong>Note:</strong> Using this attribute should be
-avoided and used only as a last-resort. Please read <a
+avoided and used only as a last resort. Please read <a
href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime Changes</a> for more
information about how to properly handle a restart due to a configuration change.</p>
@@ -220,11 +220,11 @@ separated by '{@code |}' &mdash; for example, "{@code locale|navigation|orientat
<td>"{@code uiMode}"</td>
<td>The user interface mode has changed &mdash; this can be caused when the user places the
device into a desk/car dock or when the night mode changes. See {@link
-android.app.UiModeManager}.
+android.app.UiModeManager}.
<em>Added in API level 8</em>.</td>
</tr><tr>
<td>"{@code orientation}"</td>
- <td>The screen orientation has changed &mdash; the user has rotated the device.
+ <td>The screen orientation has changed &mdash; the user has rotated the device.
<p class="note"><strong>Note:</strong> If your application targets API level 13 or higher (as
declared by the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
minSdkVersion}</a> and <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
@@ -258,70 +258,70 @@ restart your activity, even when running on an Android 3.2 or higher device).
</table>
<p>
-All of these configuration changes can impact the resource values seen by the
-application. Therefore, when <code>{@link android.app.Activity#onConfigurationChanged
-onConfigurationChanged()}</code> is called, it will generally be necessary to again
-retrieve all resources (including view layouts, drawables, and so on) to correctly
-handle the change.
+All of these configuration changes can impact the resource values seen by the
+application. Therefore, when <code>{@link android.app.Activity#onConfigurationChanged
+onConfigurationChanged()}</code> is called, it will generally be necessary to again
+retrieve all resources (including view layouts, drawables, and so on) to correctly
+handle the change.
</p></dd>
<dt><a name="enabled"></a>{@code android:enabled}</dt>
-<dd>Whether or not the activity can be instantiated by the system &mdash;
-"{@code true}" if it can be, and "{@code false}" if not. The default value
+<dd>Whether or not the activity can be instantiated by the system &mdash;
+"{@code true}" if it can be, and "{@code false}" if not. The default value
is "{@code true}".
<p>
-The <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element has its own
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code>
-attribute that applies to all application components, including activities. The
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
-and {@code &lt;activity&gt;} attributes must both be "{@code true}" (as they both
-are by default) for the system to be able to instantiate the activity. If either
+The <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element has its own
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code>
+attribute that applies to all application components, including activities. The
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+and {@code &lt;activity&gt;} attributes must both be "{@code true}" (as they both
+are by default) for the system to be able to instantiate the activity. If either
is "{@code false}", it cannot be instantiated.
</p></dd>
<dt><a name="exclude"></a>{@code android:excludeFromRecents}</dt>
<dd>Whether or not the task initiated by this activity should be excluded from the list of recently
used applications ("recent apps"). That is, when this activity is the root activity of a new task,
-this attribute determines whether the task should not appear in the list of recent apps. "{@code
-true}" if the task should be <em>excluded</em> from the list; "{@code false}" if it should be
+this attribute determines whether the task should not appear in the list of recent apps. Set "{@code
+true}" if the task should be <em>excluded</em> from the list; set "{@code false}" if it should be
<em>included</em>. The default value is "{@code false}".
</p></dd>
<dt><a name="exported"></a>{@code android:exported}</dt>
-<dd>Whether or not the activity can be launched by components of other
-applications &mdash; "{@code true}" if it can be, and "{@code false}" if not.
-If "{@code false}", the activity can be launched only by components of the
-same application or applications with the same user ID.
+<dd>Whether or not the activity can be launched by components of other
+applications &mdash; "{@code true}" if it can be, and "{@code false}" if not.
+If "{@code false}", the activity can be launched only by components of the
+same application or applications with the same user ID.
<p>
-The default value depends on whether the activity contains intent filters. The
-absence of any filters means that the activity can be invoked only by specifying
-its exact class name. This implies that the activity is intended only for
-application-internal use (since others would not know the class name). So in
+The default value depends on whether the activity contains intent filters. The
+absence of any filters means that the activity can be invoked only by specifying
+its exact class name. This implies that the activity is intended only for
+application-internal use (since others would not know the class name). So in
this case, the default value is "{@code false}".
-On the other hand, the presence of at least one filter implies that the activity
+On the other hand, the presence of at least one filter implies that the activity
is intended for external use, so the default value is "{@code true}".
</p>
<p>
This attribute is not the only way to limit an activity's exposure to other
-applications. You can also use a permission to limit the external entities that
-can invoke the activity (see the
-<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#prmsn">permission</a></code>
+applications. You can also use a permission to limit the external entities that
+can invoke the activity (see the
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#prmsn">permission</a></code>
attribute).
</p></dd>
<dt><a name="finish"></a>{@code android:finishOnTaskLaunch}</dt>
-<dd>Whether or not an existing instance of the activity should be shut down
-(finished) whenever the user again launches its task (chooses the task on the
-home screen) &mdash; "{@code true}" if it should be shut down, and "{@code false}"
+<dd>Whether or not an existing instance of the activity should be shut down
+(finished) whenever the user again launches its task (chooses the task on the
+home screen) &mdash; "{@code true}" if it should be shut down, and "{@code false}"
if not. The default value is "{@code false}".
<p>
-If this attribute and
-<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code>
-are both "{@code true}", this attribute trumps the other. The affinity of the
+If this attribute and
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code>
+are both "{@code true}", this attribute trumps the other. The affinity of the
activity is ignored. The activity is not re-parented, but destroyed.
</p>
@@ -346,58 +346,58 @@ make use of the renderer without errors.</p>
</dd>
<dt><a name="icon"></a>{@code android:icon}</dt>
-<dd>An icon representing the activity. The icon is displayed to users when
-a representation of the activity is required on-screen. For example, icons
-for activities that initiate tasks are displayed in the launcher window.
+<dd>An icon representing the activity. The icon is displayed to users when
+a representation of the activity is required on-screen. For example, icons
+for activities that initiate tasks are displayed in the launcher window.
The icon is often accompanied by a label (see the <a href="#label">{@code
android:label}</a> attribute).
</p>
<p>
-This attribute must be set as a reference to a drawable resource containing
-the image definition. If it is not set, the icon specified for the application
-as a whole is used instead (see the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+This attribute must be set as a reference to a drawable resource containing
+the image definition. If it is not set, the icon specified for the application
+as a whole is used instead (see the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
element's <code><a href="{@docRoot}guide/topics/manifest/application-element.html#icon">icon</a></code> attribute).
</p>
<p>
-The activity's icon &mdash; whether set here or by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
-element &mdash; is also the default icon for all the activity's intent filters (see the
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#icon">icon</a></code> attribute).
+The activity's icon &mdash; whether set here or by the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+element &mdash; is also the default icon for all the activity's intent filters (see the
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#icon">icon</a></code> attribute).
</p></dd>
<dt><a name="label"></a>{@code android:label}</dt>
-<dd>A user-readable label for the activity. The label is displayed on-screen
-when the activity must be represented to the user. It's often displayed along
+<dd>A user-readable label for the activity. The label is displayed on-screen
+when the activity must be represented to the user. It's often displayed along
with the activity icon.
<p>
-If this attribute is not set, the label set for the application as a whole is
-used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element's
+If this attribute is not set, the label set for the application as a whole is
+used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element's
<code><a href="{@docRoot}guide/topics/manifest/application-element.html#label">label</a></code> attribute).
</p>
<p>
-The activity's label &mdash; whether set here or by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element &mdash; is also the
-default label for all the activity's intent filters (see the
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#label">label</a></code> attribute).
+The activity's label &mdash; whether set here or by the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element &mdash; is also the
+default label for all the activity's intent filters (see the
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#label">label</a></code> attribute).
</p>
<p>
The label should be set as a reference to a string resource, so that
-it can be localized like other strings in the user interface.
-However, as a convenience while you're developing the application,
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
it can also be set as a raw string.
</p></dd>
<dt><a name="lmode"></a>{@code android:launchMode}</dt>
<dd>An instruction on how the activity should be launched. There are four modes
-that work in conjunction with activity flags ({@code FLAG_ACTIVITY_*} constants)
+that work in conjunction with activity flags ({@code FLAG_ACTIVITY_*} constants)
in {@link android.content.Intent} objects to determine what should happen when
the activity is called upon to handle an intent. They are:</p>
@@ -417,7 +417,7 @@ As shown in the table below, the modes fall into two main groups, with
An activity with the "{@code standard}" or "{@code singleTop}" launch mode
can be instantiated multiple times. The instances can belong to any task
and can be located anywhere in the activity stack. Typically, they're
-launched into the task that called
+launched into the task that called
<code>{@link android.content.Context#startActivity startActivity()}</code>
(unless the Intent object contains a
<code>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</code>
@@ -433,7 +433,7 @@ Moreover, the device can hold only one instance of the activity at a time
</p>
<p>
-The "{@code standard}" and "{@code singleTop}" modes differ from each other
+The "{@code standard}" and "{@code singleTop}" modes differ from each other
in just one respect: Every time there's a new intent for a "{@code standard}"
activity, a new instance of the class is created to respond to that intent.
Each instance handles a single intent.
@@ -509,41 +509,41 @@ common and useful launch mode for many types of activities. The other modes
&mdash; <code>singleTask</code> and <code>singleInstance</code> &mdash; are
<span style="color:red">not appropriate for most applications</span>,
since they result in an interaction model that is likely to be unfamiliar to
-users and is very different from most other applications.
+users and is very different from most other applications.
<p>Regardless of the launch mode that you choose, make sure to test the usability
of the activity during launch and when navigating back to it from
other activities and tasks using the <em>Back</em> button. </p>
<p>For more information on launch modes and their interaction with Intent
-flags, see the
+flags, see the
<a href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a>
document.
</p>
</dd>
<dt><a name="multi"></a>{@code android:multiprocess}</dt>
-<dd>Whether an instance of the activity can be launched into the process of the component
-that started it &mdash; "{@code true}" if it can be, and "{@code false}" if not.
+<dd>Whether an instance of the activity can be launched into the process of the component
+that started it &mdash; "{@code true}" if it can be, and "{@code false}" if not.
The default value is "{@code false}".
<p>
-Normally, a new instance of an activity is launched into the process of the
-application that defined it, so all instances of the activity run in the same
-process. However, if this flag is set to "{@code true}", instances of the
-activity can run in multiple processes, allowing the system to create instances
-wherever they are used (provided permissions allow it), something that is almost
+Normally, a new instance of an activity is launched into the process of the
+application that defined it, so all instances of the activity run in the same
+process. However, if this flag is set to "{@code true}", instances of the
+activity can run in multiple processes, allowing the system to create instances
+wherever they are used (provided permissions allow it), something that is almost
never necessary or desirable.
</p></dd>
<dt><a name="nm"></a>{@code android:name}</dt>
-<dd>The name of the class that implements the activity, a subclass of
-{@link android.app.Activity}. The attribute value should be a fully qualified
-class name (such as, "{@code com.example.project.ExtracurricularActivity}").
-However, as a shorthand, if the first character of the name is a period
-(for example, "{@code .ExtracurricularActivity}"), it is appended to the
-package name specified in the
-<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
+<dd>The name of the class that implements the activity, a subclass of
+{@link android.app.Activity}. The attribute value should be a fully qualified
+class name (such as, "{@code com.example.project.ExtracurricularActivity}").
+However, as a shorthand, if the first character of the name is a period
+(for example, "{@code .ExtracurricularActivity}"), it is appended to the
+package name specified in the
+<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
element.
<p>Once you publish your application, you <a
href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">should not
@@ -557,9 +557,9 @@ There is no default. The name must be specified.
<!-- ##api level 3## -->
<dt><a name="nohist"></a>{@code android:noHistory}</dt>
<dd>Whether or not the activity should be removed from the activity stack and
-finished (its <code>{@link android.app.Activity#finish finish()}</code>
-method called) when the user navigates away from it and it's no longer
-visible on screen &mdash; "{@code true}" if it should be finished, and
+finished (its <code>{@link android.app.Activity#finish finish()}</code>
+method called) when the user navigates away from it and it's no longer
+visible on screen &mdash; "{@code true}" if it should be finished, and
"{@code false}" if not. The default value is "{@code false}".
<p>
@@ -575,14 +575,33 @@ This attribute was introduced in API Level 3.
<!-- api level 16 -->
<dt><a name="parent"></a>{@code android:parentActivityName}</dt>
-<dd>The class name of the logical parent of the activity. The name here must be formatted
- the same as the corresponding activity is declared in its own
- <a href="#nm">android:name</a>.
-
+<dd>The class name of the logical parent of the activity. The name here must match the class
+ name given to the corresponding {@code &lt;activity>} element's
+ <a href="#nm"><code>android:name</code></a> attribute.
+
<p>The system reads this attribute to determine which activity should be started when
the use presses the Up button in the action bar. The system can also use this information to
synthesize a back stack of activities with {@link android.app.TaskStackBuilder}.</p>
+<p>To support API levels 4 - 16, you can also declare the parent activity with a {@code
+&lt;meta-data>} element that specifies a value for {@code "android.support.PARENT_ACTIVITY"}.
+For example:</p>
+<pre>
+&lt;activity
+ android:name="com.example.app.ChildActivity"
+ android:label="@string/title_child_activity"
+ android:parentActivityName="com.example.myfirstapp.MainActivity" >
+ &lt;!-- Parent activity meta-data to support API level 4+ -->
+ &lt;meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.example.app.MainActivity" />
+&lt;/activity>
+</pre>
+
+<p>For more information about declaring the parent activity to support Up navigation,
+read <a href="{@docRoot}training/implementing-navigation/ancestral.html">Providing Up
+Navigation</a>.</p>
+
<p>
This attribute was introduced in API Level 16.
</p>
@@ -591,63 +610,67 @@ This attribute was introduced in API Level 16.
<dt><a name="prmsn"></a>{@code android:permission}</dt>
-<dd>The name of a permission that clients must have to launch the activity
-or otherwise get it to respond to an intent. If a caller of
+<dd>The name of a permission that clients must have to launch the activity
+or otherwise get it to respond to an intent. If a caller of
<code>{@link android.content.Context#startActivity startActivity()}</code> or
<code>{@link android.app.Activity#startActivityForResult startActivityForResult()}</code>
-has not been granted the specified permission, its intent will not be
+has not been granted the specified permission, its intent will not be
delivered to the activity.
<p>
-If this attribute is not set, the permission set by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+If this attribute is not set, the permission set by the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#prmsn">permission</a></code>
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#prmsn">permission</a></code>
attribute applies to the activity. If neither attribute is set, the activity is
not protected by a permission.
</p>
<p>
-For more information on permissions, see the
-<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a>
-section in the introduction and another document,
+For more information on permissions, see the
+<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a>
+section in the introduction and another document,
<a href="{@docRoot}guide/topics/security/security.html">Security and
Permissions</a>.
</p></dd>
<dt><a name="proc"></a>{@code android:process}</dt>
-<dd>The name of the process in which the activity should run. Normally,
-all components of an application run in the default process created for the
-application. It has the same name as the application package. The <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code>
-attribute can set a different default for all components. But each component
-can override the default, allowing you to spread your application across
+<dd>The name of the process in which the activity should run. Normally, all components of an
+application run in a default process name created for the application and you do
+not need to use this attribute. But if necessary, you can override the default process
+name with this attribute, allowing you to spread your app components across
multiple processes.
<p>
-If the name assigned to this attribute begins with a colon (':'), a new
-process, private to the application, is created when it's needed and
+If the name assigned to this attribute begins with a colon (':'), a new
+process, private to the application, is created when it's needed and
the activity runs in that process.
-If the process name begins with a lowercase character, the activity will run
+If the process name begins with a lowercase character, the activity will run
in a global process of that name, provided that it has permission to do so.
-This allows components in different applications to share a process, reducing
+This allows components in different applications to share a process, reducing
resource usage.
-</p></dd>
+</p>
+
+<p>The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"
+>&lt;application&gt;</a></code> element's
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code>
+attribute can set a different default process name for all components.
+</dd>
<dt><a name="screen"></a>{@code android:screenOrientation}</dt>
-<dd>The orientation of the activity's display on the device.
-
+<dd>The orientation of the activity's display on the device.
+
<p>The value can be any one of the following strings:</p>
<table>
<tr>
<td>"{@code unspecified}"</td>
<td>The default value. The system chooses the orientation. The policy it
- uses, and therefore the choices made in specific contexts, may differ
+ uses, and therefore the choices made in specific contexts, may differ
from device to device.</td>
</tr><tr>
<td>"{@code behind}"</td>
- <td>The same orientation as the activity that's immediately beneath it in
+ <td>The same orientation as the activity that's immediately beneath it in
the activity stack.</td>
</tr><tr>
<td>"{@code landscape}"</td>
@@ -736,76 +759,76 @@ control whether your app can be installed when a device supports only certain or
</dd>
<dt><a name="state"></a>{@code android:stateNotNeeded}</dt>
-<dd>Whether or not the activity can be killed and successfully restarted
-without having saved its state &mdash; "{@code true}" if it can be restarted
-without reference to its previous state, and "{@code false}" if its previous
+<dd>Whether or not the activity can be killed and successfully restarted
+without having saved its state &mdash; "{@code true}" if it can be restarted
+without reference to its previous state, and "{@code false}" if its previous
state is required. The default value is "{@code false}".
<p>
-Normally, before an activity is temporarily shut down to save resources, its
-<code>{@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}</code>
-method is called. This method stores the current state of the activity in a
-{@link android.os.Bundle} object, which is then passed to
-<code>{@link android.app.Activity#onCreate onCreate()}</code> when the activity
-is restarted. If this attribute is set to "{@code true}",
-{@code onSaveInstanceState()} may not be called and {@code onCreate()} will
-be passed {@code null} instead of the Bundle &mdash; just as it was when the
+Normally, before an activity is temporarily shut down to save resources, its
+<code>{@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}</code>
+method is called. This method stores the current state of the activity in a
+{@link android.os.Bundle} object, which is then passed to
+<code>{@link android.app.Activity#onCreate onCreate()}</code> when the activity
+is restarted. If this attribute is set to "{@code true}",
+{@code onSaveInstanceState()} may not be called and {@code onCreate()} will
+be passed {@code null} instead of the Bundle &mdash; just as it was when the
activity started for the first time.
</p>
<p>
-A "{@code true}" setting ensures that the activity can be restarted in the
-absence of retained state. For example, the activity that displays the
-home screen uses this setting to make sure that it does not get removed if it
+A "{@code true}" setting ensures that the activity can be restarted in the
+absence of retained state. For example, the activity that displays the
+home screen uses this setting to make sure that it does not get removed if it
crashes for some reason.
</p></dd>
<dt><a name="aff"></a>{@code android:taskAffinity}</dt>
-<dd>The task that the activity has an affinity for. Activities with
+<dd>The task that the activity has an affinity for. Activities with
the same affinity conceptually belong to the same task (to the same
-"application" from the user's perspective). The affinity of a task
-is determined by the affinity of its root activity.
+"application" from the user's perspective). The affinity of a task
+is determined by the affinity of its root activity.
<p>
-The affinity determines two things &mdash; the task that the activity is re-parented
-to (see the <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code>
-attribute) and the task that will house the activity when it is launched
-with the <code>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</code>
+The affinity determines two things &mdash; the task that the activity is re-parented
+to (see the <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code>
+attribute) and the task that will house the activity when it is launched
+with the <code>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</code>
flag.
</p>
<p>
By default, all activities in an application have the same affinity. You
can set this attribute to group them differently, and even place
-activities defined in different applications within the same task. To
+activities defined in different applications within the same task. To
specify that the activity does not have an affinity for any task, set
it to an empty string.
<p>
-If this attribute is not set, the activity inherits the affinity set
-for the application (see the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
-element's
+If this attribute is not set, the activity inherits the affinity set
+for the application (see the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+element's
<code><a href="{@docRoot}guide/topics/manifest/application-element.html#aff">taskAffinity</a></code>
-attribute). The name of the default affinity for an application is
-the package name set by the
-<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
+attribute). The name of the default affinity for an application is
+the package name set by the
+<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
element.
</p>
<dt><a name="theme"></a>{@code android:theme}</dt>
-<dd>A reference to a style resource defining an overall theme for the activity.
+<dd>A reference to a style resource defining an overall theme for the activity.
This automatically sets the activity's context to use this theme (see
-<code>{@link android.content.Context#setTheme setTheme()}</code>, and may also
-cause "starting" animations prior to the activity being launched (to better
+<code>{@link android.content.Context#setTheme setTheme()}</code>, and may also
+cause "starting" animations prior to the activity being launched (to better
match what the activity actually looks like).
<p>
-If this attribute is not set, the activity inherits the theme set for the
-application as a whole &mdash; from the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
-element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#theme">theme</a></code>
+If this attribute is not set, the activity inherits the theme set for the
+application as a whole &mdash; from the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+element's
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#theme">theme</a></code>
attribute. If that attribute is also not set, the default system theme is used. For more
information, see the <a
href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a> developer guide.
@@ -837,32 +860,32 @@ href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.<
<!-- ##api level 3## -->
<dt><a name="wsoft"></a>{@code android:windowSoftInputMode}</dt>
-<dd>How the main window of the activity interacts with the window containing
-the on-screen soft keyboard. The setting for this attribute affects two
-things:
+<dd>How the main window of the activity interacts with the window containing
+the on-screen soft keyboard. The setting for this attribute affects two
+things:
-<ul>
-<li>The state of the soft keyboard &mdash; whether it is hidden or visible
+<ul>
+<li>The state of the soft keyboard &mdash; whether it is hidden or visible
&mdash; when the activity becomes the focus of user attention.</li>
-<li>The adjustment made to the activity's main window &mdash; whether it is
-resized smaller to make room for the soft keyboard or whether its contents
-pan to make the current focus visible when part of the window is covered by
+<li>The adjustment made to the activity's main window &mdash; whether it is
+resized smaller to make room for the soft keyboard or whether its contents
+pan to make the current focus visible when part of the window is covered by
the soft keyboard.</li>
</ul>
<p>
-The setting must be one of the values listed in the following table, or a
-combination of one "{@code state...}" value plus one "{@code adjust...}"
-value. Setting multiple values in either group &mdash; multiple
-"{@code state...}" values, for example &mdash; has undefined results.
+The setting must be one of the values listed in the following table, or a
+combination of one "{@code state...}" value plus one "{@code adjust...}"
+value. Setting multiple values in either group &mdash; multiple
+"{@code state...}" values, for example &mdash; has undefined results.
Individual values are separated by a vertical bar ({@code |}). For example:
</p>
<pre>&lt;activity android:windowSoftInputMode="stateVisible|adjustResize" . . . &gt;</pre>
<p>
-Values set here (other than "{@code stateUnspecified}" and
+Values set here (other than "{@code stateUnspecified}" and
"{@code adjustUnspecified}") override values set in the theme.
</p>
@@ -872,9 +895,9 @@ Values set here (other than "{@code stateUnspecified}" and
<th>Description</th>
</tr><tr>
<td>"{@code stateUnspecified}"</td>
- <td>The state of the soft keyboard (whether it is hidden or visible)
+ <td>The state of the soft keyboard (whether it is hidden or visible)
is not specified. The system will choose an appropriate state or
- rely on the setting in the theme.
+ rely on the setting in the theme.
<p>
This is the default setting for the behavior of the soft keyboard.
@@ -885,32 +908,32 @@ Values set here (other than "{@code stateUnspecified}" and
whether visible or hidden, when the activity comes to the fore.</td>
</tr></tr>
<td>"{@code stateHidden}"</td>
- <td>The soft keyboard is hidden when the user chooses the activity
- &mdash; that is, when the user affirmatively navigates forward to the
+ <td>The soft keyboard is hidden when the user chooses the activity
+ &mdash; that is, when the user affirmatively navigates forward to the
activity, rather than backs into it because of leaving another activity.</td>
</tr></tr>
<td>"{@code stateAlwaysHidden}"</td>
- <td>The soft keyboard is always hidden when the activity's main window
+ <td>The soft keyboard is always hidden when the activity's main window
has input focus.</td>
</tr></tr>
<td>"{@code stateVisible}"</td>
- <td>The soft keyboard is visible when that's normally appropriate
+ <td>The soft keyboard is visible when that's normally appropriate
(when the user is navigating forward to the activity's main window).</td>
</tr></tr>
<td>"{@code stateAlwaysVisible}"</td>
- <td>The soft keyboard is made visible when the user chooses the
- activity &mdash; that is, when the user affirmatively navigates forward
- to the activity, rather than backs into it because of leaving another
+ <td>The soft keyboard is made visible when the user chooses the
+ activity &mdash; that is, when the user affirmatively navigates forward
+ to the activity, rather than backs into it because of leaving another
activity.</td>
</tr></tr>
<td>"{@code adjustUnspecified}"</td>
- <td>It is unspecified whether the activity's main window resizes
- to make room for the soft keyboard, or whether the contents
- of the window pan to make the currentfocus visible on-screen.
+ <td>It is unspecified whether the activity's main window resizes
+ to make room for the soft keyboard, or whether the contents
+ of the window pan to make the current focus visible on-screen.
The system will automatically select one of these modes depending
- on whether the content of the window has any layout views that
- can scroll their contents. If there is such a view, the window
- will be resized, on the assumption that scrolling can make all
+ on whether the content of the window has any layout views that
+ can scroll their contents. If there is such a view, the window
+ will be resized, on the assumption that scrolling can make all
of the window's contents visible within a smaller area.
<p>
@@ -918,14 +941,14 @@ Values set here (other than "{@code stateUnspecified}" and
</p></td>
</tr></tr>
<td>"{@code adjustResize}"</td>
- <td>The activity's main window is always resized to make room for
+ <td>The activity's main window is always resized to make room for
the soft keyboard on screen.</td>
</tr></tr>
<td>"{@code adjustPan}"</td>
<td>The activity's main window is not resized to make room for the soft
- keyboard. Rather, the contents of the window are automatically
+ keyboard. Rather, the contents of the window are automatically
panned so that the current focus is never obscured by the keyboard
- and users can always see what they are typing. This is generally less
+ and users can always see what they are typing. This is generally less
desirable than resizing, because the user may need to close the soft
keyboard to get at and interact with obscured parts of the window.</td>
</tr>
@@ -938,12 +961,12 @@ This attribute was introduced in API Level 3.
<!-- ##api level indication## -->
<dt>introduced in:</dt>
-<dd>API Level 1 for all attributes except for
+<dd>API Level 1 for all attributes except for
<code><a href="#nohist">noHistory</a></code> and
-<code><a href="#wsoft">windowSoftInputMode</a></code>, which were added in API
+<code><a href="#wsoft">windowSoftInputMode</a></code>, which were added in API
Level 3.</dd>
<dt>see also:</dt>
-<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html">&lt;activity-alias&gt;</a></code></dd>
</dl>
diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd
index d5b5bdfe74a7..18e479f50038 100644
--- a/docs/html/guide/topics/manifest/uses-sdk-element.jd
+++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd
@@ -1,4 +1,4 @@
-page.title=&lt;uses-sdk&gt;
+fpage.title=&lt;uses-sdk&gt;
page.tags="api levels","sdk version","minsdkversion","targetsdkversion","maxsdkversion"
@jd:body
@@ -227,16 +227,22 @@ Versions dashboards page</a>.</p>
<table>
<tr><th>Platform Version</th><th>API Level</th><th>VERSION_CODE</th><th>Notes</th></tr>
+ <tr><td><a href="{@docRoot}about/versions/android-4.3.html">Android 4.3</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/18/changes.html" title="Diff Report">18</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}</td>
+ <td><a href="{@docRoot}about/versions/jelly-bean.html">Platform
+Highlights</a></td></tr>
+
<tr><td><a href="{@docRoot}about/versions/android-4.2.html">Android 4.2, 4.2.2</a></td>
<td><a href="{@docRoot}sdk/api_diff/17/changes.html" title="Diff Report">17</a></td>
<td>{@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}</td>
- <td><a href="{@docRoot}about/versions/jelly-bean.html">Platform
+ <td><a href="{@docRoot}about/versions/jelly-bean.html#android-42">Platform
Highlights</a></td></tr>
<tr><td><a href="{@docRoot}about/versions/android-4.1.html">Android 4.1, 4.1.1</a></td>
<td><a href="{@docRoot}sdk/api_diff/16/changes.html" title="Diff Report">16</a></td>
<td>{@link android.os.Build.VERSION_CODES#JELLY_BEAN}</td>
- <td><a href="{@docRoot}about/versions/jelly-bean.html">Platform
+ <td><a href="{@docRoot}about/versions/jelly-bean.html#android-41">Platform
Highlights</a></td></tr>
<tr><td><a href="{@docRoot}about/versions/android-4.0.3.html">Android 4.0.3, 4.0.4</a></td>
diff --git a/docs/html/guide/topics/ui/actionbar.jd b/docs/html/guide/topics/ui/actionbar.jd
index c5bbdbcf0046..453d9d7c6aba 100644
--- a/docs/html/guide/topics/ui/actionbar.jd
+++ b/docs/html/guide/topics/ui/actionbar.jd
@@ -4,6 +4,14 @@ parent.title=User Interface
parent.link=index.html
@jd:body
+
+<a class="notice-designers top" href="{@docRoot}design/patterns/actionbar.html">
+ <div>
+ <h3>Design Guide</h3>
+ <p>Action Bar</p>
+ </div>
+</a>
+
<div id="qv-wrapper">
<div id="qv">
@@ -12,23 +20,20 @@ parent.link=index.html
<li><a href="#Adding">Adding the Action Bar</a>
<ol>
<li><a href="#Removing">Removing the action bar</a></li>
+ <li><a href="#Logo">Using a logo instead of an icon</a></li>
</ol>
</li>
<li><a href="#ActionItems">Adding Action Items</a>
<ol>
- <li><a href="#ChoosingActionItems">Choosing your action items</a></li>
+ <li><a href="#ActionEvents">Handling clicks on action items</a></li>
<li><a href="#SplitBar">Using split action bar</a></li>
</ol>
</li>
- <li><a href="#Home">Using the App Icon for Navigation</a>
- <ol>
- <li><a href="#Up">Navigating up</a></li>
- </ol>
- </li>
+ <li><a href="#Home">Navigating Up with the App Icon</a></li>
<li><a href="#ActionView">Adding an Action View</a>
<ol>
<li><a href="#ActionViewCollapsing">Handling collapsible action views</a></li>
- </ol>
+ </ol>
</li>
<li><a href="#ActionProvider">Adding an Action Provider</a>
<ol>
@@ -44,662 +49,600 @@ parent.link=index.html
<li><a href="#ActionItemStyles">Action items</a></li>
<li><a href="#NavigationStyles">Navigation tabs</a></li>
<li><a href="#DropDownStyles">Drop-down lists</a></li>
- <li><a href="#AdvancedStyles">Advanced styling</a></li>
+ <li><a href="#StyleExample">Example theme</a></li>
</ol>
</li>
</ol>
<h2>Key classes</h2>
<ol>
- <li>{@link android.app.ActionBar}</li>
+ <li>{@link android.support.v7.app.ActionBar}</li>
<li>{@link android.view.Menu}</li>
- <li>{@link android.view.ActionProvider}</li>
</ol>
- <h2>Related samples</h2>
- <ol>
- <li><a
-href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a></li>
- <li><a
-href="{@docRoot}resources/samples/ActionBarCompat/index.html">Action Bar Compatibility</a></li>
- <li><a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#ActionBar">
-API Demos</a></li>
- </ol>
-
- <h2>See also</h2>
- <ol>
- <li><a
-href="{@docRoot}design/patterns/actionbar.html">Android Design: Action Bar</a></li>
- <li><a href="{@docRoot}guide/topics/ui/menus.html">Menus</a></li>
- <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets
-and Handsets</a></li>
- </ol>
</div>
</div>
-<p>The action bar is a window feature that identifies the application and user location, and
-provides user actions and navigation modes. You should use the action bar in most activities that
-need to prominently present user actions or global navigation, because the action bar offers users a
-consistent interface across applications and the system gracefully adapts the action bar's
-appearance for different screen configurations. You can control the behaviors and visibility of the
-action bar with the {@link android.app.ActionBar} APIs, which were added in Android 3.0 (API level
-11).</p>
+<p>The action bar is a window feature that identifies the user location, and
+provides user actions and navigation modes. Using the action bar offers your users a
+familiar interface across applications that the system gracefully adapts
+for different screen configurations.</p>
-<p>The primary goals of the action bar are to:</p>
+<img src="{@docRoot}images/ui/actionbar@2x.png" alt="" width="428" height="215" />
+<p class="img-caption"><strong>Figure 1.</strong> An action bar that includes the [1] app icon,
+[2] two action items, and [3] action overflow.</p>
-<ul>
- <li>Provide a dedicated space for identifying the application brand and user location.
- <p>This is accomplished with the app icon or logo on the left side and the activity title.
-You might choose to remove the activity title, however, if the current view is identified by a
-navigation label, such as the currently selected tab.</p></li>
-
- <li>Provide consistent navigation and view refinement across different applications.
- <p>The action bar provides built-in tab navigation for switching between <a
-href="{@docRoot}guide/components/fragments.html">fragments</a>. It also offers a drop-down
-list you can use as an alternative navigation mode or to refine the current view (such as to sort
-a list by different criteria).</p>
- </li>
+<p>The action bar provides several key functions:</p>
- <li>Make key actions for the activity (such as "search", "create", "share", etc.) prominent and
-accessible to the user in a predictable way.
- <p>You can provide instant access to key user actions by placing items from the <a
-href="{@docRoot}guide/topics/ui/menus.html#OptionsMenu">options menu</a> directly in the action bar,
-as "action items." Action items can also provide an "action view," which provides an embedded
-widget for even more immediate action behaviors. Menu items that are not promoted
-to an action item are available in the overflow menu, revealed by either the device <em>Menu</em>
-button
-(when available) or by an "overflow menu" button in the action bar (when the device does not
-include a <em>Menu</em> button).</p>
-</li>
+<ul>
+ <li>Provides a dedicated space for giving your app an identity and indicating the user's
+ location in the app.</li>
+ <li>Makes important actions prominent and accessible in a predictable way
+ (such as <em>Search</em>).</li>
+ <li>Supports consistent navigation and view switching within apps (with tabs or drop-down
+ lists).</li>
</ul>
-<img src="{@docRoot}images/ui/actionbar.png" alt="" width="440" />
-<p class="img-caption"><strong>Figure 1.</strong> Action bar from the <a
-href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a> app (on a
-landscape handset), showing the logo on the left, navigation tabs, and an action item on the
-right (plus the overflow menu button).</p>
+<p>For more information about the action bar's interaction patterns and design guidelines,
+see the <a href="{@docRoot}design/patterns/actionbar.html">Action Bar</a>
+design guide.</p>
-<p class="note"><strong>Note:</strong> If you're looking for information about the contextual
-action bar for displaying contextual action items, see the <a
-href="{@docRoot}guide/topics/ui/menus.html#context-menu">Menu</a> guide.</p>
+<p>The {@link android.app.ActionBar} APIs were first added in Android 3.0 (API level 11) but they
+are also available in the <a href="{@docRoot}tools/support-library/index.html">Support Library</a>
+for compatibility with Android 2.2 (API level 7) and above.</p>
+
+<p><b>This guide focuses on how to use the
+support library's action bar</b>, but if your app supports <em>only</em> Android 3.0 or higher, you
+should use the {@link android.app.ActionBar} APIs in the framework. Most of the APIs are
+the same&mdash;but reside in a different package namespace&mdash;with a few exceptions to method
+names or signatures that are noted in the sections below.</p>
-<div class="note design">
-<p><strong>Action Bar Design</strong></p>
- <p>For design guidelines, read Android Design's <a
-href="{@docRoot}design/patterns/actionbar.html">Action Bar</a> guide.</p>
+<div class="caution">
+<p><strong>Caution:</strong> Be certain you import
+the {@code ActionBar} class (and related APIs) from the appropriate package:</p>
+<ul>
+<li>If supporting API levels <em>lower than</em> 11: <br>
+{@code import android.support.v7.app.ActionBar}</li>
+<li>If supporting <em>only</em> API level 11 and higher: <br>
+{@code import android.app.ActionBar}</li>
+</ul>
</div>
+<p class="note"><strong>Note:</strong> If you're looking for information about the <em>contextual
+action bar</em> for displaying contextual action items, see the <a
+href="{@docRoot}guide/topics/ui/menus.html#context-menu">Menu</a> guide.</p>
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h2>Remaining backward-compatible</h2>
-<p>If you want to provide an action bar in your application <em>and</em> remain compatible with
-versions of Android older than 3.0, you need to create the action bar in your
-activity's layout (because the {@link android.app.ActionBar} class is not available on older
-versions).</p>
-<p>To help you, the <a
-href="{@docRoot}resources/samples/ActionBarCompat/index.html">Action Bar Compatibility</a> sample
-app provides an API layer and action bar layout that allows your app to use some of the {@link
-android.app.ActionBar} APIs and also support older versions of Android by replacing the traditional
-title bar with a custom action bar layout.</p>
-</div>
-</div>
<h2 id="Adding">Adding the Action Bar</h2>
-<p>Beginning with Android 3.0 (API level 11), the action bar is included in all
-activities that use the {@link android.R.style#Theme_Holo Theme.Holo} theme (or one of its
-descendants), which is the default theme when either the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> or
-<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>
-attribute is set to {@code "11"} or greater. For example:</p>
+<p>As mentioned above, this guide focuses on how to use the {@link
+android.support.v7.app.ActionBar} APIs in the support library. So before you can add the action
+bar, you must set up your project with the <strong>appcompat v7</strong> support library by
+following the instructions in the <a href="{@docRoot}tools/support-library/setup.html">Support
+Library Setup</a>.</p>
-<pre>
-&lt;manifest ... &gt;
- &lt;uses-sdk android:minSdkVersion="4"
- <b>android:targetSdkVersion="11"</b> /&gt;
- ...
-&lt;/manifest&gt;
-</pre>
+<p>Once your project is set up with the support library, here's how to add the action bar:</p>
+<ol>
+ <li>Create your activity by extending {@link android.support.v7.app.ActionBarActivity}.</li>
+ <li>Use (or extend) one of the {@link android.support.v7.appcompat.R.style#Theme_AppCompat
+ Theme.AppCompat} themes for your activity. For example:
+ <pre>&lt;activity android:theme="@style/Theme.AppCompat.Light" ... ></pre>
+ </li>
+</ol>
-<p>In this example, the application requires a minimum version of API Level 4 (Android 1.6), but it
-also targets API level 11 (Android 3.0). This way, when the application runs on Android 3.0 or
-greater, the system applies the holographic theme to each activity, and thus, each activity includes
-the action bar.</p>
+<p>Now your activity includes the action bar when running on Android 2.2 (API level 7) or higher.
+</p>
-<p>If you want to use {@link android.app.ActionBar} APIs, such as to add navigation modes and modify
-action bar styles, you should set the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> to {@code
-"11"} or greater. If you want your app
-to support older versions of Android, there are ways to use a limited set of {@link
-android.app.ActionBar} APIs on devices that support API level 11 or higher, while still running
-on older versions. See the sidebox for information about remaining backward-compatible.</p>
+<div class="note">
+<p><b>On API level 11 or higher</b></p>
+<p>The action bar is included in all activities that use the
+{@link android.R.style#Theme_Holo Theme.Holo} theme (or one of its
+descendants), which is the default theme when either the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> or
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>
+attribute is set to {@code "11"} or higher. If you don't want the action bar for an
+activity, set the activity theme to {@link android.R.style#Theme_Holo_NoActionBar
+Theme.Holo.NoActionBar}.</p>
+</div>
<h3 id="Removing">Removing the action bar</h3>
-<p>If you don't want the action bar for a particular activity, set the activity theme to
-{@link android.R.style#Theme_Holo_NoActionBar Theme.Holo.NoActionBar}. For example:</p>
-
-<pre>
-&lt;activity android:theme="&#64;android:style/Theme.Holo.NoActionBar"&gt;
-</pre>
-
-<p>You can also hide the action bar at runtime by calling {@link android.app.ActionBar#hide}. For
-example:</p>
+<p>You can hide the action bar at runtime by calling {@link android.support.v7.app.ActionBar#hide}.
+For example:</p>
<pre>
-ActionBar actionBar = {@link android.app.Activity#getActionBar()};
+ActionBar actionBar = {@link android.support.v7.app.ActionBarActivity#getSupportActionBar()};
actionBar.hide();
</pre>
-<p>When the action bar hides, the system adjusts your activity layout to fill all the
-screen space now available. You can bring the action bar back with {@link
-android.app.ActionBar#show()}.</p>
+<div class="note">
+<p><b>On API level 11 or higher</b></p>
+<p>Get the {@link android.app.ActionBar} with the {@link android.app.Activity#getActionBar}
+method.</p>
+</div>
+
+<p>When the action bar hides, the system adjusts your layout to fill the
+screen space now available. You can bring the action bar back by calling {@link
+android.support.v7.app.ActionBar#show()}.</p>
<p>Beware that hiding and removing the action bar causes your activity to re-layout in order to
-account for the space consumed by the action bar. If your activity regularly hides and shows the
-action bar (such as in the Android Gallery app), you might want to use overlay mode. Overlay mode
-draws the action bar on top of your activity layout rather than in its own area of the screen. This
+account for the space consumed by the action bar. If your activity often hides and shows the
+action bar, you might want to enable <em>overlay mode</em>. Overlay mode
+draws the action bar in front of your activity layout, obscuring the top portion. This
way, your layout remains fixed when the action bar hides and re-appears. To enable overlay mode,
-create a theme for your activity and set {@link android.R.attr#windowActionBarOverlay
-android:windowActionBarOverlay} to {@code true}. For more information, see the section about <a
+create a custom theme for your activity and set {@link
+android.support.v7.appcompat.R.attr#windowActionBarOverlay
+windowActionBarOverlay} to {@code true}. For more information, see the section below about <a
href="#Style">Styling the Action Bar</a>.</p>
-<p class="note"><strong>Tip:</strong> If you have a custom activity theme in which you'd like to
-remove the action bar, set the {@link android.R.styleable#Theme_windowActionBar
-android:windowActionBar} style property to {@code false}. However, if you remove the action bar
-using a theme, then the window will not allow the action bar at all, so you cannot add it
-later&mdash;calling {@link android.app.Activity#getActionBar()} will return null.</p>
+
+<h3 id="Logo">Using a logo instead of an icon</h3>
+
+<p>By default, the system uses your application icon in the action bar, as specified by the <a
+href="{@docRoot}guide/topics/manifest/application-element.html#icon">{@code icon}</a>
+attribute in the <a href="{@docRoot}guide/topics/manifest/application-element.html">{@code
+&lt;application&gt;}</a> or <a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
+&lt;activity&gt;}</a> element. However, if you also specify the <a
+href="{@docRoot}guide/topics/manifest/application-element.html#logo">{@code logo}</a>
+attribute, then the action bar uses the logo image instead of the icon.</p>
+
+<p>A logo should usually be wider than the icon, but should not include unnecessary text. You
+should generally use a logo only when it represents your brand in a traditional format that users
+recognize. A good example is the YouTube app's logo&mdash;the logo represents the expected user
+brand, whereas the app's icon is a modified version that conforms to the square requirement
+for the launcher icon.</p>
+
<h2 id="ActionItems">Adding Action Items</h2>
-<p>Sometimes you might want to give users immediate access to an item from the <a
-href="{@docRoot}guide/topics/ui/menus.html#OptionsMenu">options menu</a>. To do this, you can
-declare that the menu item should appear in the action bar as an "action item." An action item can
-include an icon and/or a text title. If a menu item does not appear as an action item, then the
-system places it in the overflow menu. The overflow menu is revealed either by the device
-<em>Menu</em>
-button (if provided by the device) or an additional button in the action bar (if the device does not
-provide the <em>Menu</em> button).</p>
-
-<div class="figure" style="width:359px">
- <img src="{@docRoot}images/ui/actionbar-item-withtext.png" height="57" alt="" />
- <p class="img-caption"><strong>Figure 2.</strong> Two action items with icon and text titles, and
-the overflow menu button.</p>
+<div class="figure" style="width:340px">
+ <img src="{@docRoot}images/ui/actionbar-item-withtext.png" width="340" alt="" />
+ <p class="img-caption"><strong>Figure 2.</strong> Action bar with three action buttons and
+the overflow button.</p>
</div>
-<p>When the activity first starts, the system populates the action bar and overflow menu by calling
-{@link android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()} for your activity. As
-discussed in the <a href="{@docRoot}guide/topics/ui/menus.html">Menus</a> developer guide, it's in
-this callback method that you should inflate an XML <a
-href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a> that defines the
-menu items. For example:</p>
+<p>The action bar provides users access to the most important action
+items relating to the app's current
+context. Those that appear directly in the action bar with an icon and/or text are known
+as <em>action buttons</em>. Actions that can't fit in the action bar or aren't
+important enough are hidden in the action overflow.
+The user can reveal a list of the other actions by pressing the overflow button
+on the right side (or the device <em>Menu</em> button, if available).</p>
+
+<p>When your activity starts, the system populates the action items by calling your activity's
+{@link android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()} method. Use this
+method to inflate a <a
+href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a> that defines all the
+action items. For example, here's a menu resource defining a couple of menu items:</p>
+
+<p class="code-caption">res/menu/main_activity_actions.xml</p>
+<pre>
+&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ &lt;item android:id="@+id/action_search"
+ android:icon="@drawable/ic_action_search"
+ android:title="@string/action_search"/&gt;
+ &lt;item android:id="@+id/action_compose"
+ android:icon="@drawable/ic_action_compose"
+ android:title="@string/action_compose" /&gt;
+&lt;/menu&gt;
+</pre>
+
+<p>Then in your activity's {@link android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()}
+method, inflate the menu resource into the given {@link android.view.Menu}
+to add each item to the action bar:</p>
<pre>
&#64;Override
public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu items for use in the action bar
MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.main_activity, menu);
- return true;
+ inflater.inflate(R.menu.main_activity_actions, menu);
+ return super.onCreateOptionsMenu(menu);
}
</pre>
-<p>In the XML file, you can request a menu item to appear as an action item by declaring {@code
-android:showAsAction="ifRoom"} for the {@code &lt;item&gt;} element. This way, the menu item appears
-in the action bar for quick access only <em>if there is room</em> available. If there's not
-enough room, the item appears in the overflow menu.</p>
+<p>To request that an item appear directly in the action bar
+as an action button, include {@code
+showAsAction="ifRoom"} in the {@code &lt;item&gt;} tag. For example:</p>
-<p>If your menu item supplies both a title and an icon&mdash;with the {@code android:title} and
-{@code android:icon} attributes&mdash;then the action item shows only the icon by default. If you
-want to display the text title, add {@code "withText"} to the {@code android:showAsAction}
+<pre>
+&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
+ <strong>xmlns:example.app="http://schemas.android.com/apk/res-auto"</strong> >
+ &lt;item android:id="@+id/action_search"
+ android:icon="@drawable/ic_action_search"
+ android:title="@string/action_search"
+ <strong>example.app:showAsAction="ifRoom"</strong> /&gt;
+ ...
+&lt;/menu&gt;
+</pre>
+
+<p>If there's not enough room for the item in the action bar, it will appear in the action
+overflow.</p>
+
+
+<div class="note" id="XmlAttributes">
+<p><strong>Using XML attributes from the support library</strong></p>
+Notice that the {@code showAsAction} attribute above uses a custom namespace defined in the
+{@code &lt;menu>} tag. This is necessary when using any XML attributes defined by the support
+library, because these attributes do not exist in the Android framework on older devices.
+So you must use your own namespace as a prefix for all attributes defined by the support library.
+</p>
+</div>
+
+<p>If your menu item supplies both a title and an icon&mdash;with the {@code title} and
+{@code icon} attributes&mdash;then the action item shows only the icon by default. If you
+want to display the text title, add {@code "withText"} to the {@code showAsAction}
attribute. For example:</p>
<pre>
-&lt;?xml version="1.0" encoding="utf-8"?&gt;
-&lt;menu xmlns:android="http://schemas.android.com/apk/res/android">
- &lt;item android:id="@+id/menu_save"
- android:icon="@drawable/ic_menu_save"
- android:title="@string/menu_save"
- <b>android:showAsAction="ifRoom|withText"</b> /&gt;
-&lt;/menu&gt;
+&lt;item example.app:showAsAction="ifRoom|withText" ... /&gt;
</pre>
<p class="note"><strong>Note:</strong> The {@code "withText"} value is a <em>hint</em> to the
action bar that the text title should appear. The action bar will show the title when possible, but
might not if an icon is available and the action bar is constrained for space.</p>
-<p>When the user selects an action item, your activity receives a call to
-{@link android.app.Activity#onOptionsItemSelected(MenuItem)
-onOptionsItemSelected()}, passing the ID supplied by the {@code android:id} attribute&mdash;the same
-callback received for all items in the options menu.</p>
-
-<p>It's important that you always define {@code android:title} for each menu item&mdash;even if you
-don't declare that the title appear with the action item&mdash;for three reasons:</p>
+<p>You should always define the {@code title} for each item even if you don't declare that
+the title appear with the action item, for the following reasons:</p>
<ul>
<li>If there's not enough room in the action bar for the action item, the menu item appears
-in the overflow menu and only the title appears.</li>
+in the overflow where only the title appears.</li>
<li>Screen readers for sight-impaired users read the menu item's title.</li>
<li>If the action item appears with only the icon, a user can long-press the item to reveal a
-tool-tip that displays the action item's title.</li>
+tool-tip that displays the action title.</li>
</ul>
-<p>The {@code android:icon} is always optional, but recommended. For icon design recommendations,
-see the <a href="{@docRoot}guide/practices/ui_guidelines/icon_design_action_bar.html">Action Bar
-Icon</a> design guidelines.</p>
-
-<p class="note"><strong>Note:</strong> If you added the menu item from a fragment, via the {@link
-android.app.Fragment} class's {@link android.app.Fragment#onCreateOptionsMenu onCreateOptionsMenu}
-callback, then the system calls the respective {@link
-android.app.Fragment#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} method for that
-fragment when the user selects one of the fragment's items. However the activity gets a chance to
-handle the event first, so the system calls {@link
-android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} on the activity before
-calling the same callback for the fragment.</p>
-
-<p>You can also declare an item to <em>"always"</em> appear as an action item, instead of being
-placed in the overflow menu when space is limited. In most cases, you <strong>should not</strong>
-force an item to appear in the action bar by using the {@code "always"} value. However, you might
-need an item to always appear when it provides an <a href="#ActionView">action view</a> that does
-not offer a default action for the overflow menu. Beware that too
-many action items can create a cluttered UI and cause layout problems on devices with a narrow
-screen. It's best to instead use {@code "ifRoom"} to request that an item appear in the action
-bar, but allow the system to move it into the overflow menu when there's not enough room.</p>
-
-<p>For more information about creating the options menu that defines your action items, see the <a
-href="{@docRoot}guide/topics/ui/menus.html#options-menu">Menus</a> developer guide.</p>
-
-
-
-<h3 id="ChoosingActionItems">Choosing your action items</h3>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h4>Menu items vs. other app controls</h4>
- <p>As a general rule, all items in the <a
-href="{@docRoot}guide/topics/ui/menus.html#OptionsMenu">options menu</a> (let alone action items)
-should have a global impact on the app, rather than affect only a small portion of the interface.
-For example, if you have a multi-pane layout and one pane shows a video while another lists all
-videos, the video player controls should appear within the pane containing the video (not in the
-action bar), while the action bar might provide action items to share the video or save the video to
-a favorites list.</p>
- <p>So, even before deciding whether a menu item should appear as an action item, be sure that
-the item has a global scope for the current activity. If it doesn't, then you should place it
-as a button in the appropriate context of the activity layout.</p>
-</div>
-</div>
+<p>The {@code icon} is optional, but recommended. For icon design recommendations,
+see the <a href="{@docRoot}design/style/iconography.html#action-bar">Iconography</a> design
+guide. You can also download a set of standard action bar icons (such as for Search or Discard)
+from the <a href="{@docRoot}design/downloads/index.html">Downloads</a> page.</p>
-<p>You should carefully choose which items from your options menu should appear as action items by
-assessing a few key traits. In general, each action item should be <em>at least one</em>
-of the following:</p>
+<p>You can also use {@code "always"} to declare that an item always appear as an action button.
+However, you <strong>should not</strong> force an item to appear in the action bar this
+way. Doing so can create layout problems on devices with a narrow screen. It's best to instead
+use {@code "ifRoom"} to request that an item appear in the action bar, but allow the system to move
+it into the overflow when there's not enough room. However, it might be necessary to use this value
+if the item includes an <a href="#ActionView">action view</a> that cannot be collapsed and
+must always be visible to provide access to a critical feature.</p>
-<ol>
- <li><strong>Frequently used</strong>: It's an action that your users need seven out of ten visits
-or they use it several times in a row.
- <p>Example frequent actions: "New message" in the Messaging app and
-"Search" on Google Play.</p>
- </li>
-
- <li><strong>Important</strong>: It's an action that you need users to easily discover or, if it's
-not frequently used, it's important that it be effortless to perform in the few cases that users do
-need it.
- <p>Example important actions: "Add network" in Wi-Fi settings and "Switch to camera" in the
-Gallery app.</p>
- </li>
- <li><strong>Typical</strong>: It's an action that is typically provided in the action bar in
-similar apps, so your users expect to find it in yours.
- <p>Example typical actions: "Refresh" in an email or social app, and "New contact" in the
-People app.</p>
-</ol>
-<p>If you believe that more than four of your menu items can be justified as action items, then you
-should carefully consider their relative level of importance and try to set no more than four as
-action items (and do so using the {@code "ifRoom"} value to allow the system to put some back in the
-overflow menu when space is limited on smaller screens). Even if space is available on a wide
-screen, you should not create a long stream of action items that clutter the UI and appear like a
-desktop toolbar, so keep the number of action items to a minimum.</p>
-<p>Additionally, the following actions should never appear as action items: Settings, Help,
-Feedback, or similar. Always keep them in the overflow menu.</p>
+<h3 id="ActionEvents">Handling clicks on action items</h3>
-<p class="note"><strong>Note:</strong> Remember that not all devices provide a dedicated hardware
-button for Search, so if it's an important feature in your app, it should always appear as an
-action item (and usually as the first item, especially if you offer it with an <a
-href="#ActionView">action view</a>).</p>
+<p>When the user presses an action, the system calls your activity's {@link
+android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} method. Using the
+{@link android.view.MenuItem} passed to this method, you can identify the action by calling {@link
+android.view.MenuItem#getItemId()}. This returns the unique ID provided by the {@code &lt;item&gt;}
+tag's {@code id} attribute so you can perform the appropriate action. For example:</p>
+<pre>
+&#64;Override
+public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle presses on the action bar items
+ switch (item.getItemId()) {
+ case R.id.action_search:
+ openSearch();
+ return true;
+ case R.id.action_compose:
+ composeMessage();
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+}
+</pre>
+<p class="note"><strong>Note:</strong> If you inflate menu items from a fragment, via the {@link
+android.app.Fragment} class's {@link android.app.Fragment#onCreateOptionsMenu onCreateOptionsMenu()}
+callback, the system calls {@link
+android.app.Fragment#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} for that
+fragment when the user selects one of those items. However, the activity gets a chance to
+handle the event first, so the system first calls {@link
+android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} on the activity,
+before calling the same callback for the fragment. To ensure that any fragments in the
+activity also have a chance to handle the callback, always pass the call to the superclass
+as the default behavior instead of returning {@code false} when you do not handle the item.</p>
+
+
+
+<div class="figure" style="width:420px;margin-top:0">
+<img src="{@docRoot}images/ui/actionbar-splitaction@2x.png" alt="" width="420"/>
+<p class="img-caption"><strong>Figure 3.</strong> Mock-ups showing an action bar with
+tabs (left), then with split action bar (middle); and with the app icon and title disabled
+(right).</p>
+</p>
+</div>
<h3 id="SplitBar">Using split action bar</h3>
-<p>When your application is running on Android 4.0 (API level 14) and higher, there's an extra mode
-available for the action bar called "split action bar." When you enable split action bar, a separate
-bar appears at the bottom of the screen to display all action items when the activity is running on
-a narrow screen (such as a portrait-oriented handset). Splitting the action bar to separate
-the action items ensures that a reasonable amount of space is available to display all your action
+<p>Split action bar provides a separate
+bar at the bottom of the screen to display all action items when the activity is running on
+a narrow screen (such as a portrait-oriented handset).</p>
+
+<p>Separating the action items this way
+ensures that a reasonable amount of space is available to display all your action
items on a narrow screen, while leaving room for navigation and title elements at the top.</p>
-<p>To enable split action bar, simply add {@code uiOptions="splitActionBarWhenNarrow"} to your
+<p>To enable split action bar when using the support library, you must do two things:</p>
+<ol>
+ <li>Add {@code uiOptions="splitActionBarWhenNarrow"} to your
<a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code &lt;activity&gt;}</a> or
<a href="{@docRoot}guide/topics/manifest/application-element.html">{@code &lt;application&gt;}</a>
-manifest element.</p>
+manifest element. This attribute is understood only by API level 14 and higher (it is ignored
+by older versions).
+ <li>For older versions, create a custom theme that extends one of the {@link
+ android.support.v7.appcompat.R.style#Theme_AppCompat Theme.AppCompat} themes, and include
+ the {@link android.support.v7.appcompat.R.attr#windowSplitActionBar windowSplitActionBar} style
+ set {@code true}. For example:
+ <p class="code-caption">res/values/styles.xml</p>
+ <pre>
+&lt;style name="MyAppTheme" parent="Theme.AppCompat.Light">
+ &lt;item name="windowSplitActionBar">true&lt;item>
+&lt;/style>
+</pre>
-<p>Be aware that Android adjusts the action bar's appearance in a variety of ways, based on the
-current screen size. Using split action bar is just one option that you can enable to allow the
-action bar to further optimize the user experience for different screen sizes. In doing so, you
-may also allow the action bar to collapse navigation tabs into the main action bar. That is, if you
-use <a href="#Tabs">navigation tabs</a> in your action bar, once the action items are
-separated on a narrow screen, the navigation tabs may be able to fit into the main action bar rather
-than be separated into the "stacked action bar." Specifically, if you've disabled the action bar
-icon and title (with {@link android.app.ActionBar#setDisplayShowHomeEnabled
-setDisplayShowHomeEnabled(false)} and {@link android.app.ActionBar#setDisplayShowTitleEnabled
-setDisplayShowTitleEnabled(false)}), then the navigation tabs collapse into the main action bar, as
-shown by the second device in figure 3.</p>
+ <p>Then set this as your activity theme:</p>
-<img src="{@docRoot}images/practices/actionbar-phone-splitaction.png" alt=""/>
-<p class="img-caption"><strong>Figure 3.</strong> Mock-ups of split action bar with navigation tabs
-on the left; with the app icon and title disabled on the right.</p>
+ <p class="code-caption">AndroidManifest.xml</p>
+ <pre>
+&lt;manifest ...>
+ &lt;activity android:theme="&#64;style/MyAppTheme" ...>
+ ...
+&lt;/manifest ...>
+</pre>
+ </li>
+</ol>
-<p class="note"><strong>Note:</strong> Although the {@link android.R.attr#uiOptions
-android:uiOptions} attribute was added in Android 4.0 (API level 14), you can safely include it in
-your application even if your <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> is set to
-a value lower than {@code "14"} to remain compatible with older versions of Android. When running on
-older versions, the system simply ignores the XML attribute because it doesn't understand it. The
-only condition to including it in your manifest is that you must compile your application against a
-platform version that supports API level 14 or higher. Just be sure that you don't openly use other
-APIs in your application code that aren't supported by the version declared by your <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>
-attribute&mdash;only XML attributes are safely ignored by older platforms.</p>
+<p>Using split action bar also allows <a href="#Tabs">navigation tabs</a> to collapse into the
+main action bar if you remove the icon and title (as shown on the right in figure 3).
+To create this effect, disable the action bar
+icon and title with {@link android.support.v7.app.ActionBar#setDisplayShowHomeEnabled
+setDisplayShowHomeEnabled(false)} and {@link
+android.support.v7.app.ActionBar#setDisplayShowTitleEnabled setDisplayShowTitleEnabled(false)}.</p>
-<h2 id="Home">Using the App Icon for Navigation</h2>
+<h2 id="Home">Navigating Up with the App Icon</h2>
+<a class="notice-designers" href="{@docRoot}design/patterns/navigation.html">
+ <div>
+ <h3>Design Guide</h3>
+ <p>Navigation with Back and Up</p>
+ </div>
+</a>
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h2>Using a logo instead of icon</h2>
-<p>By default, the system uses your application icon in the action bar, as specified by the <a
-href="{@docRoot}guide/topics/manifest/application-element.html#icon">{@code android:icon}</a>
-attribute in the <a href="{@docRoot}guide/topics/manifest/application-element.html">{@code
-&lt;application&gt;}</a> or <a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
-&lt;activity&gt;}</a> element. However, if you also specify the <a
-href="{@docRoot}guide/topics/manifest/application-element.html#logo">{@code android:logo}</a>
-attribute, then the action bar uses the logo image instead of the icon.</p>
-<p>A logo should usually be wider than the icon, but should not include unnecessary text. You
-should generally use a logo only when it represents your brand in a traditional format that users
-recognize. A good example is the YouTube app's logo&mdash;the logo represents the expected user
-brand, whereas the app's icon is a modified version that conforms to the square requirement.</p>
-</div>
+<div class="figure" style="width:240px">
+ <img src="{@docRoot}images/ui/actionbar-up.png" width="240" alt="" />
+ <p class="img-caption"><strong>Figure 4.</strong> The <em>Up</em> button in Gmail.</p>
</div>
+<p>Enabling the app icon as an <em>Up</em> button allows the user to navigate your app based
+on the hierarchical relationships between screens. For instance, if screen A displays a list of
+items, and selecting an item leads to screen B, then
+screen B should include the <em>Up</em> button, which returns to screen A.</p>
-<p>By default, your application icon appears in the action bar on the left side. If you'd like,
-you can enable the icon to behave as an action item. In response to user action on the icon, your
-application should do one of two things:</p>
-
-<ul>
- <li>Go to the application "home" activity, or</li>
- <li>Navigate "up" the application's structural hierarchy</li>
-</ul>
-
-<p>When the user touches the icon, the system calls your activity's {@link
-android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} method with the {@code
-android.R.id.home} ID. In response, you should either start the home activity or
-take the user one step up in your application's structural hierarchy.</p>
-
-<p>If you respond to the application icon by returning to the home activity, you should include
-the {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP} flag in the {@link
-android.content.Intent}. With this flag, if the activity you're starting already exists in the
-current task, then all activities on top of it are destroyed and it is brought to the front.
-Adding this flag is often important because going "home" is an action that's equivalent to "going
-back" and you should usually not create a new instance of the home activity. Otherwise, you
-might end up with a long stack of activities in the current task with multiple instances of the
-home activity.</p>
+<p class="note"><strong>Note:</strong> Up navigation is distinct from the back navigation provided
+by the system <em>Back</em> button. The <em>Back</em> button is used to navigate in reverse
+chronological order through the history of screens the user has recently worked with. It is
+generally based on the temporal relationships between screens, rather than the app's hierarchy
+structure (which is the basis for up navigation).</p>
-<p>For example, here's an implementation of {@link android.app.Activity#onOptionsItemSelected
-onOptionsItemSelected()} that returns to the application's "home" activity:</p>
+<p>To enable the app icon as an <em>Up</em> button, call {@link
+android.support.v7.app.ActionBar#setDisplayHomeAsUpEnabled setDisplayHomeAsUpEnabled()}.
+For example:</p>
<pre>
&#64;Override
-public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case android.R.id.home:
- // app icon in action bar clicked; go home
- Intent intent = new Intent(this, HomeActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- return true;
- default:
- return super.onOptionsItemSelected(item);
- }
+protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_details);
+
+ ActionBar actionBar = getSupportActionBar();
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ ...
}
</pre>
-<p>In case the user can enter the current activity from another application, you might also want to
-add the {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag. This flag ensures that, when the
-user navigates either "home" or "up", the new activity is <strong>not</strong> added to the current
-task, but instead started in a task that belongs to your application. For example, if the user
-starts an activity in your application through an intent invoked by another application, then
-selects the action bar icon to navigate home or up, the {@link
-android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP} flag starts the activity in a task that belongs to
-your application (not the current task). The system either starts a new task with your new activity
-as the root activity or, if an existing task exists in the background with an instance of that
-activity, then that task is brought forward and the target activity receives {@link
-android.app.Activity#onNewIntent onNewIntent()}. So if your activity accepts intents from other
-applications (it declares any generic intent filters), you should usually add the {@link
-android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag to the intent:</p>
+<p>Now the icon in the action bar appears with the <em>Up</em> caret (as shown in figure 4).
+However, it won't do anything by default. To specify the activity to open when the
+user presses <em>Up</em> button, you have two options:</p>
+<ul>
+ <li><b>Specify the parent activity in the manifest file.</b>
+ <p>This is the best option when <strong>the parent activity is always the same</strong>. By
+declaring in the manifest which activity is the parent, the action bar automatically performs the
+correct action when the user presses the <em>Up</em> button.</p>
+
+ <p>Beginning in Android 4.1 (API level 16), you can declare the parent with the <a href=
+"{@docRoot}guide/topics/manifest/activity-element.html#parent">{@code parentActivityName}</a>
+attribute in the <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
+&lt;activity&gt;}</a> element.</p>
+ <p>To support older devices with the support library, also
+include a <a href="{@docRoot}guide/topics/manifest/meta-data-element.html">{@code
+&lt;meta-data&gt;}</a> element that specifies
+the parent activity as the value for {@code android.support.PARENT_ACTIVITY}. For example:</p>
<pre>
-intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
+&lt;application ... >
+ ...
+ &lt;!-- The main/home activity (has no parent activity) -->
+ &lt;activity
+ android:name="com.example.myfirstapp.MainActivity" ...>
+ ...
+ &lt;/activity>
+ &lt;!-- A child of the main activity -->
+ &lt;activity
+ android:name="com.example.myfirstapp.DisplayMessageActivity"
+ android:label="&#64;string/title_activity_display_message"
+ android:parentActivityName="com.example.myfirstapp.MainActivity" >
+ &lt;!-- Parent activity meta-data to support API level 7+ -->
+ &lt;meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.example.myfirstapp.MainActivity" />
+ &lt;/activity>
+&lt;/application>
</pre>
-<p>For more information about these flags and other back stack behaviors, read the <a
-href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a>
-developer guide.</p>
-
-<p class="note"><strong>Note:</strong> If you're using the icon to navigate to the home
-activity, beware that beginning with Android 4.0 (API level 14), you must explicitly enable the
-icon as an action item by calling {@link android.app.ActionBar#setHomeButtonEnabled
-setHomeButtonEnabled(true)} (in previous versions, the icon was enabled as an action item by
-default).</p>
-
-
-
-<h3 id="Up">Navigating up</h3>
-
-<div class="figure" style="width:230px;margin-top:-1em">
- <img src="{@docRoot}images/ui/actionbar-logo.png" alt="" />
- <p class="img-caption"><strong>Figure 4.</strong> The Email app's standard icon
-(left) and the "navigate up" icon (right). The system automatically adds the "up" indicator.</p>
-</div>
-
-<p>As a supplement to traditional "back" navigation&mdash;which takes the user to the previous
-screen in the task history&mdash;you can enable the action bar icon to offer "up"
-navigation, which should take the user one step up in your application's structural hierarchy. For
-instance, if the current screen is somewhere deep in the hierarchy of the application, touching the
-app icon should navigate upward one level, to the parent of the current screen.</p>
-
-<p>For example, figure 5 illustrates how the BACK button behaves when the user navigates from one
-application to an activity belonging to a different application (specifically, when composing an
-email to a person selected from the People app).</p>
-
-<img src="{@docRoot}images/ui/actionbar-navigate-back.png" alt="" />
-<p class="img-caption"><strong>Figure 5.</strong> The BACK button behavior
-after entering the Email app from the People (or Contacts) app.</p>
-
-<p>However, if the user wants to stay within the email application after composing the email,
-up navigation allows the user to navigate upward in the email application, rather than go back
-to the previous activity. Figure 6 illustrates this scenario, in which the user again comes into
-the email application, but presses the action bar icon to navigate up, rather than back.</p>
-
-<img src="{@docRoot}images/ui/actionbar-navigate-up.png" alt="" />
-<p class="img-caption"><strong>Figure 6.</strong> Example behavior for UP navigation after
-entering the Email app from the People app.</p>
-
-<div class="note design">
-<p><strong>Navigation Design</strong></p>
- <p>For more about how <em>Up</em> and <em>Back</em> navigation differ, read Android Design's <a
-href="{@docRoot}design/patterns/navigation.html">Navigation</a> guide.</p>
-</div>
+ <p>Once the parent activity is specified in the manifest like this and you enable the <em>Up</em>
+ button with {@link
+android.support.v7.app.ActionBar#setDisplayHomeAsUpEnabled setDisplayHomeAsUpEnabled()}, your work
+is done and the action bar properly navigates up.</p>
+ </li>
-<p>To enable the icon for up navigation (which displays the "up" indicator next to the icon), call
-{@link android.app.ActionBar#setDisplayHomeAsUpEnabled setDisplayHomeAsUpEnabled(true)} on your
-{@link android.app.ActionBar}:</p>
-<pre>
-protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
+ <li><strong>Or, override {@link
+android.support.v7.app.ActionBarActivity#getSupportParentActivityIntent()} and {@link
+android.support.v7.app.ActionBarActivity#onCreateSupportNavigateUpTaskStack
+onCreateSupportNavigateUpTaskStack()} in your activity</strong>.</li>
+
+ <p>This is appropriate when <strong>the parent activity may be different</strong> depending
+ on how the user arrived at the current screen. That is, if there are many paths that the user
+ could have taken to reach the current screen, the <em>Up</em> button should navigate
+ backward along the path the user actually followed to get there.</p>
+
+ <p>The system calls {@link
+android.support.v7.app.ActionBarActivity#getSupportParentActivityIntent()} when the user presses
+the <em>Up</em> button while navigating your app (within your app's own task). If the activity that
+should open upon up navigation differs depending on how the user arrived at the current location,
+then you should override this method to return the {@link
+android.content.Intent} that starts the appropriate parent activity.</p>
+
+ <p>The system calls {@link
+android.support.v7.app.ActionBarActivity#onCreateSupportNavigateUpTaskStack
+onCreateSupportNavigateUpTaskStack()} for your activity when the user presses the <em>Up</em>
+button while your activity is running in a task that does <em>not</em> belong to your app. Thus,
+you must use the {@link android.support.v4.app.TaskStackBuilder} passed to this method to construct
+the appropriate back stack that should be synthesized when the user navigates up.</p>
+
+ <p>Even if you override {@link
+android.support.v7.app.ActionBarActivity#getSupportParentActivityIntent()} to specify up navigation
+as the user navigates your app, you can avoid the need to implement {@link
+android.support.v7.app.ActionBarActivity#onCreateSupportNavigateUpTaskStack
+onCreateSupportNavigateUpTaskStack()} by declaring "default" parent activities in the manifest file
+as shown above. Then the default implementation of {@link
+android.support.v7.app.ActionBarActivity#onCreateSupportNavigateUpTaskStack
+onCreateSupportNavigateUpTaskStack()} will synthesize a back stack based on the parent activities
+declared in the manifest.</p>
- setContentView(R.layout.main);
- ActionBar actionBar = getActionBar();
- actionBar.setDisplayHomeAsUpEnabled(true);
- ...
-}
-</pre>
-
-<p>When the user touches the icon, the system calls your activity's {@link
-android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} method with the {@code
-android.R.id.home} ID, as shown in the above section about <a href="#Home">Using the App Icon
-for Navigation</a>.</p>
-
-<p>Remember to use the {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP} flag in the {@link
-android.content.Intent}, so that you don't create a new instance of the parent activity if one
-already exists. For instance, if you don't use the {@link
-android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP} flag, then after navigating up, the BACK button will
-actually take the user "forward", with respect to the application structure, which would be
-strange.</p>
+ </li>
+</ul>
-<p class="note"><strong>Note:</strong> If there are many paths that the user could have taken to
-reach the current activity within your application, the up icon should navigate backward along the
-path the user actually followed to get to the current activity.</p>
+<p class="note"><strong>Note:</strong>
+If you've built your app hierarchy using a series of fragments instead of multiple
+activities, then neither of the above options will work. Instead, to navigate up through your
+fragments, override {@link android.support.v7.app.ActionBarActivity#onSupportNavigateUp()}
+to perform the appropriate fragment transaction&mdash;usually by popping
+the current fragment from the back stack by calling {@link
+android.support.v4.app.FragmentManager#popBackStack()}.</p>
+<p>For more information about implementing <em>Up</em> navigation, read
+<a href="{@docRoot}training/implementing-navigation/ancestral.html">Providing Up Navigation</a>.</p>
<h2 id="ActionView">Adding an Action View</h2>
-<div class="figure" style="width:300px;margin-top:-1em">
- <img src="/images/ui/actionbar-searchview.png" alt="" />
- <p class="img-caption"><strong>Figure 7.</strong> An action bar with a collapsed action
-view for Search (top), then expanded action view with the <code><a
-href="/reference/android/widget/SearchView.html">SearchView</a></code> widget (bottom).</p>
+<div class="figure" style="width:340px">
+<img src="/images/ui/actionbar-searchview@2x.png" alt="" width="340" />
+<p class="img-caption"><strong>Figure 5.</strong> An action bar with a collapsible
+{@link android.support.v7.widget.SearchView}.</p>
</div>
-<p>An action view is a widget that appears in the action bar as a substitute for an action item's
-button. For example, if you have an item in the options menu for "Search," you can add an action
-view that replaces the button with a {@link android.widget.SearchView} widget, as shown in figure
-7.</p>
+<p>An <em>action view</em> is a widget that appears in the action bar as a substitute for an action
+button. An action view provides fast access to rich actions without changing activities or
+fragments, and without replacing the action bar. For example, if you have an action for Search, you
+can add an action view to
+embeds a {@link android.support.v7.widget.SearchView} widget in the action bar, as shown in figure
+5.</p>
-<p>To declare an action view for an item in your <a
-href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a>, use either the {@code
-android:actionLayout} or {@code android:actionViewClass} attribute to specify either a layout
-resource or widget class to use, respectively. For example:</p>
+<p>To declare an action view, use either the {@code
+actionLayout} or {@code actionViewClass} attribute to specify either a layout
+resource or widget class to use, respectively. For example, here's how to add
+the {@link android.support.v7.widget.SearchView} widget:</p>
<pre>
&lt;?xml version="1.0" encoding="utf-8"?>
-&lt;menu xmlns:android="http://schemas.android.com/apk/res/android">
- &lt;item android:id="@+id/menu_search"
- android:title="@string/menu_search"
- android:icon="@drawable/ic_menu_search"
- android:showAsAction="ifRoom|collapseActionView"
- <b>android:actionViewClass="android.widget.SearchView"</b> /&gt;
+&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:example.app="http://schemas.android.com/apk/res-auto" >
+ &lt;item android:id="@+id/action_search"
+ android:title="@string/action_search"
+ android:icon="@drawable/ic_action_search"
+ example.app:showAsAction="ifRoom|collapseActionView"
+ <b>example.app:actionViewClass="android.support.v7.widget.SearchView"</b> /&gt;
&lt;/menu>
</pre>
-<p>Notice that the {@code android:showAsAction} attribute also includes {@code
-"collapseActionView"}. This is optional and declares that the action view should be collapsed into a
-button. When the user selects the button, the action view expands. Otherwise, the action view is
-visible by default and might consume valuable action bar space even when the user is not using it.
-For more information, see the next section about <a href="#ActionViewCollapsing">Handling
-collapsible action views</a>.</p>
+<p>Notice that the {@code showAsAction} attribute also includes the {@code "collapseActionView"}
+value. This is optional and declares that the action view should be collapsed into a
+button. (This behavior is explained further in the following section about
+<a href="#ActionViewCollapsing">Handling collapsible action views</a>.)</p>
+
+<p>If you need to configure the action view (such as to add event listeners), you can do so during
+the {@link android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()} callback. You can
+acquire the action view object by calling the static method {@link
+android.support.v4.view.MenuItemCompat#getActionView MenuItemCompat.getActionView()} and passing it
+the corresponding {@link android.view.MenuItem}. For example, the search widget from the above
+sample is acquired like this:</p>
-<p>If you need to add some event hooks to your action view, you can do so during the {@link
-android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()} callback. You can acquire elements
-in an action view by calling {@link android.view.Menu#findItem findItem()} with the ID of the menu
-item, then call {@link android.view.MenuItem#getActionView}. For
-example, the search widget from the above sample is acquired like this:</p>
<pre>
&#64;Override
public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.options, menu);
- SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
+ getMenuInflater().inflate(R.menu.main_activity_actions, menu);
+ MenuItem searchItem = menu.findItem(R.id.action_search);
+ SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
// Configure the search info and add any event listeners
...
return super.onCreateOptionsMenu(menu);
}
</pre>
+<div class="note">
+<p><b>On API level 11 or higher</b></p>
+<p>Get the action view by calling {@link android.view.MenuItem#getActionView} on the
+corresponding {@link android.view.MenuItem}:</p>
+<pre>menu.findItem(R.id.action_search).getActionView()</pre>
+</div>
+
<p>For more information about using the search widget, see <a
href="{@docRoot}guide/topics/search/search-dialog.html">Creating a Search Interface</a>.</p>
-<h3 id="ActionViewCollapsing">Handling collapsible action views</h3>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h3>Supporting Android 3.0 with an action view</h3>
- <p>The {@code "collapseActionView"} option was added with Android 4.0 (API level 14). However, if
-your application supports older versions, you should
-still declare {@code "collapseActionView"} in order to better support smaller screens.
-Devices running Android 4.0 and higher will show the action view collapsed, while older versions
-work as designed otherwise.</p>
- <p>Adding this value requires that you set your build target to Android 4.0 or higher in order to
-compile. Older versions of Android ignore the {@code "collapseActionView"} value because they don't
-understand it. Just be sure not to use other APIs in your source code that are not supported in the
-version declared by your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
-minSdkVersion}</a>, unless you add the appropriate version check at runtime.</p>
-</div>
-</div>
+<h3 id="ActionViewCollapsing">Handling collapsible action views</h3>
-<p>Action views allow you to provide fast access to rich actions without changing activities or
-fragments, or replacing the action bar. However, it might not be appropriate to make an action view
-visible by default. To preserve the action bar space (especially when running on smaller screens),
-you can collapse your action view into an action item button. When the user selects the
-button, the action view appears in the action bar. When collapsed, the system might place the item
-into the overflow menu if you've defined {@code android:showAsAction} with {@code "ifRoom"}, but the
-action view still appears in the action bar when the user selects the item. You can make your action
-view collapsible by adding {@code "collapseActionView"} to the {@code android:showAsAction}
+<p>To preserve the action bar space, you can collapse your action view into an action button.
+When collapsed, the system might place the action
+into the action overflow, but the
+action view still appears in the action bar when the user selects it. You can make your action
+view collapsible by adding {@code "collapseActionView"} to the {@code showAsAction}
attribute, as shown in the XML above.</p>
-<p>Because the system will expand the action view when the user selects the item, you
+<p>Because the system expands the action view when the user selects the action, you
<em>do not</em> need to respond to the item in the {@link
-android.app.Activity#onOptionsItemSelected onOptionsItemSelected} callback. The system still calls
-{@link android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} when the user selects it,
-but the system will always expand the action view unless you return {@code true} (indicating
-you've handled the event instead).</p>
-
-<p>The system also collapses your action view when the user selects the "up" icon in the action
-bar or presses the BACK button.</p>
-
-<p>If necessary, you can expand or collapse the action view in your own code by calling {@link
-android.view.MenuItem#expandActionView()} and {@link android.view.MenuItem#collapseActionView()} on
-the {@link android.view.MenuItem}.</p>
-
-<p class="note"><strong>Note:</strong> Although collapsing your action view is optional, we
-recommend that you always collapse your action view if it includes {@link
-android.widget.SearchView}. Also be aware that some devices provide a dedicated SEARCH button and
-you should expand your search action view if the user presses the SEARCH button. Simply override
-your activity's {@link android.app.Activity#onKeyUp onKeyUp()} callback method, listen for the
-{@link android.view.KeyEvent#KEYCODE_SEARCH} event, then call {@link
-android.view.MenuItem#expandActionView()}.</p>
+android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} callback. The system still calls
+{@link android.app.Activity#onOptionsItemSelected onOptionsItemSelected()}, but if
+you return {@code true} (indicating you've handled the event instead), then the
+action view will <em>not</em> expand.</p>
+
+<p>The system also collapses your action view when the user presses the <em>Up</em> button
+or <em>Back</em> button.</p>
<p>If you need to update your activity based on the visibility of your action view, you can receive
-callbacks when it's expanded and collapsed by defining an {@link
-android.view.MenuItem.OnActionExpandListener OnActionExpandListener} and registering it with {@link
-android.view.MenuItem#setOnActionExpandListener setOnActionExpandListener()}. For example:</p>
+callbacks when the action is expanded and collapsed by defining an {@link
+android.support.v4.view.MenuItemCompat.OnActionExpandListener OnActionExpandListener} and
+passing it to {@link android.support.v4.view.MenuItemCompat#setOnActionExpandListener
+setOnActionExpandListener()}. For example:</p>
+
<pre>
&#64;Override
@@ -708,7 +651,9 @@ public boolean onCreateOptionsMenu(Menu menu) {
MenuItem menuItem = menu.findItem(R.id.actionItem);
...
- menuItem.setOnActionExpandListener(new OnActionExpandListener() {
+ // When using the support library, the setOnActionExpandListener() method is
+ // static and accepts the MenuItem object as an argument
+ MenuItemCompat.setOnActionExpandListener(menuItem, new OnActionExpandListener() {
&#64;Override
public boolean onMenuItemActionCollapse(MenuItem item) {
// Do something when collapsed
@@ -729,165 +674,168 @@ public boolean onCreateOptionsMenu(Menu menu) {
<h2 id="ActionProvider">Adding an Action Provider</h2>
-<div class="figure" style="width:200px">
- <img src="{@docRoot}images/ui/actionbar-shareaction.png" alt="" />
- <p class="img-caption"><strong>Figure 8.</strong> Screenshot from the Gallery app, with the
- {@link android.widget.ShareActionProvider} submenu expanded to show share targets.</p>
+<div class="figure" style="width:240px">
+ <img src="{@docRoot}images/ui/actionbar-shareaction@2x.png" alt="" width="240" />
+ <p class="img-caption"><strong>Figure 6.</strong> An action bar with
+ {@link android.widget.ShareActionProvider} expanded to show share targets.</p>
</div>
-<p>Similar to an <a href="#ActionView">action view</a>, an action provider (defined by the {@link
-android.view.ActionProvider} class) replaces an action item with a customized layout, but it also
-takes control of all the item's behaviors. When you declare an action provider for a menu
-item in the action bar, it not only controls the appearance of the item in the action bar with a
-custom layout, but also handles the default event for the menu item when it appears in the overflow
-menu. It can also provide a submenu from either the action bar or the overflow menu.</p>
-
-<p>For example, the {@link android.widget.ShareActionProvider} is an extension of {@link
-android.view.ActionProvider} that facilitates a “share" action by showing a list of available share
-targets from the action bar. Instead of using a
-traditional action item that invokes the {@link android.content.Intent#ACTION_SEND} intent, you can
-declare an instance of {@link android.widget.ShareActionProvider} to handle an action item. This
-action provider presents an action view with a drop-down list of applications that handle
-the {@link android.content.Intent#ACTION_SEND} intent, even when the menu item appears in the
-overflow menu. Hence, when you use an action provider such as this one, you don't
-have to handle user events on the menu item.</p>
-
-<p>To declare an action provider for an action item, define the {@code android:actionProviderClass}
-attribute for the appropriate the {@code &lt;item&gt;} element in your <a
-href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a>, using the
-fully-qualified class name of the action provider. For example:</p>
+<p>Similar to an <a href="#ActionView">action view</a>, an <em>action provider</em>
+replaces an action button with a customized layout. However,
+unlike an action view, an action provider takes control of all the action's behaviors
+and an action provider can display a submenu when pressed.</p>
-<pre>
-&lt;?xml version="1.0" encoding="utf-8"?>
-&lt;menu xmlns:android="http://schemas.android.com/apk/res/android">
- &lt;item android:id="@+id/menu_share"
- android:title="@string/share"
- android:showAsAction="ifRoom"
- <strong>android:actionProviderClass="android.widget.ShareActionProvider"</strong> /&gt;
- ...
-&lt;/menu>
-</pre>
+<p>To declare an action provider, supply the {@code actionViewClass} attribute in the
+menu {@code &lt;item>} tag with a fully-qualified class name for an
+{@link android.support.v4.view.ActionProvider}.</p>
-<p>In this example, the {@link android.widget.ShareActionProvider} is used as the action provider.
-At this point, the action provider officially takes control of the menu item and handles both
-its appearance and behavior in the action bar and its behavior in the overflow menu. You must
-still provide a text title for the item to be used in the overflow menu.</p>
+<p>You can build your own action provider by extending the {@link
+android.support.v4.view.ActionProvider} class, but Android provides some pre-built action providers
+such as {@link android.support.v7.widget.ShareActionProvider}, which facilitates a "share" action
+by showing a list of possible apps for sharing directly in the action bar (as shown in figure
+6).</p>
-<p>Although the action provider can perform the default action for the menu item when it appears in
-the overflow menu, your activity (or fragment) can override that behavior by
-also handling the click event from the {@link android.app.Activity#onOptionsItemSelected
-onOptionsItemSelected()} callback method. If you do not handle the event in that callback, then
-the action provider receives the {@link android.view.ActionProvider#onPerformDefaultAction()}
-callback to handle the event. However, if the action provider provides a submenu, then your
-activity will not receive the {@link android.app.Activity#onOptionsItemSelected
-onOptionsItemSelected()} callback, because the submenu is shown instead of invoking the default
-menu item behavior when selected.</p>
+<p>Because each {@link android.support.v4.view.ActionProvider} class defines its own action
+behaviors, you don't need to listen for the action in the {@link
+android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} method. If necessary though,
+you can still listen for the click event in the {@link android.app.Activity#onOptionsItemSelected
+onOptionsItemSelected()} method in case you need to simultaneously perform another action. But be
+sure to return {@code false} so that the the action provider still receives the {@link
+android.support.v4.view.ActionProvider#onPerformDefaultAction()} callback to perform its intended
+action.</p>
+
+
+<p>However, if the action provider provides a submenu of actions, then your
+activity does not receive a call to {@link android.app.Activity#onOptionsItemSelected
+onOptionsItemSelected()} when the user opens the list or selects one of the submenu items.</p>
<h3 id="ShareActionProvider">Using the ShareActionProvider</h3>
-<p>If you want to provide a "share" action in your action bar by leveraging other applications
-installed on the device (for example, to share a photo using a messaging or social app), then using
-{@link android.widget.ShareActionProvider} is an effective way to do so, rather than adding an
-action item that invokes the {@link android.content.Intent#ACTION_SEND} intent. When
-you use {@link android.widget.ShareActionProvider} for an action item, it presents an action view
-with a drop-down list of applications that handle the {@link android.content.Intent#ACTION_SEND}
-intent (as shown in figure 8).</p>
+<p>To add a "share" action with {@link android.support.v7.widget.ShareActionProvider},
+define the {@code actionProviderClass} for an {@code &lt;item&gt;} tag with
+the {@link android.support.v7.widget.ShareActionProvider} class. For example:</p>
-<p>All the logic for creating the submenu, populating it with share targets, and handling click
-events (including when the item appears in the overflow menu) is implemented by the {@link
-android.widget.ShareActionProvider}&mdash;the only code you need to write is to declare the action
-provider for the menu item and specify the share intent.</p>
+<pre>
+&lt;?xml version="1.0" encoding="utf-8"?>
+&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:example.app="http://schemas.android.com/apk/res-auto" >
+ &lt;item android:id="@+id/action_share"
+ android:title="@string/share"
+ example.app:showAsAction="ifRoom"
+ <strong>example.app:actionProviderClass="android.support.v7.widget.ShareActionProvider"</strong>
+ /&gt;
+ ...
+&lt;/menu>
+</pre>
-<p>By default, the {@link android.widget.ShareActionProvider} retains a ranking for each
-share target based on how often the user selects each one. The share targets used more frequently
-appear at the top of the drop-down list and the target used most often appears directly in the
-action bar as the default share target. By default, the ranking information is
-saved in a private file with a name specified by {@link
-android.widget.ShareActionProvider#DEFAULT_SHARE_HISTORY_FILE_NAME}. If you use the {@link
-android.widget.ShareActionProvider} or an extension of it for only one type of action, then you
-should continue to use this default history file and there's nothing you need to do. However, if you
-use {@link android.widget.ShareActionProvider} or an extension of it for multiple actions with
-semantically different meanings, then each {@link android.widget.ShareActionProvider} should specify
-its own history file in order to maintain its own history. To specify a
-different history file for the {@link android.widget.ShareActionProvider}, call {@link
-android.widget.ShareActionProvider#setShareHistoryFileName setShareHistoryFileName()} and provide
-an XML file name (for example, {@code "custom_share_history.xml"}).</p>
-
-<p class="note"><strong>Note:</strong> Although the {@link android.widget.ShareActionProvider} ranks
-share targets based on frequency of use, the behavior is extensible and extensions of {@link
-android.widget.ShareActionProvider} can perform different behaviors and ranking based on the history
-file (if appropriate).</p>
-
-<p>To add {@link android.widget.ShareActionProvider}, simply define the {@code
-android:actionProviderClass} attribute with {@code "android.widget.ShareActionProvider"}, as shown
-in the XML example above. The only thing left to do is define
-the {@link android.content.Intent} you want to use for sharing. To do so, you must call {@link
-android.view.MenuItem#getActionProvider} to retrieve the {@link android.widget.ShareActionProvider}
-that's associated with a {@link android.view.MenuItem}, then call {@link
-android.widget.ShareActionProvider#setShareIntent setShareIntent()}.</p>
-
-<p>If the format for the share intent depends on the selected item or other variables that change
-during the activity lifecycle, you should save the {@link android.widget.ShareActionProvider} in a
-member field and update it by calling {@link android.widget.ShareActionProvider#setShareIntent
-setShareIntent()} as necessary. For example:</p>
+<p>Now the action provider takes control of the action item and handles both
+its appearance and behavior. But you must
+still provide a title for the item to be used when it appears in the action overflow.</p>
+
+<p>The only thing left to do is define
+the {@link android.content.Intent} you want to use for sharing. To do so, edit
+your {@link
+android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()} method to call {@link
+android.support.v4.view.MenuItemCompat#getActionProvider MenuItemCompat.getActionProvider()}
+and pass it the {@link android.view.MenuItem} holding the action provider. Then call {@link
+android.support.v7.widget.ShareActionProvider#setShareIntent setShareIntent()} on the
+returned {@link android.support.v7.widget.ShareActionProvider} and pass it an
+{@link android.content.Intent#ACTION_SEND} intent with the appropriate content attached.</p>
+
+<p>You should call {@link
+android.support.v7.widget.ShareActionProvider#setShareIntent setShareIntent()} once during {@link
+android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()} to initialize the share action,
+but because the user context might change, you must update the intent any time the shareable
+content changes by again calling {@link
+android.support.v7.widget.ShareActionProvider#setShareIntent setShareIntent()}.</p>
+
+<p>For example:</p>
<pre>
private ShareActionProvider mShareActionProvider;
-...
&#64;Override
public boolean onCreateOptionsMenu(Menu menu) {
- mShareActionProvider = (ShareActionProvider) menu.findItem(R.id.menu_share).getActionProvider();
+ getMenuInflater().inflate(R.menu.main_activity_actions, menu);
- // If you use more than one ShareActionProvider, each for a different action,
- // use the following line to specify a unique history file for each one.
- // mShareActionProvider.setShareHistoryFileName("custom_share_history.xml");
+ // Set up ShareActionProvider's default share intent
+ MenuItem shareItem = menu.findItem(R.id.action_share);
+ mShareActionProvider = (ShareActionProvider)
+ MenuItemCompat.getActionProvider(shareItem);
+ mShareActionProvider.setShareIntent(getDefaultIntent());
- // Set the default share intent
- mShareActionProvider.setShareIntent(getDefaultShareIntent());
+ return super.onCreateOptionsMenu(menu);
+}
- return true;
+/** Defines a default (dummy) share intent to initialize the action provider.
+ * However, as soon as the actual content to be used in the intent
+ * is known or changes, you must update the share intent by again calling
+ * mShareActionProvider.{@link android.support.v7.widget.ShareActionProvider#setShareIntent setShareIntent()}
+ */
+private Intent getDefaultIntent() {
+ Intent intent = new Intent(Intent.ACTION_SEND);
+ intent.setType("image/*");
+ return intent;
}
-// When you need to update the share intent somewhere else in the app, call
-// mShareActionProvider.{@link android.widget.ShareActionProvider#setShareIntent setShareIntent()}
</pre>
-<p>The {@link android.widget.ShareActionProvider} now handles all user interaction with the item and
-you <em>do not</em> need to handle click events from the {@link
+<p>The {@link android.support.v7.widget.ShareActionProvider} now handles all user interaction with
+the item and you <em>do not</em> need to handle click events from the {@link
android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} callback method.</p>
-<p>For a sample using the share action provider, see
-<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ActionBarShareActionProviderActivity.html"
->ActionBarShareActionProviderActivity</a>.
+
+<p>By default, the {@link android.support.v7.widget.ShareActionProvider} retains a ranking for each
+share target based on how often the user selects each one. The share targets used more frequently
+appear at the top of the drop-down list and the target used most often appears directly in the
+action bar as the default share target. By default, the ranking information is saved in a private
+file with a name specified by {@link
+android.support.v7.widget.ShareActionProvider#DEFAULT_SHARE_HISTORY_FILE_NAME}. If you use the
+{@link android.support.v7.widget.ShareActionProvider} or an extension of it for only one type of
+action, then you should continue to use this default history file and there's nothing you need to
+do. However, if you use {@link android.support.v7.widget.ShareActionProvider} or an extension of it
+for multiple actions with semantically different meanings, then each {@link
+android.support.v7.widget.ShareActionProvider} should specify its own history file in order to
+maintain its own history. To specify a different history file for the {@link
+android.support.v7.widget.ShareActionProvider}, call {@link
+android.support.v7.widget.ShareActionProvider#setShareHistoryFileName setShareHistoryFileName()}
+and provide an XML file name (for example, {@code "custom_share_history.xml"}).</p>
+
+
+<p class="note"><strong>Note:</strong> Although the {@link
+android.support.v7.widget.ShareActionProvider} ranks share targets based on frequency of use, the
+behavior is extensible and extensions of {@link android.support.v7.widget.ShareActionProvider} can
+perform different behaviors and ranking based on the history file (if appropriate).</p>
+
<h3 id="CreatingActionProvider">Creating a custom action provider</h3>
-<p>When you want to create an action view that has dynamic behaviors and a default action in the
-overflow menu, extending {@link android.view.ActionProvider} to define those behaviors is a good
-solution. Creating your own action provider offers you an organized and reusable component, rather
-than handling the various action item transformations and behaviors in your fragment or activity
-code. As shown in the previous section, Android provides one implementation of {@link
-android.view.ActionProvider} for share actions: the {@link android.widget.ShareActionProvider}.</p>
+<p>Creating your own action provider allows you to re-use and manage dynamic action item
+behaviors in a self-contained module, rather than handle action item transformations and
+behaviors in your fragment or activity
+code. As shown in the previous section, Android already provides an implementation of {@link
+android.support.v4.view.ActionProvider} for share actions: the {@link
+android.support.v7.widget.ShareActionProvider}.</p>
-<p>To create your own, simply extend the {@link android.view.ActionProvider} class and implement
+<p>To create your own action provider for a different action, simply extend the
+{@link android.support.v4.view.ActionProvider} class and implement
its callback methods as appropriate. Most importantly, you should implement the following:</p>
<dl>
- <dt>{@link android.view.ActionProvider#ActionProvider ActionProvider()}</dt>
+ <dt>{@link android.support.v4.view.ActionProvider#ActionProvider ActionProvider()}</dt>
<dd>This constructor passes you the application {@link android.content.Context}, which you
should save in a member field to use in the other callback methods.</dd>
- <dt>{@link android.view.ActionProvider#onCreateActionView()}</dt>
+ <dt>{@link android.support.v4.view.ActionProvider#onCreateActionView(MenuItem)}</dt>
<dd>This is where you define the action view for the item. Use the {@link
android.content.Context} acquired from the constructor to instantiate a {@link
android.view.LayoutInflater} and inflate your action view layout from an XML resource, then hook
up event listeners. For example:
<pre>
-public View onCreateActionView() {
+public View onCreateActionView(MenuItem forItem) {
// Inflate the action view to be shown on the action bar.
LayoutInflater layoutInflater = LayoutInflater.from(mContext);
View view = layoutInflater.inflate(R.layout.action_provider, null);
@@ -903,18 +851,21 @@ public View onCreateActionView() {
</pre>
</dd>
- <dt>{@link android.view.ActionProvider#onPerformDefaultAction()}</dt>
- <dd>The system calls this when the menu item is selected from the overflow menu and the
+ <dt>{@link android.support.v4.view.ActionProvider#onPerformDefaultAction()}</dt>
+ <dd>The system calls this when the menu item is selected from the action overflow and the
action provider should perform a default action for the menu item.
<p>However, if your action provider provides a submenu, through the {@link
-android.view.ActionProvider#onPrepareSubMenu onPrepareSubMenu()} callback, then the submenu
-appears even when the menu item is in the overflow menu. Thus, {@link
-android.view.ActionProvider#onPerformDefaultAction()} is never called when there is a
+android.support.v4.view.ActionProvider#onPrepareSubMenu onPrepareSubMenu()} callback, then the
+submenu appears even when the action provider is placed in the action overflow. Thus, {@link
+android.support.v4.view.ActionProvider#onPerformDefaultAction()} is never called when there is a
submenu.</p>
+
<p class="note"><strong>Note:</strong> An activity or a fragment that implements {@link
android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} can override the action
-provider's default behavior by handling the item-selected event (and returning true), in which
-case, the system does not call {@link android.view.ActionProvider#onPerformDefaultAction()}.</p>
+provider's default behavior (unless it uses a submenu) by handling the item-selected event (and
+returning <code>true</code>), in which case, the system does not call {@link
+android.support.v4.view.ActionProvider#onPerformDefaultAction()}.</p>
+
</dd>
</dl>
@@ -927,62 +878,68 @@ href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/Acti
<h2 id="Tabs">Adding Navigation Tabs</h2>
+<img src="{@docRoot}images/ui/actionbar-tabs@2x.png" width="760" alt="" />
+<p class="img-caption"><strong>Figure 7.</strong> Action bar tabs on a wide screen.</p>
-<div class="figure" style="width:450px">
- <img src="{@docRoot}images/ui/actionbar.png" alt="" />
- <p class="img-caption"><strong>Figure 9.</strong> Screenshot of action bar tabs from the <a
-href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a> app.</p>
-</div>
+<a class="notice-designers" href="{@docRoot}design/building-blocks/tabs.html">
+ <div>
+ <h3>Design Guide</h3>
+ <p>Tabs</p>
+ </div>
+</a>
+
+<a class="notice-developers" href="{@docRoot}training/implementing-navigation/lateral.html">
+ <div>
+ <h3>Also read</h3>
+ <p>Creating Swipe Views with Tabs</p>
+ </div>
+</a>
-<div class="figure" style="width:250px">
- <img src="{@docRoot}images/ui/actionbar-stacked.png" alt="" />
- <p class="img-caption"><strong>Figure 10.</strong> Screenshot of tabs in the stacked action
-bar on a narrow screen.</p>
+
+<div class="figure" style="width:240px">
+ <img src="{@docRoot}images/ui/actionbar-tabs-stacked@2x.png" width="240" alt="" />
+ <p class="img-caption"><strong>Figure 8.</strong> Tabs on a narrow screen.</p>
</div>
-<p>When you want to provide navigation tabs in an activity, using the action bar's
-tabs is a great option (instead of using {@link android.widget.TabWidget}), because the
-system adapts the action bar tabs for different screen sizes&mdash;placing them in the main action
-bar when the screen is sufficiently wide, or in a separate bar (known as the "stacked action bar")
-when the screen is too narrow, as shown in figures 9 and 10.</p>
-
-<p>To switch between fragments using the tabs, you must perform a fragment
-transaction each time a tab is selected. If you're not familiar with how to change fragments
-using {@link android.app.FragmentTransaction}, first read the <a
-href="{@docRoot}guide/components/fragments.html">Fragments</a> developer guide.</p>
-
-<p>To get started, your layout must include a {@link android.view.ViewGroup} in which you place each
-{@link android.app.Fragment} associated with a tab. Be sure the {@link android.view.ViewGroup} has a
-resource ID so you can reference it from your tab-swapping code. Alternatively, if the tab content
-will fill the activity layout (excluding the action bar), then your activity doesn't need a layout
-at all (you don't even need to call {@link android.app.Activity#setContentView
-setContentView()}). Instead, you can place each fragment in the default root {@link
-android.view.ViewGroup}, which you can refer to with the {@code android.R.id.content} ID (you can
-see this ID used in the sample code below, during fragment transactions).</p>
+<p>Tabs in the action bar make it easy for users to explore and switch between different views in
+your app. The tabs provided by the {@link android.support.v7.app.ActionBar} are ideal because they
+adapt to different screen sizes. For example, when the screen is wide enough the tabs appear in the
+action bar alongside the action buttons (such as when on a tablet, shown in figure 7), while when
+on a narrow screen they appear in a separate bar (known as the "stacked action bar", shown in
+figure 8). In some cases, the Android system will instead show your tab items as a drop-down list
+to ensure the best fit in the action bar.</p>
+
+<p>To get started, your layout must include a {@link android.view.ViewGroup} in which you place
+each {@link android.app.Fragment} associated with a tab. Be sure the {@link android.view.ViewGroup}
+has a resource ID so you can reference it from your code and swap the tabs within it.
+Alternatively, if the tab content will fill the activity layout, then your activity doesn't need a
+layout at all (you don't even need to call {@link android.app.Activity#setContentView
+setContentView()}). Instead, you can place each fragment in the default root view, which you can
+refer to with the {@code android.R.id.content} ID.</p>
+
<p>Once you determine where the fragments appear in the layout, the basic procedure to add tabs
is:</p>
<ol>
- <li>Implement the {@link android.app.ActionBar.TabListener} interface. Callbacks in this
-interface respond to user events on the tabs so you can swap fragments.</li>
- <li>For each tab you want to add, instantiate an {@link android.app.ActionBar.Tab} and set the
-{@link android.app.ActionBar.TabListener} by calling {@link android.app.ActionBar.Tab#setTabListener
-setTabListener()}. Also set the tab's title and/or icon with {@link
-android.app.ActionBar.Tab#setText setText()} and/or {@link android.app.ActionBar.Tab#setIcon
-setIcon()}.</li>
- <li>Add each tab to the action bar by calling {@link android.app.ActionBar#addTab addTab()}.</li>
+ <li>Implement the {@link android.support.v7.app.ActionBar.TabListener} interface. This interface
+ provides callbacks for tab events, such as when the user presses one so you can swap the
+ tabs.</li>
+ <li>For each tab you want to add, instantiate an {@link android.support.v7.app.ActionBar.Tab}
+ and set the {@link android.support.v7.app.ActionBar.TabListener} by calling {@link
+ android.support.v7.app.ActionBar.Tab#setTabListener setTabListener()}. Also set the tab's title
+ and with {@link android.app.ActionBar.Tab#setText setText()} (and optionally, an icon with
+ {@link android.app.ActionBar.Tab#setIcon setIcon()}).</li>
+ <li>Then add each tab to the action bar by calling {@link android.support.v7.app.ActionBar#addTab
+ addTab()}.</li>
</ol>
-<p>When looking at the {@link android.app.ActionBar.TabListener} interface, notice that the
-callback methods provide only the {@link android.app.ActionBar.Tab} that was selected and a {@link
-android.app.FragmentTransaction} for you to perform fragment transactions&mdash;it doesn't say
-anything about what fragment you should swap in or out. Thus, you must define your own association
+<p>Notice that the {@link android.support.v7.app.ActionBar.TabListener}
+callback methods don't specify which fragment is associated with the tab, but merely which
+{@link android.support.v7.app.ActionBar.Tab} was selected.
+You must define your own association
between each {@link android.app.ActionBar.Tab} and the appropriate {@link android.app.Fragment} that
-it represents (in order to perform the appropriate fragment transaction). There are several ways you
-can define the association, depending on your design. In the example below, the {@link
-android.app.ActionBar.TabListener} implementation provides a constructor such that each new tab uses
-its own instance of the listener. Each instance of the listener defines several fields that are
-necessary to later perform a transaction on the appropriate fragment.</p>
+it represents. There are several ways you
+can define the association, depending on your design.</p>
<p>For example, here's how you might implement the {@link android.app.ActionBar.TabListener}
such that each tab uses its own instance of the listener:</p>
@@ -1042,13 +999,10 @@ adds ({@link android.app.FragmentTransaction#add add()}) it to the layout (as a
android.R.id.content} view group)&mdash;when the respective tab is selected, and detaches ({@link
android.app.FragmentTransaction#detach detach()}) it when the tab is unselected.</p>
-<p>The {@link android.app.ActionBar.TabListener} implementation is the bulk of the work. All that
-remains is to create each {@link android.app.ActionBar.Tab} and add it to the {@link
+<p>All that remains is to create each {@link android.app.ActionBar.Tab} and add it to the {@link
android.app.ActionBar}. Additionally, you must call {@link
android.app.ActionBar#setNavigationMode(int) setNavigationMode(NAVIGATION_MODE_TABS)} to make the
-tabs visible. You might also want to disable the activity title by calling {@link
-android.app.ActionBar#setDisplayShowTitleEnabled setDisplayShowTitleEnabled(false)} if the tab
-titles actually indicate the current view.</p>
+tabs visible.</p>
<p>For example, the following code adds two tabs using the listener defined above:</p>
@@ -1060,62 +1014,70 @@ protected void onCreate(Bundle savedInstanceState) {
// android.R.id.content as the container for each fragment
// setup action bar for tabs
- ActionBar actionBar = getActionBar();
+ ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setDisplayShowTitleEnabled(false);
Tab tab = actionBar.newTab()
- .setText(R.string.artist)
- .setTabListener(new TabListener&lt;ArtistFragment>(
- this, "artist", ArtistFragment.class));
+ .setText(R.string.artist)
+ .setTabListener(new TabListener&lt;ArtistFragment>(
+ this, "artist", ArtistFragment.class));
actionBar.addTab(tab);
tab = actionBar.newTab()
- .setText(R.string.album)
- .setTabListener(new TabListener&lt;AlbumFragment>(
- this, "album", AlbumFragment.class));
+ .setText(R.string.album)
+ .setTabListener(new TabListener&lt;AlbumFragment>(
+ this, "album", AlbumFragment.class));
actionBar.addTab(tab);
}
</pre>
-<p class="note"><strong>Note:</strong> The above implementation for {@link
-android.app.ActionBar.TabListener} is one of several possible techniques. You can see more of
-this style in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentTabs.html"
->API Demos</a> app.</p>
+<p>If your activity stops, you should retain the currently selected tab with the <a href=
+"{@docRoot}guide/components/activities.html#SavingActivityState">saved instance state</a> so you
+can open the appropriate tab when the user returns. When it's time to save the state, you can query
+the currently selected tab with {@link
+android.support.v7.app.ActionBar#getSelectedNavigationIndex()}. This returns the index position of
+the selected tab.</p>
-<p>If your activity stops, you should retain the currently selected tab with the <a
-href="{@docRoot}guide/components/activities.html#SavingActivityState">saved instance
-state</a> so you can open the appropriate tab when the user returns. When it's time to save the
-state, you can query the currently selected tab with {@link
-android.app.ActionBar#getSelectedNavigationIndex()}. This returns the index position of the selected
-tab.</p>
<p class="caution"><strong>Caution:</strong> It's important that you save the state of each fragment
-as necessary, so that when users switch fragments with the tabs and then return to a previous
-fragment, it looks the way it did when they left. For information about saving the state of your
+so when users switch fragments with the tabs and then return to a previous
+fragment, it looks the way it did when they left. Some of the state is saved by default, but you
+may need to manually save state for customized views. For information about saving the state of your
fragment, see the <a href="{@docRoot}guide/components/fragments.html">Fragments</a>
-developer guide.</p>
+API guide.</p>
+
+<p class="note"><strong>Note:</strong> The above implementation for {@link
+android.support.v7.app.ActionBar.TabListener} is one of several possible techniques. Another popular
+option is to use {@link android.support.v4.view.ViewPager} to manage the fragments so users
+can also use a swipe gesture to switch tabs. In this case, you simply tell the
+{@link android.support.v4.view.ViewPager} the current tab position in the
+{@link android.support.v7.app.ActionBar.TabListener#onTabSelected onTabSelected()} callback.
+For more information, read
+<a href="{@docRoot}training/implementing-navigation/lateral.html"
+>Creating Swipe Views with Tabs</a>.</p>
-<p class="note"><strong>Note:</strong> In some cases, the Android system will show your action
-bar tabs as a drop-down list in order to ensure the best fit in the action bar.</p>
-<h2 id="Dropdown">Adding Drop-down Navigation</h2>
-<p>As another mode of navigation (or filtering) within your activity, the action bar offers a
-built in drop-down list. For example, the drop-down list can offer different modes by which content
-in the activity is sorted.</p>
+<h2 id="Dropdown">Adding Drop-down Navigation</h2>
-<!--
-<div class="figure" style="width:135px">
- <img src="{@docRoot}images/ui/actionbar-dropdown.png" alt="" />
- <p class="img-caption"><strong>Figure 5.</strong> Screenshot of a drop-down navigation list in the
+<div class="figure" style="width:240px">
+ <img src="{@docRoot}images/ui/actionbar-dropdown@2x.png" alt="" width="240" />
+ <p class="img-caption"><strong>Figure 9.</strong> A drop-down navigation list in the
action bar.</p>
</div>
--->
+
+<p>As another mode of navigation (or filtering) for your activity, the action bar offers a built
+in drop-down list (also known as a "spinner"). For example, the drop-down list can offer different
+modes by which content in the activity is sorted.</p>
+
+<p>Using the drop-down list is useful when changing the content is important but not necessarily a
+frequent occurrence. In cases where switching the content is more frequent,
+you should use <a href="#Tabs">navigation tabs</a> instead.</p>
+
<p>The basic procedure to enable drop-down navigation is:</p>
@@ -1123,36 +1085,31 @@ action bar.</p>
<li>Create a {@link android.widget.SpinnerAdapter} that provides the
list of selectable items for the drop-down and the layout to use when drawing each item in the
list.</li>
- <li>Implement {@link android.app.ActionBar.OnNavigationListener} to define the behavior that
-occurs when the user selects an item from the list.</li>
- <li>Enable navigation mode for the action bar with {@link
-android.app.ActionBar#setNavigationMode setNavigationMode()}. For example:
-<pre>
-ActionBar actionBar = getActionBar();
-actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
-</pre>
- <p class="note"><strong>Note:</strong> You should perform this during your activity's {@link
-android.app.Activity#onCreate
-onCreate()} method.</p>
+ <li>Implement {@link android.support.v7.app.ActionBar.OnNavigationListener} to define the
+ behavior that occurs when the user selects an item from the list.</li>
+ <li>During your activity's {@link android.app.Activity#onCreate
+onCreate()} method, enable the action bar's drop-down list by calling {@link
+android.support.v7.app.ActionBar#setNavigationMode setNavigationMode(NAVIGATION_MODE_LIST)}.
</li>
<li>Set the callback for the drop-down list with {@link
-android.app.ActionBar#setListNavigationCallbacks setListNavigationCallbacks()}. For example:
+android.support.v7.app.ActionBar#setListNavigationCallbacks setListNavigationCallbacks()}.
+For example:
<pre>
actionBar.setListNavigationCallbacks(mSpinnerAdapter, mNavigationCallback);
</pre>
<p>This method takes your {@link android.widget.SpinnerAdapter} and {@link
-android.app.ActionBar.OnNavigationListener}.</p>
+android.support.v7.app.ActionBar.OnNavigationListener}.</p>
</li>
</ol>
-<p>That's the basic setup. However, implementing the {@link android.widget.SpinnerAdapter} and
-{@link android.app.ActionBar.OnNavigationListener} is where most of the work is done. There are many
-ways you can implement these to define the functionality for your drop-down navigation and
+<p>This procedure is relatively short, but implementing the {@link android.widget.SpinnerAdapter}
+and {@link android.app.ActionBar.OnNavigationListener} is where most of the work is done. There are
+many ways you can implement these to define the functionality for your drop-down navigation and
implementing various types of {@link android.widget.SpinnerAdapter} is beyond the scope of this
document (you should refer to the {@link android.widget.SpinnerAdapter} class reference for more
-information). However, below is a simple example for a {@link android.widget.SpinnerAdapter} and
-{@link android.app.ActionBar.OnNavigationListener} to get you started (click the title to
-reveal the sample).</p>
+information). However, below is an example for a {@link android.widget.SpinnerAdapter} and {@link
+android.app.ActionBar.OnNavigationListener} to get you started (click the title to reveal the
+sample).</p>
@@ -1283,31 +1240,71 @@ public class ListContentFragment extends Fragment {
-<h2 id="Style">Styling the Action Bar</h2>
-<p>If you've implemented a custom design for the widgets in your application, you might
-also want to redesign some of the action bar to match your app design. To do so, you need to use
-Android's <a
-href="{@docRoot}guide/topics/ui/themes.html">style and theme</a> framework to restyle the action
-bar using special style properties.</p>
+<h2 id="Style">Styling the Action Bar</h2>
+
+<p>If you want to implement a visual design that represents your app's brand, the action bar allows
+you to customize each detail of its appearance, including the action bar color, text colors, button
+styles, and more. To do so, you need to use Android's <a href=
+"{@docRoot}guide/topics/ui/themes.html">style and theme</a> framework to restyle the action bar
+using special style properties.</p>
-<p class="note"><strong>Note:</strong> In order for background images to change appearance
-depending on the current button state (selected, pressed, unselected), the drawable resource you use
-must be a <a href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">state
-list drawable</a>.</p>
+<p class="caution"><strong>Caution:</strong> For all background drawables you provide, be sure to
+use <a href="{@docRoot}guide/topics/graphics/2d-graphics.html#nine-patch">Nine-Patch drawables</a>
+to allow stretching. The nine-patch image should be <em>smaller</em> than 40dp tall and 30dp
+wide.</p>
-<p class="caution"><strong>Caution:</strong> For all background drawables you provide, be sure to use <a
-href="{@docRoot}guide/topics/graphics/2d-graphics.html#nine-patch">Nine-Patch drawables</a> to allow
-stretching. The Nine-Patch image should be <em>smaller</em> than 40px tall and 30px wide (for the mdpi asset).</p>
<h3 id="GeneralStyles">General appearance</h3>
<dl>
+ <dt>{@link android.R.attr#actionBarStyle
+ actionBarStyle}</dt>
+ <dd>Specifies a style resource that defines various style properties
+ for the action bar.
+ <p>The default for this style for this
+ is {@link android.support.v7.appcompat.R.style#Widget_AppCompat_ActionBar
+ Widget.AppCompat.ActionBar}, which is what you should use as the parent style.</p>
+ <p>Supported styles include:</p>
+ <dl>
+ <dt>{@link android.R.attr#background}</dt>
+ <dd>Defines a drawable resource for the action bar background.</dd>
+ <dt>{@link android.R.attr#backgroundStacked}</dt>
+ <dd>Defines a drawable resource for the stacked action bar
+ (the <a href="#Tabs">tabs</a>).</dd>
+ <dt>{@link android.R.attr#backgroundSplit}</dt>
+ <dd>Defines a drawable resource for the <a href="#SplitBar">split action bar</a>.</dd>
+ <dt>{@link android.R.attr#actionButtonStyle}</dt>
+ <dd>Defines a style resource for action buttons.
+ <p>The default for this style for this
+ is {@link android.support.v7.appcompat.R.style#Widget_AppCompat_ActionButton
+ Widget.AppCompat.ActionButton}, which is what you should use as the parent style.</p>
+ </dd>
+ <dt>{@link android.R.attr#actionOverflowButtonStyle}</dt>
+ <dd>Defines a style resource for overflow action items.
+ <p>The default for this style for this
+ is {@link android.support.v7.appcompat.R.style#Widget_AppCompat_ActionButton_Overflow
+ Widget.AppCompat.ActionButton.Overflow}, which is what you should use as the parent style.</p>
+ </dd>
+ <dt>{@link android.R.attr#displayOptions}</dt>
+ <dd>Defines one or more action bar display options, such as whether to use the app logo,
+ show the activity title, or enable the <em>Up</em> action. See {@link
+ android.R.attr#displayOptions} for all possible values.
+ <dt>{@link android.R.attr#divider}</dt>
+ <dd>Defines a drawable resource for the divider between action items.</dd>
+ <dt>{@link android.R.attr#titleTextStyle}</dt>
+ <dd>Defines a style resource for the action bar title.
+ <p>The default for this style for this
+ is {@link android.support.v7.appcompat.R.style#TextAppearance_AppCompat_Widget_ActionBar_Title
+ TextAppearance.AppCompat.Widget.ActionBar.Title}, which is what you should use as the parent
+ style.</p></dd>
+ </dl>
+ </dd>
<dt>{@link android.R.attr#windowActionBarOverlay
- android:windowActionBarOverlay}</dt>
+ windowActionBarOverlay}</dt>
<dd>Declares whether the action bar should overlay the activity layout rather than offset the
activity's layout position (for example, the Gallery app uses overlay mode). This is
{@code false} by default.
@@ -1322,9 +1319,9 @@ bar.</p>
draw the action bar with a semi-transparent background by default. However, you can modify it with
your own styles and the {@link android.R.style#Theme_DeviceDefault DeviceDefault} theme on
different devices might use an opaque background by default.</p>
- <p>When overlay mode is enabled, your activity layout has no awareness of the action bar laying on
+ <p>When overlay mode is enabled, your activity layout has no awareness of the action bar lying on
top of it. So, you must be careful not to place any important information or UI components in the
-area overlayed by the action bar. If appropriate, you can refer to the platform's value for {@link
+area overlaid by the action bar. If appropriate, you can refer to the platform's value for {@link
android.R.attr#actionBarSize} to determine the height of the action bar, by referencing it
in your XML layout. For example:</p>
<pre>
@@ -1334,13 +1331,13 @@ in your XML layout. For example:</p>
</pre>
<p>You can also retrieve the action bar height at runtime with {@link
android.app.ActionBar#getHeight()}. This reflects the height of the action bar at the time it's
-called, which might not include the stacked action bar (due to navigation tabs) if called during early
-activity lifecycle methods. To see how you can determine the total height at runtime, including the
-stacked action bar, see the <a
-href="{@docRoot}resources/samples/HoneycombGallery/src/com/example/android/hcgallery/TitlesFragment.html"
->{@code TitlesFragment}</a> class in the <a
-href="{@docRoot}resources/samples/HoneycombGallery/index.html"
->Honeycomb Gallery</a> sample app.</p>
+called, which might not include the stacked action bar (due to navigation tabs) if called during
+early activity lifecycle methods. To see how you can determine the total height at runtime,
+including the stacked action bar, see the <a href=
+"{@docRoot}resources/samples/HoneycombGallery/src/com/example/android/hcgallery/TitlesFragment.html">
+{@code TitlesFragment}</a> class in the <a href=
+"{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a> sample app.</p>
+
</dd>
</dl>
@@ -1350,34 +1347,40 @@ href="{@docRoot}resources/samples/HoneycombGallery/index.html"
<dl>
<dt>{@link android.R.attr#actionButtonStyle
- android:actionButtonStyle}</dt>
- <dd>Defines a style resource for the action item buttons.</dd>
+ actionButtonStyle}</dt>
+ <dd>Defines a style resource for the action item buttons.
+ <p>The default for this style for this
+ is {@link android.support.v7.appcompat.R.style#Widget_AppCompat_ActionButton
+ Widget.AppCompat.ActionButton}, which is what you should use as the parent style.</p></dd>
<dt>{@link android.R.attr#actionBarItemBackground
- android:actionBarItemBackground}</dt>
- <dd>Defines a drawable resource for each action item's background. (Added in API level 14.)</dd>
+ actionBarItemBackground}</dt>
+ <dd>Defines a drawable resource for each action item's background.
+ This should be a <a href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList"
+ >state-list drawable</a> to indicate different selected states.</dd>
<dt>{@link android.R.attr#itemBackground
- android:itemBackground}</dt>
- <dd>Defines a drawable resource for each overflow menu item's background.</dd>
+ itemBackground}</dt>
+ <dd>Defines a drawable resource for each action overflow item's background.
+ This should be a <a href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList"
+ >state-list drawable</a> to indicate different selected states.</dd>
<dt>{@link android.R.attr#actionBarDivider
- android:actionBarDivider}</dt>
- <dd>Defines a drawable resource for the divider between action items. (Added in API level
-14.)</dd>
+ actionBarDivider}</dt>
+ <dd>Defines a drawable resource for the divider between action items.</dd>
<dt>{@link android.R.attr#actionMenuTextColor
- android:actionMenuTextColor}</dt>
+ actionMenuTextColor}</dt>
<dd>Defines a color for text that appears in an action item.</dd>
<dt>{@link android.R.attr#actionMenuTextAppearance
- android:actionMenuTextAppearance}</dt>
+ actionMenuTextAppearance}</dt>
<dd>Defines a style resource for text that appears in an action item.</dd>
<dt>{@link android.R.attr#actionBarWidgetTheme
- android:actionBarWidgetTheme}</dt>
+ actionBarWidgetTheme}</dt>
<dd>Defines a theme resource for widgets that are inflated into the action bar as <a
-href="#ActionView">action views</a>. (Added in API level 14.)</dd>
+href="#ActionView">action views</a>.</dd>
</dl>
@@ -1385,16 +1388,25 @@ href="#ActionView">action views</a>. (Added in API level 14.)</dd>
<dl>
<dt>{@link android.R.attr#actionBarTabStyle
- android:actionBarTabStyle}</dt>
- <dd>Defines a style resource for tabs in the action bar.</dd>
+ actionBarTabStyle}</dt>
+ <dd>Defines a style resource for tabs in the action bar.
+ <p>The default for this style for this
+ is {@link android.support.v7.appcompat.R.style#Widget_AppCompat_ActionBar_TabView
+ Widget.AppCompat.ActionBar.TabView}, which is what you should use as the parent style.</p></dd>
<dt>{@link android.R.attr#actionBarTabBarStyle
- android:actionBarTabBarStyle}</dt>
- <dd>Defines a style resource for the thin bar that appears below the navigation tabs.</dd>
+ actionBarTabBarStyle}</dt>
+ <dd>Defines a style resource for the thin bar that appears below the navigation tabs.
+ <p>The default for this style for this
+ is {@link android.support.v7.appcompat.R.style#Widget_AppCompat_ActionBar_TabBar
+ Widget.AppCompat.ActionBar.TabBar}, which is what you should use as the parent style.</p></dd>
<dt>{@link android.R.attr#actionBarTabTextStyle
- android:actionBarTabTextStyle}</dt>
- <dd>Defines a style resource for text in the navigation tabs.</dd>
+ actionBarTabTextStyle}</dt>
+ <dd>Defines a style resource for text in the navigation tabs.
+ <p>The default for this style for this
+ is {@link android.support.v7.appcompat.R.style#Widget_AppCompat_ActionBar_TabText
+ Widget.AppCompat.ActionBar.TabText}, which is what you should use as the parent style.</p></dd>
</dl>
@@ -1402,82 +1414,93 @@ href="#ActionView">action views</a>. (Added in API level 14.)</dd>
<dl>
<dt>{@link android.R.attr#actionDropDownStyle
- android:actionDropDownStyle}</dt>
- <dd>Defines a style for the drop-down navigation (such as the background and text styles).</dd>
+ actionDropDownStyle}</dt>
+ <dd>Defines a style for the drop-down navigation (such as the background and text styles).
+ <p>The default for this style for this
+ is {@link android.support.v7.appcompat.R.style#Widget_AppCompat_Spinner_DropDown_ActionBar
+ Widget.AppCompat.Spinner.DropDown.ActionBar}, which is what you should use as the parent
+ style.</p></dd>
</dl>
+<h3 id="StyleExample">Example theme</h3>
+
+<p>Here's an example that defines a custom theme for an activity, {@code CustomActivityTheme},
+that includes several styles to customize the action bar.</p>
-<p>For example, here's a file that defines a few custom styles for the action bar:</p>
+<p>Notice that there are two version for each action bar style property. The first one
+includes the {@code android:} prefix on the property name to support API levels 11 and higher
+that include these properties in the framework. The second version does <em>not</em>
+include the {@code android:} prefix and is for older versions of the platform, on which
+the system uses the style property from the support library. The effect for each is the same.</p>
<pre>
&lt;?xml version="1.0" encoding="utf-8"?>
&lt;resources>
&lt;!-- the theme applied to the application or activity -->
- &lt;style name="CustomActivityTheme" parent="@android:style/Theme.Holo">
-   &lt;item name="android:actionBarTabTextStyle">@style/CustomTabTextStyle&lt;/item>
-   &lt;item name="android:actionBarDivider">@drawable/ab_divider&lt;/item>
- &lt;item name="android:actionBarItemBackground">@drawable/ab_item_background&lt;/item>
+ &lt;style name="CustomActionBarTheme"
+ parent="&#64;style/Theme.AppCompat.Light">
+ &lt;item name="android:actionBarStyle">&#64;style/MyActionBar&lt;/item>
+ &lt;item name="android:actionBarTabTextStyle">&#64;style/TabTextStyle&lt;/item>
+ &lt;item name="android:actionMenuTextColor">&#64;color/actionbar_text&lt;/item>
+
+ &lt;!-- Support library compatibility -->
+ &lt;item name="actionBarStyle">&#64;style/MyActionBar&lt;/item>
+ &lt;item name="actionBarTabTextStyle">&#64;style/TabTextStyle&lt;/item>
+ &lt;item name="actionMenuTextColor">&#64;color/actionbar_text&lt;/item>
&lt;/style>
- &lt;!-- style for the action bar tab text -->
- &lt;style name="CustomTabTextStyle" parent="@android:style/TextAppearance.Holo">
- &lt;item name="android:textColor">#2456c2&lt;/item>
+ &lt;!-- general styles for the action bar -->
+ &lt;style name="MyActionBar"
+ parent="&#64;style/Widget.AppCompat.ActionBar">
+ &lt;item name="android:titleTextStyle">&#64;style/TitleTextStyle&lt;/item>
+ &lt;item name="android:background">&#64;drawable/actionbar_background&lt;/item>
+ &lt;item name="android:backgroundStacked">&#64;drawable/actionbar_background&lt;/item>
+ &lt;item name="android:backgroundSplit">&#64;drawable/actionbar_background&lt;/item>
+
+ &lt;!-- Support library compatibility -->
+ &lt;item name="titleTextStyle">&#64;style/TitleTextStyle&lt;/item>
+ &lt;item name="background">&#64;drawable/actionbar_background&lt;/item>
+ &lt;item name="backgroundStacked">&#64;drawable/actionbar_background&lt;/item>
+ &lt;item name="backgroundSplit">&#64;drawable/actionbar_background&lt;/item>
&lt;/style>
-&lt;/resources>
-</pre>
-<p class="note"><strong>Note:</strong> Be certain that your theme declares a parent theme in the
-{@code &lt;style>} tag, from which it inherits all styles not explicitly declared by your theme.
-When modifying the action bar, using a parent theme is important so that you can simply override the
-action bar styles you want to change without re-implementing the styles you want to leave alone
-(such as text appearance or padding in action items).</p>
+ &lt;!-- action bar title text -->
+ &lt;style name="TitleTextStyle"
+ parent="&#64;style/TextAppearance.AppCompat.Widget.ActionBar.Title">
+ &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
+ &lt;/style>
-<p>You can apply your custom theme to the entire application or to individual activities in your
-manifest file like this:</p>
+ &lt;!-- action bar tab text -->
+ &lt;style name="TabTextStyle"
+ parent="&#64;style/Widget.AppCompat.ActionBar.TabText">
+ &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
+ &lt;/style>
+&lt;/resources>
-<pre>
-&lt;application android:theme="&#64;style/CustomActivityTheme" ... />
</pre>
-<p>For more information about using style and theme resources in your application, read <a
-href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a>.</p>
-
-
-<h3 id="AdvancedStyles">Advanced styling</h3>
+<p>In your manifest file, you can apply the theme to your entire app:</p>
- <p>If you need more advanced styling for the action bar than is available with the
-properties above, you can include {@link android.R.attr#actionBarStyle android:actionBarStyle} and
-{@link android.R.attr#actionBarSplitStyle android:actionBarSplitStyle} in your activity's theme.
-Each of these specifies another style that can define various properties for the action bar,
-including different backgrounds with {@link android.R.attr#background android:background}, {@link
-android.R.attr#backgroundSplit android:backgroundSplit}, and {@link android.R.attr#backgroundStacked
-android:backgroundStacked}. If you override these action bar styles, be sure that you define a
-parent action bar style such as {@link android.R.style#Widget_Holo_ActionBar
-Widget.Holo.ActionBar}.</p>
+<pre>
+&lt;application android:theme="&#64;style/CustomActionBarTheme" ... />
+</pre>
-<p>For example, if you want to change the action bar's background, you can use the following
-styles:</p>
+<p>Or to individual activities:</p>
<pre>
-&lt;?xml version="1.0" encoding="utf-8"?>
-&lt;resources>
- &lt;!-- the theme applied to the application or activity -->
- &lt;style name="CustomActivityTheme" parent="@android:style/Theme.Holo">
- &lt;item name="android:actionBarStyle">@style/MyActionBar&lt;/item>
- &lt;!-- other activity and action bar styles here -->
- &lt;/style>
-
- &lt;!-- style for the action bar backgrounds -->
- &lt;style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
- &lt;item name="android:background">@drawable/ab_background&lt;/item>
- &lt;item name="android:backgroundStacked">@drawable/ab_background&lt;/item>
- &lt;item name="android:backgroundSplit">@drawable/ab_split_background&lt;/item>
- &lt;/style>
-&lt;/resources>
+&lt;activity android:theme="&#64;style/CustomActionBarTheme" ... />
</pre>
+<p class="caution"><strong>Caution:</strong> Be certain that each theme and style declares a parent
+theme in the {@code &lt;style&gt;} tag, from which it inherits all styles not explicitly declared
+by your theme. When modifying the action bar, using a parent theme is important so that you can
+simply override the action bar styles you want to change without re-implementing the styles you
+want to leave alone (such as text size or padding in action items).</p>
+
+<p>For more information about using style and theme resources in your application, read <a
+href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a>.</p>
diff --git a/docs/html/images/jb-android-43.jpg b/docs/html/images/jb-android-43.jpg
new file mode 100644
index 000000000000..8dc5c2d9801a
--- /dev/null
+++ b/docs/html/images/jb-android-43.jpg
Binary files differ
diff --git a/docs/html/images/jb-android-43@2x.png b/docs/html/images/jb-android-43@2x.png
new file mode 100644
index 000000000000..385c0ffaa488
--- /dev/null
+++ b/docs/html/images/jb-android-43@2x.png
Binary files differ
diff --git a/docs/html/images/jb-btle.png b/docs/html/images/jb-btle.png
new file mode 100644
index 000000000000..7fb367abc4e8
--- /dev/null
+++ b/docs/html/images/jb-btle.png
Binary files differ
diff --git a/docs/html/images/jb-gpu-profile-cal-n4.png b/docs/html/images/jb-gpu-profile-cal-n4.png
new file mode 100644
index 000000000000..97adaaa723b2
--- /dev/null
+++ b/docs/html/images/jb-gpu-profile-cal-n4.png
Binary files differ
diff --git a/docs/html/images/jb-gpu-profile-clk-n4.png b/docs/html/images/jb-gpu-profile-clk-n4.png
new file mode 100644
index 000000000000..72c0a40fc75e
--- /dev/null
+++ b/docs/html/images/jb-gpu-profile-clk-n4.png
Binary files differ
diff --git a/docs/html/images/jb-profiles-create-n713.png b/docs/html/images/jb-profiles-create-n713.png
new file mode 100644
index 000000000000..f5e903878948
--- /dev/null
+++ b/docs/html/images/jb-profiles-create-n713.png
Binary files differ
diff --git a/docs/html/images/jb-profiles-restrictions-n713.png b/docs/html/images/jb-profiles-restrictions-n713.png
new file mode 100644
index 000000000000..4600860b5cb8
--- /dev/null
+++ b/docs/html/images/jb-profiles-restrictions-n713.png
Binary files differ
diff --git a/docs/html/images/jb-pseudo-locale-zz.png b/docs/html/images/jb-pseudo-locale-zz.png
new file mode 100644
index 000000000000..84b3383337f6
--- /dev/null
+++ b/docs/html/images/jb-pseudo-locale-zz.png
Binary files differ
diff --git a/docs/html/images/jb-rtl-arabic-n4.png b/docs/html/images/jb-rtl-arabic-n4.png
new file mode 100644
index 000000000000..f62a9872095a
--- /dev/null
+++ b/docs/html/images/jb-rtl-arabic-n4.png
Binary files differ
diff --git a/docs/html/images/jb-rtl-hebrew-n4.png b/docs/html/images/jb-rtl-hebrew-n4.png
new file mode 100644
index 000000000000..bc7e6309be67
--- /dev/null
+++ b/docs/html/images/jb-rtl-hebrew-n4.png
Binary files differ
diff --git a/docs/html/images/jb-systrace.png b/docs/html/images/jb-systrace.png
new file mode 100644
index 000000000000..9d76ad4c5db0
--- /dev/null
+++ b/docs/html/images/jb-systrace.png
Binary files differ
diff --git a/docs/html/images/practices/actionbar-phone-splitaction.png b/docs/html/images/practices/actionbar-phone-splitaction.png
index a0081e777d9c..24f93f644998 100644
--- a/docs/html/images/practices/actionbar-phone-splitaction.png
+++ b/docs/html/images/practices/actionbar-phone-splitaction.png
Binary files differ
diff --git a/docs/html/images/practices/actionbar-phone-splitaction@2x.png b/docs/html/images/practices/actionbar-phone-splitaction@2x.png
new file mode 100644
index 000000000000..3fe577c8501b
--- /dev/null
+++ b/docs/html/images/practices/actionbar-phone-splitaction@2x.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-dropdown.png b/docs/html/images/ui/actionbar-dropdown.png
new file mode 100644
index 000000000000..26d171d05848
--- /dev/null
+++ b/docs/html/images/ui/actionbar-dropdown.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-dropdown@2x.png b/docs/html/images/ui/actionbar-dropdown@2x.png
new file mode 100644
index 000000000000..07fd2ac759ed
--- /dev/null
+++ b/docs/html/images/ui/actionbar-dropdown@2x.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-item-withtext.png b/docs/html/images/ui/actionbar-item-withtext.png
index 5f7aecc900de..8d217b15827e 100644
--- a/docs/html/images/ui/actionbar-item-withtext.png
+++ b/docs/html/images/ui/actionbar-item-withtext.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-searchview.png b/docs/html/images/ui/actionbar-searchview.png
index 7ae46a0ac011..bd1c1e14dff4 100644
--- a/docs/html/images/ui/actionbar-searchview.png
+++ b/docs/html/images/ui/actionbar-searchview.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-searchview@2x.png b/docs/html/images/ui/actionbar-searchview@2x.png
new file mode 100644
index 000000000000..e14ba8bbfb6e
--- /dev/null
+++ b/docs/html/images/ui/actionbar-searchview@2x.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-shareaction.png b/docs/html/images/ui/actionbar-shareaction.png
index fdbb02ccba3f..6f489d932cef 100644
--- a/docs/html/images/ui/actionbar-shareaction.png
+++ b/docs/html/images/ui/actionbar-shareaction.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-shareaction@2x.png b/docs/html/images/ui/actionbar-shareaction@2x.png
new file mode 100644
index 000000000000..d7e7cf71356a
--- /dev/null
+++ b/docs/html/images/ui/actionbar-shareaction@2x.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-splitaction.png b/docs/html/images/ui/actionbar-splitaction.png
new file mode 100644
index 000000000000..6995d246a03b
--- /dev/null
+++ b/docs/html/images/ui/actionbar-splitaction.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-splitaction@2x.png b/docs/html/images/ui/actionbar-splitaction@2x.png
new file mode 100644
index 000000000000..8bc53b80f2be
--- /dev/null
+++ b/docs/html/images/ui/actionbar-splitaction@2x.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-stacked.png b/docs/html/images/ui/actionbar-stacked.png
deleted file mode 100644
index 76c8908b1a55..000000000000
--- a/docs/html/images/ui/actionbar-stacked.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/images/ui/actionbar-tabs-stacked.png b/docs/html/images/ui/actionbar-tabs-stacked.png
new file mode 100644
index 000000000000..23ee0c29ccfd
--- /dev/null
+++ b/docs/html/images/ui/actionbar-tabs-stacked.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-tabs-stacked@2x.png b/docs/html/images/ui/actionbar-tabs-stacked@2x.png
new file mode 100644
index 000000000000..dde19cc640ab
--- /dev/null
+++ b/docs/html/images/ui/actionbar-tabs-stacked@2x.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-tabs.png b/docs/html/images/ui/actionbar-tabs.png
index 9d36db69fc65..55746fe8a7ee 100644
--- a/docs/html/images/ui/actionbar-tabs.png
+++ b/docs/html/images/ui/actionbar-tabs.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-tabs@2x.png b/docs/html/images/ui/actionbar-tabs@2x.png
new file mode 100644
index 000000000000..71575228565a
--- /dev/null
+++ b/docs/html/images/ui/actionbar-tabs@2x.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar-up.png b/docs/html/images/ui/actionbar-up.png
new file mode 100644
index 000000000000..a797fb68b4ec
--- /dev/null
+++ b/docs/html/images/ui/actionbar-up.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar.png b/docs/html/images/ui/actionbar.png
index 1d01583a4bce..c748a5110eb8 100644
--- a/docs/html/images/ui/actionbar.png
+++ b/docs/html/images/ui/actionbar.png
Binary files differ
diff --git a/docs/html/images/ui/actionbar@2x.png b/docs/html/images/ui/actionbar@2x.png
new file mode 100644
index 000000000000..921ebf0ff43a
--- /dev/null
+++ b/docs/html/images/ui/actionbar@2x.png
Binary files differ
diff --git a/docs/html/images/video-Colopl.png b/docs/html/images/video-Colopl.png
new file mode 100644
index 000000000000..0ee88c68a368
--- /dev/null
+++ b/docs/html/images/video-Colopl.png
Binary files differ
diff --git a/docs/html/index.jd b/docs/html/index.jd
index a9723097b003..a945f0a7a504 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -20,55 +20,38 @@ page.metaDescription=The official site for Android developers. Provides the Andr
<a href="" class="slideshow-next">Next</a>
<div class="frame">
<ul>
+
<li class="item carousel-home">
<div class="content-left col-9">
<a href="{@docRoot}about/versions/jelly-bean.html"><img src="{@docRoot}images/home/android-jellybean.png" ></a>
</div>
<div class="content-right col-6">
- <h1>More Jelly Beans!</h1>
+ <h1>A Sweeter Jelly Bean!</h1>
<p>Android 4.3 is now available with a variety of performance improvements
- and new developer features. </p>
- <p>With this release, Android now supports Bluetooth Low Energy for battery
- savings with wireless peripherals, OpenGL ES 3.0 for the most advanced mobile 3D
- graphics, MPEG DASH support for high quality media streaming, and much more.</p>
+ and new features. </p>
+ <p>For developers, the new platform adds support for <span style="white-space:nowrap;">OpenGL ES 3.0</span>,
+ connectivity with Bluetooth Smart devices and sensors, support for restricted profiles, a modular DRM framework,
+ new profiling tools, and more.</p>
<p><a href="{@docRoot}about/versions/jelly-bean.html" class="button">Learn More</a></p>
</div>
</li>
- <li class="item carousel-home">
- <div class="content-left col-11" style="padding-top:10px;">
- <a href="{@docRoot}channels/io2013.html">
- <img src="{@docRoot}images/home/io-videos-2013.png" style="margin:60px 0 0;
- box-shadow: 3px 10px 18px 1px #999;">
- </a>
- </div>
- <div class="content-right col-4">
- <h1>Watch the Android talks from Google I/O</h1>
- <p>If you weren't able to attend Google I/O in person or couldn't make it
- to all the talks, you can catch up on the action
- with all the recordings, brought to you by
- <a href="http://developers.google.com/live">Google Developers Live</a>.</p>
- <p><a href="{@docRoot}channels/io2013.html" class="button"
- >See the Android talks</a></p>
- </div>
- </li>
-
<li class="item carousel-home">
<div class="content-left col-11" style="padding-top:65px;">
<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
- <div style="box-shadow: 3px 10px 18px 1px #999;width:600px;height:338px">
+ <div style="box-shadow: 3px 10px 18px 1px #999;width:600px;height:336px">
<div id="ytapiplayer">
- You need Flash player 8+ and JavaScript enabled to view this video.
+ <a href="http://www.youtube.com/watch?v=CbpoZeQCNe4"><img width=600 src="{@docRoot}images/video-Colopl.png"></a><!--You need Flash player 8+ and JavaScript enabled to view this video. -->
</div>
<script type="text/javascript">
var params = { allowScriptAccess: "always" };
var atts = { id: "ytapiplayer" };
- swfobject.embedSWF("//www.youtube.com/v/O8i4HUw7JYA?enablejsapi=1&playerapiid=ytplayer&version=3&HD=1;rel=0;showinfo=0;modestbranding;origin=developer.android.com;autohide=1",
- "ytapiplayer", "600", "338", "8", null, null, params, atts);
+ swfobject.embedSWF("//www.youtube.com/v/CbpoZeQCNe4?enablejsapi=1&playerapiid=ytplayer&version=3&HD=1;rel=0;showinfo=0;modestbranding;origin=developer.android.com;autohide=1",
+ "ytapiplayer", "600", "336", "8", null, null, params, atts);
// Callback used to pause/resume carousel based on video state
- function onytplayerStateChange(newState) {
+ function onytplayerStateChange(newState) {
var isPaused = $("#pauseButton").hasClass("paused");
if ((newState == 1) || (newState == 3)) {
// if playing or buffering, pause the carousel
@@ -93,10 +76,31 @@ page.metaDescription=The official site for Android developers. Provides the Andr
</div>
</div>
<div class="content-right col-4">
- <h1 style="white-space:nowrap;line-height:1.2em;">Developer Story: <br />redBus.in</h1>
- <p>Bangalore-based developers redBus.in talk about how Android is helping them deliver a superior booking and travel experience to millions of daily bus riders in India.</p>
+ <h1 style="white-space:nowrap;line-height:1.2em;">Developer Story: <br />Colopl</h1>
+ <p>The creators of Kuma The Bear, Japan-based Colopl, talk about how Google Play and Android allowed them to grow their business to become one of the most profitable games publishers in APAC to date. </p>
</div>
</li>
+
+
+ <li class="item carousel-home">
+ <div class="content-left col-11" style="padding-top:10px;">
+ <a href="{@docRoot}channels/io2013.html">
+ <img src="{@docRoot}images/home/io-videos-2013.png" style="margin:60px 0 0;
+ box-shadow: 3px 10px 18px 1px #999;">
+ </a>
+ </div>
+ <div class="content-right col-4">
+ <h1>Watch the Android talks from Google I/O</h1>
+ <p>If you weren't able to attend Google I/O in person or couldn't make it
+ to all the talks, you can catch up on the action
+ with all the recordings, brought to you by
+ <a href="http://developers.google.com/live">Google Developers Live</a>.</p>
+ <p><a href="{@docRoot}channels/io2013.html" class="button"
+ >See the Android talks</a></p>
+ </div>
+ </li>
+
+
<li class="item carousel-home">
<div class="content-left col-10">
<img src="{@docRoot}images/home/design.png" style="margin-top:30px">
@@ -108,6 +112,8 @@ that are beautiful and easy to use.</p>
<p><a href="{@docRoot}design/index.html" class="button">Learn More</a></p>
</div>
</li>
+
+
<li class="item carousel-home">
<div class="content-left col-10">
<img src="{@docRoot}images/home/google-play.png"
@@ -118,16 +124,16 @@ that are beautiful and easy to use.</p>
<p>The most visited store in the world for Android apps. Cloud-connected and always synced, it's never been easier for users to find and download your apps.</p>
<p><a href="{@docRoot}distribute/index.html" class="button">Learn More</a></p>
- </div>
+ </div>
</li>
</ul>
</div>
</div>
<!-- /End slideshow -->
-
+
<a href="" id="pauseButton" style="display:none">pause</a>
-
-
+
+
</div>
<div class="wrap" style="padding-bottom:20px">
<!-- Section links -->
@@ -141,4 +147,4 @@ that are beautiful and easy to use.</p>
</ul>
</div>
<!-- /Section links -->
-</div>
+</div>
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 0d0f3486d552..aa3b2ec8761b 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -5,43 +5,43 @@ header.hide=1
page.metaDescription=Download the official Android SDK to develop apps for Android-powered devices.
-sdk.linux32_bundle_download=adt-bundle-linux-x86-20130522.zip
-sdk.linux32_bundle_bytes=439988972
-sdk.linux32_bundle_checksum=1fdd8d7537ab9217d61d32ab912f0243
+sdk.linux32_bundle_download=adt-bundle-linux-x86-20130717.zip
+sdk.linux32_bundle_bytes=440035305
+sdk.linux32_bundle_checksum=ecfacb91df1ee63cce1edd4f1a5cda5a
-sdk.linux64_bundle_download=adt-bundle-linux-x86_64-20130522.zip
-sdk.linux64_bundle_bytes=440275051
-sdk.linux64_bundle_checksum=e38751ff372a8d6208fcef5659133e98
+sdk.linux64_bundle_download=adt-bundle-linux-x86_64-20130717.zip
+sdk.linux64_bundle_bytes=440322117
+sdk.linux64_bundle_checksum=ab177a06784340b8f1d136651e3dc62a
-sdk.mac64_bundle_download=adt-bundle-mac-x86_64-20130522.zip
-sdk.mac64_bundle_bytes=409047751
-sdk.mac64_bundle_checksum=3f4d05206d66e402e87b27a6b3dcf0f9
+sdk.mac64_bundle_download=adt-bundle-mac-x86_64-20130717.zip
+sdk.mac64_bundle_bytes=411609229
+sdk.mac64_bundle_checksum=07c891212a49b5f8495ea9d8d47ba3fe
-sdk.win32_bundle_download=adt-bundle-windows-x86-20130522.zip
-sdk.win32_bundle_bytes=446736316
-sdk.win32_bundle_checksum=53345fa4121fa58cc048f66c3af3bae9
+sdk.win32_bundle_download=adt-bundle-windows-x86-20130717.zip
+sdk.win32_bundle_bytes=446783216
+sdk.win32_bundle_checksum=0dd91095999d3539ca1ec4033d83d935
-sdk.win64_bundle_download=adt-bundle-windows-x86_64-20130522.zip
-sdk.win64_bundle_bytes=446864400
-sdk.win64_bundle_checksum=b28817f62e7f54e3c683841b61b65564
+sdk.win64_bundle_download=adt-bundle-windows-x86_64-20130717.zip
+sdk.win64_bundle_bytes=446911629
+sdk.win64_bundle_checksum=61ec74995b39166db7f079017a028cec
-sdk.linux_download=android-sdk_r22.0.1-linux.tgz
-sdk.linux_bytes=105617062
-sdk.linux_checksum=56ed27d456b4f0e0d3090b24f9b06757
+sdk.linux_download=android-sdk_r22.0.4-linux.tgz
+sdk.linux_bytes=105640988
+sdk.linux_checksum=4a5db98a58c68c24e66f04f07ac77da5
-sdk.mac_download=android-sdk_r22.0.1-macosx.zip
-sdk.mac_bytes=77206237
-sdk.mac_checksum=5c20497d7f7b9d28ee30e57cbf769c8c
+sdk.mac_download=android-sdk_r22.0.4-macosx.zip
+sdk.mac_bytes=77225662
+sdk.mac_checksum=384752505f4f2ba3627bd6aad0697f11
-sdk.win_download=android-sdk_r22.0.1-windows.zip
-sdk.win_bytes=113483496
-sdk.win_checksum=cb7f7703450afa5914fb4b8b8332a9f3
+sdk.win_download=android-sdk_r22.0.4-windows.zip
+sdk.win_bytes=113507679
+sdk.win_checksum=320b11d1ed85fd3f5e937697c333d895
-sdk.win_installer=installer_r22.0.1-windows.exe
-sdk.win_installer_bytes=93479015
-sdk.win_installer_checksum=81621d3b164f81f91e066011b325f88f
+sdk.win_installer=installer_r22.0.4-windows.exe
+sdk.win_installer_bytes=93502726
+sdk.win_installer_checksum=96a8ae367d84ed219e1eb2cf473667d0
diff --git a/docs/html/sdk/installing/installing-adt.jd b/docs/html/sdk/installing/installing-adt.jd
index b8ab24b49a73..2a09636a256f 100644
--- a/docs/html/sdk/installing/installing-adt.jd
+++ b/docs/html/sdk/installing/installing-adt.jd
@@ -1,8 +1,8 @@
page.title=Installing the Eclipse Plugin
-adt.zip.version=22.0.1
-adt.zip.download=ADT-22.0.1.zip
-adt.zip.bytes=16815544
-adt.zip.checksum=64473af058fa8f02e36241ee378b3ac0
+adt.zip.version=22.0.4
+adt.zip.download=ADT-22.0.4.zip
+adt.zip.bytes=16838756
+adt.zip.checksum=f0291f4bb9d78ec34a7751cd2402cc2a
@jd:body
diff --git a/docs/html/sdk/win-usb.jd b/docs/html/sdk/win-usb.jd
index 802615e3849d..5ca38c6ccf33 100644
--- a/docs/html/sdk/win-usb.jd
+++ b/docs/html/sdk/win-usb.jd
@@ -1,172 +1,315 @@
page.title=Google USB Driver
@jd:body
+
+
+<div style="position:relative;height:660px;">
+
+
+<div class="wrap" id="tos" style="position:absolute;display:none;width:inherit;">
+
+<div class="col-13" style="margin:0;">&nbsp;</div><!-- provides top margin for content -->
+
+
+<p class="sdk-terms-intro">Before downloading the Google USB Driver,
+you must agree to the following terms and conditions.</p>
+
+<div class="sdk-terms" onfocus="this.blur()">
+<h2 class="norule">Terms and Conditions</h2>
+This is the Android Software Development Kit License Agreement
+
+<h3>1. Introduction</h3>
+1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
+
+1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.
+
+1.3 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+
+
+<h3>2. Accepting this License Agreement</h3>
+2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement.
+
+2.2 By clicking to accept, you hereby agree to the terms of this License Agreement.
+
+2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK.
+
+2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.
+
+
+<h3>3. SDK License from Google</h3>
+3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.
+
+3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+
+3.3 You may not use the SDK for any purpose not expressly permitted by this License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
+
+3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the SDK.
+
+3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
+
+3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
+
+3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+
+3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
+
+
+<h3>4. Use of the SDK by You</h3>
+4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.
+
+4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
+
+4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
+
+4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.
+
+4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+
+4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
+
+
+<h3>5. Your Developer Credentials</h3>
+5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
+
+
+<h3>6. Privacy and Information</h3>
+6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.
+
+6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.
+
+
+<h3>7. Third Party Applications</h3>
+7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
+
+7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
+
+7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties.
+
+
+<h3>8. Using Android APIs</h3>
+8.1 Google Data APIs
+
+8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
+
+8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
+
+
+<h3>9. Terminating this License Agreement</h3>
+9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below.
+
+9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.
+
+9.3 Google may at any time, terminate this License Agreement with you if:
+(A) you have breached any provision of this License Agreement; or
+(B) Google is required to do so by law; or
+(C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or
+(D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
+
+9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
+
+
+<h3>10. DISCLAIMER OF WARRANTIES</h3>
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
+
+10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+
+
+<h3>11. LIMITATION OF LIABILITY</h3>
+11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
+
+<h3>12. Indemnification</h3>
+12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement.
+
+
+<h3>13. Changes to the License Agreement</h3>
+13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
+
+
+<h3>14. General Legal Terms</h3>
+14.1 This License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK.
+
+14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
+
+14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable.
+
+14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement.
+
+14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
+
+14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party.
+
+14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
+
+
+<em>November 13, 2012</em>
+</div><!-- thin wrapper around tos doc -->
+
+
+<div id="usb-terms-form">
+<p>
+<input id="agree" type="checkbox" name="agree" value="1" onclick="onAgreeChecked()" />
+<label id="agreeLabel" for="agree">I have read and agree with the above terms and conditions</label>
+</p>
+<p><a href="" class="button disabled" id="downloadForRealz" onclick="return onDownloadForRealz(this);"></a></p>
+</div>
+
+
+
+</div><!-- end TOS -->
+
+
+
+<div class="wrap col-13" style="margin:0" id="main">
+
+
<div id="qv-wrapper">
<div id="qv">
<h2>In this document</h2>
<ol>
- <li><a href="#notes">Revisions</a></li>
<li><a href="#WinUsbDriver">Downloading the Google USB Driver</a></li>
</ol>
<h2>See also</h2>
<ol>
<li><a href="{@docRoot}tools/extras/oem-usb.html#InstallingDriver">Installing a USB Driver</a></li>
<li><a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a></li>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a></li>
</ol>
+
+<h2>Get it</h2>
+
+<div class="download-box">
+ <a onclick="return onDownload(this)"
+ href="https://dl-ssl.google.com//android/repository/latest_usb_driver_windows.zip"
+ class="button" id="usbDriverButton">
+ Download Google USB Driver
+ </a>
+ <p class="filename">latest_usb_driver_windows.zip</p>
+</div>
+
</div>
</div>
-<p>The Google USB driver is a downloadable component for the Android SDK, available
-from the SDK Manager. The driver is for Windows only and provides the necessary drivers for the
-following devices:</p>
+<p>The Google USB Driver is for <strong>Windows only</strong> and provides the
+necessary drivers for the following devices:</p>
<ul>
<li>ADP1 / T-Mobile G1*</li>
<li>ADP2 / Google Ion / T-Mobile myTouch 3G*</li>
<li>Verizon Droid*</li>
<li>Nexus One</li>
<li>Nexus S</li>
+ <li>Nexus 4</li>
+ <li>Nexus 7</li>
+ <li>Nexus 10</li>
</ul>
<p>* <em>Or similar hardware on other carriers</em></p>
-
- <p>All other devices require Windows drivers provided by the hardware manufacturer, as listed in
-the <a href="{@docRoot}tools/extras/oem-usb.html">OEM USB Drivers</a> document. The Galaxy Nexus
-driver is also distributed by <a
+
+ <p>All other devices require Windows drivers provided by the respective hardware manufacturer,
+ as listed in the <a href="{@docRoot}tools/extras/oem-usb.html">OEM USB Drivers</a> document.</p>
+
+ <p>The Galaxy Nexus driver is distributed by <a
href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
(listed as model SCH-I515).</p>
<p class="note"><strong>Note:</strong>
-If you're developing on Mac OS X or Linux, then you do not need to install a USB driver. To start
-developing with your device, also read <a href="{@docRoot}guide/developing/device.html">Using
-Hardware Devices</a>.</p>
+If you're developing on Mac OS X or Linux, then you <strong>do not</strong> need to install a USB
+driver. To start developing with your device, read
+<a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a>.</p>
+
-<p>The sections below provide instructions on how to download and install the Google USB Driver
-for Windows. </p>
+<h2 id="WinUsbDriver">Downloading the Google USB Driver</h2>
+<p>The Google USB Driver for Windows is available for download as an optional SDK
+component. You need the driver only if you are developing on Windows and
+want to connect a Google Android-powered device (such as a Nexus 7) to your
+development environment over USB.</p>
+<div class="figure" style="width:536px;margin:0">
+ <img src="{@docRoot}images/developing/sdk-usb-driver.png" alt="" />
+ <p class="img-caption"><strong>Figure 1.</strong> The SDK Manager
+ with the Google USB Driver selected.</p>
+</div>
+<p>You can download the Google USB Driver for Windows in one of two ways:</p>
+<ul>
+ <li>
+ <a onclick="$('#usbDriverButton').trigger('click');return false;" href="#">
+ Click here to download the latest Google USB Driver ZIP file</a>.</li>
+ <li>Or, use the Android SDK Manager tool that is
+included with the <a href="{@docRoot}sdk/index.html">Android SDK</a>. Using the SDK Manager
+helps you keep the driver up to date by notifying you when your current driver is out of date.
+ <ol>
+ <li>Launch the Android SDK Manager by double-clicking <code>SDK Manager.exe</code>,
+ at the root of your SDK directory.</li>
+ <li>Expand <em>Extras</em>.</li>
+ <li>Check <strong>Google USB Driver package</strong> and click <strong>Install</strong>.</li>
+ <li>Proceed to install the package. When done, the driver files are
+ downloaded into the <code>&lt;sdk&gt;\extras\google\usb_driver\</code> directory.</li>
+ </ol>
+ </li>
+</ul>
-<h2 id="notes">Revisions</h2>
+<p>For installation information, read
+<a href="{@docRoot}tools/extras/oem-usb.html#InstallingDriver">Installing a USB Driver</a>.</p>
-<p>The sections below provide notes about successive revisions of the USB Driver
-for Windows, as denoted by revision number. To determine what revision of the
-USB Driver for Windows you are using, refer to the "Installed Packages" listing
-in the Android SDK Manager.</p>
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
-padding: .25em 1em;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<div class="toggleable opened">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px"
-width="9px" />
-USB Driver for Windows, Revision 4</a> <em>(December 2010)</em>
- <div class="toggleme">
-
-<dl>
-<dt><p>Adds support for the Nexus S.</p></dt>
-</dl>
- </div>
-</div>
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
-width="9px" />
-USB Driver for Windows, Revision 3</a> <em>(January 2010)</em>
- <div class="toggleme">
-
-<dl>
-<dt><p>Adds support for the Nexus One.</p></dt>
-</dl>
- </div>
-</div>
+</div><!-- end wrap "main" for document content -->
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-USB Driver for Windows, Revision 2</a> <em>(November 2009)</em>
- <div class="toggleme">
-
-<dl>
-<dt><p>Adds support for the Verizon Droid (or similar hardware on
-other carriers).</p></dt>
-</dl>
- </div>
-</div>
+</div><!-- end outter wrapper for page contents -->
-<div class="toggleable closed">
- <a href="#" onclick="return toggleDiv(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
-USB Driver for Windows, Revision 1</a> <em>(October 2009)</em>
- <div class="toggleme">
-
-<dl>
-<dt><p>Initial release of the WinUsb-based driver, with support
-for the T-Mobile G1 and myTouch 3G (and similar devices).</p></dt>
-</dl>
- </div>
-</div>
-<h2 id="WinUsbDriver">Downloading the Google USB Driver</h2>
-<div class="figure" style="width:536px;margin:0">
- <img src="{@docRoot}images/developing/sdk-usb-driver.png" alt="" />
- <p class="img-caption"><strong>Figure 1.</strong> The SDK Manager
- with the Google USB Driver selected.</p>
-</div>
+<script>
+
+
+ function onDownload(link) {
+
+ /* set text for download button */
+ $("#downloadForRealz").html($(link).text());
+ $("#downloadForRealz").attr('href',$(link).attr('href'));
+
+ $("#tos").fadeIn('fast');
+ $("#main").fadeOut('fast');
+
+ location.hash = "download";
+ return false;
+ }
+
+
+ function onAgreeChecked() {
+ /* verify that the TOS is agreed and a bit version is chosen */
+ if ($("input#agree").is(":checked")) {
+ /* reveal the download button */
+ $("a#downloadForRealz").removeClass('disabled');
+ } else {
+ $("a#downloadForRealz").addClass('disabled');
+ }
+ }
+
+ function onDownloadForRealz(link) {
+ if ($("input#agree").is(':checked')) {
+ // OK, start the download and reset the page
+ $("input#agree").attr('checked',false);
+ $("a#downloadForRealz").addClass('disabled');
+ $("#tos").fadeOut('fast');
+ $("#main").fadeIn('fast');
+ location.hash = "top";
+ } else {
+ // Have not agreed to tos, make the checkbox blink
+ $("label#agreeLabel").parent().stop().animate({color: "#258AAF"}, 200,
+ function() {$("label#agreeLabel").parent().stop().animate({color: "#222"}, 200)}
+ );
+ return false;
+ }
+ }
+
+ $(window).hashchange( function(){
+ if (location.hash == "") {
+ location.reload();
+ }
+ });
-<p>The USB Driver for Windows is available for download as an optional SDK
-component. You need the driver only if you are developing on Windows and
-want to connect an Android-powered device (ADP, Nexus One, or Nexus S) to your
-development environment over USB. </p>
-
-<p>To download the driver, use the Android SDK Manager tool that is
-included with the <a href="{@docRoot}sdk/index.html">Android SDK</a>:</p>
-<ol>
- <li>Launch the Android SDK Manager by double-clicking <code>SDK Manager.exe</code>,
- at the root of your SDK directory.</li>
- <li>Expand <em>Extras</em>.</li>
- <li>Check <strong>Google USB Driver package</strong> and click <strong>Install</strong>.</li>
- <li>Proceed to install the package. When done, the driver files are
-downloaded into the <code>&lt;sdk&gt;\extras\google\usb_driver\</code> directory.</li>
-</ol>
-
-<p>For installation information, read <a href="{@docRoot}tools/extras/oem-usb.html#InstallingDriver">Installing a USB Driver</a>.</p>
+</script> \ No newline at end of file
diff --git a/docs/html/tools/revisions/platforms.jd b/docs/html/tools/revisions/platforms.jd
index 31cec0edbe42..820edbd8f44a 100644
--- a/docs/html/tools/revisions/platforms.jd
+++ b/docs/html/tools/revisions/platforms.jd
@@ -29,25 +29,46 @@ release notes for each version of the platform and the subsequent revisions to t
version.</p>
<p>To determine what revision of an Android platform you have installed, refer to the
-<strong>Installed Packages</strong> listing in the Android SDK Manager.</p>
+<strong>Installed Packages</strong> listing in the Android
+<a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>.</p>
+<p class="caution"><strong>Important:</strong> To download the most recent Android
+system components from the Android SDK Manager, you must first update the SDK Tools to
+revision 22 or later and restart the SDK Manager. If you do not,
+the latest Android system components will not be available for download.</p>
+<h2 id="4.3">Android 4.3</h2>
-<h2 id="4.2">Android 4.2</h2>
+<div class="toggle-content opened">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-opened.png"
+class="toggle-content-img" alt="" />Revision 1</a> <em>(July 2013)</em>
+ </p>
-<p class="caution"><strong>Important:</strong> To download the new Android
-4.2.x system components from the Android SDK Manager, you must first update the
-SDK tools to revision 20 or later and restart the Android SDK Manager. If you do not,
-the Android 4.2 system components will not be available for download.</p>
+ <div class="toggle-content-toggleme">
-<div class="toggle-content opened">
+ <p>Initial release. The system version is 4.3.</p>
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>Android SDK Platform-tools r18 or higher is required.</dd>
+ <dd>Android SDK Tools 22.0.4 or higher is recommended.</dd>
+ </dl>
+
+ </div>
+</div>
+
+
+<h2 id="4.2">Android 4.2</h2>
+
+
+<div class="toggle-content closed">
<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
+ <img src="{@docRoot}assets/images/triangle-closed.png"
class="toggle-content-img" alt="" />Revision 2</a> <em>(February 2013)</em>
</p>
@@ -150,12 +171,6 @@ Devices in the <a href="{@docRoot}tools/help/avd-manager.html">AVD Manager</a>:<
<h2 id="4.1">Android 4.1</h2>
-<p class="caution"><strong>Important:</strong> To download the new Android
-4.1.x system components from the Android SDK Manager, you must first update the
-SDK tools to revision 20 or later and restart the Android SDK Manager. If you do not,
-the Android 4.1 system components will not be available for download.</p>
-
-
<div class="toggle-content closed">
<p><a href="#" onclick="return toggleContent(this)">
@@ -269,11 +284,6 @@ emulator configuration.</p>
<h2 id="4.0.3">Android 4.0.3</h2>
-<p class="caution"><strong>Important:</strong> To download the new Android
-4.0.x system components from the Android SDK Manager, you must first update the
-SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
-the Android 4.0.x system components will not be available for download.</p>
-
<div class="toggle-content closed">
<p><a href="#" onclick="return toggleContent(this)">
@@ -711,13 +721,6 @@ ADT 12.</p>
<h2 id="2.3.4">Android 2.3.4</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android 2.3.4 platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-2.3.4 platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
<div class="toggle-content closed" >
<p><a href="#" onclick="return toggleContent(this)">
@@ -865,14 +868,6 @@ emulator skins are:</p>
<h2 id="2.3">Android 2.3</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android 2.3 platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-2.3 platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-
<div class="toggle-content closed" >
<p><a href="#" onclick="return toggleContent(this)">
@@ -1033,4 +1028,4 @@ emulator skins are:</p>
<li>
WVGA854 (480x854 high density, normal screen)
</li>
-</ul> \ No newline at end of file
+</ul>
diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd
index 52647ff6308c..7b0b5a8f0eab 100644
--- a/docs/html/tools/sdk/eclipse-adt.jd
+++ b/docs/html/tools/sdk/eclipse-adt.jd
@@ -53,9 +53,46 @@ the ADT Plugin, as denoted by revision number. </p>
<p>For a summary of all known issues in ADT, see <a
href="http://tools.android.com/knownissues">http://tools.android.com/knownissues</a>.</p>
+
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+ alt=""/>ADT 22.0.4</a> <em>(July 2013)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+<dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Java 1.6 or higher is required for ADT 22.0.4.</li>
+ <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 22.0.4.</li>
+ <li>ADT 22.0.4 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK
+ Tools r22.0.4</a>. If you haven't already installed SDK Tools r22.0.4 into your SDK, use the
+ Android SDK Manager to do so.</li>
+ </ul>
+ </dd>
+
+ <dt>General Notes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed problem with compiling Renderscript code.</li>
+ <li>Improved Gradle export with better workflow and error reporting.</li>
+ <li>Improved Gradle multi-module export feature.</li>
+ <li>Updated build logic to force exporting of the classpath containers unless you are using
+ the Maven plugin.</li>
+ </ul>
+ </dd>
+
+</dl>
+</div>
+</div>
+
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
alt=""/>ADT 22.0.1</a> <em>(May 2013)</em>
</p>
diff --git a/docs/html/tools/sdk/ndk/index.jd b/docs/html/tools/sdk/ndk/index.jd
index 74caaf4ede69..1f34987e5aa0 100644
--- a/docs/html/tools/sdk/ndk/index.jd
+++ b/docs/html/tools/sdk/ndk/index.jd
@@ -1,29 +1,29 @@
ndk=true
page.template=sdk
-ndk.mac64_download=android-ndk-r8e-darwin-x86_64.tar.bz2
-ndk.mac64_bytes=508419298
-ndk.mac64_checksum=efac96fab20e6ddb1311d6ba5648ce72
+ndk.mac64_download=android-ndk-r9-darwin-x86_64.tar.bz2
+ndk.mac64_bytes=726430529
+ndk.mac64_checksum=b975271d8f064611e7e12bf87b736826
-ndk.mac32_download=android-ndk-r8e-darwin-x86.tar.bz2
-ndk.mac32_bytes=496238878
-ndk.mac32_checksum=e17e707464c45c0d5615e4d0ae6a5cf7
+ndk.mac32_download=android-ndk-r9-darwin-x86.tar.bz2
+ndk.mac32_bytes=710781553
+ndk.mac32_checksum=6f7c4dd38df9079bb4b13846add5c0da
-ndk.linux64_download=android-ndk-r8e-linux-x86_64.tar.bz2
-ndk.linux64_bytes=466853553
-ndk.linux64_checksum=fa812352956067e7a9eefc0274675e9a
+ndk.linux64_download=android-ndk-r9-linux-x86_64.tar.bz2
+ndk.linux64_bytes=669064468
+ndk.linux64_checksum=3eedc86b20ec09fcd1fd03f4481a706d
-ndk.linux32_download=android-ndk-r8e-linux-x86.tar.bz2
-ndk.linux32_bytes=461526099
-ndk.linux32_checksum=26d774b0884bcd98de08eb4de41ab532
+ndk.linux32_download=android-ndk-r9-linux-x86.tar.bz2
+ndk.linux32_bytes=660787157
+ndk.linux32_checksum=999d155ba772c49baacee6d41d664922
-ndk.win64_download=android-ndk-r8e-windows-x86_64.zip
-ndk.win64_bytes=461298980
-ndk.win64_checksum=11eb99b3b56fc86d9d231ebff5c41db3
+ndk.win64_download=android-ndk-r9-windows-x86_64.zip
+ndk.win64_bytes=826661995
+ndk.win64_checksum=cd56cc1036235f16369f2112fa27be91
-ndk.win32_download=android-ndk-r8e-windows-x86.zip
-ndk.win32_bytes=434701805
-ndk.win32_checksum=fb41ed2bff5610b14a7b6f085ab86213
+ndk.win32_download=android-ndk-r9-windows-x86.zip
+ndk.win32_bytes=777938252
+ndk.win32_checksum=9c1f66ff963cc61e338964c5f97a4d34
page.title=Android NDK
@jd:body
@@ -255,13 +255,286 @@ $('#Downloads').after($('#download-table'));
<h2 id="Revisions">Revisions</h2>
-<p>The sections below provide information and notes about successive releases of
-the NDK, as denoted by revision number. </p>
-
+<p>The following sections provide information about releases of the NDK.</p>
<div class="toggle-content opened">
+ <p>
+ <a href="#" onclick="return toggleContent(this)"> <img
+ src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" alt=""
+ >Android NDK, Revision 9</a> <em>(July 2013)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+ <dl>
+ <dt>Important changes:</dt>
+ <dd>
+ <ul>
+ <li>Added support for Android 4.3 (API level 18). For more information, see
+ {@code STABLE-APIS.html} and new code examples in {@code samples/gles3jni/README}.
+ <li>Added headers and libraries for OpenGL ES 3.0, which is supported by Android 4.3
+ (API level 18) and higher.</li>
+ <li>Added GNU Compiler Collection (GCC) 4.8 compiler to the NDK. Since GCC 4.6 is still
+ the default, you must explicitly enable this option:
+ <ul>
+ <li>For {@code ndk-build} builds, export {@code NDK_TOOLCHAIN_VERSION=4.8} or
+ add it in {@code Application.mk}.</li>
+ <li>For standalone builds, use the {@code --toolchain=} option in
+ {@code make-standalone-toolchain.sh}, for example:<br>
+ {@code --toolchain=arm-linux-androideabi-4.8}</li>
+ </ul>
+ <p class="note"><strong>Note:</strong>
+ The {@code -Wunused-local-typedefs} option is enabled by {@code -Wall}. Be
+ sure to add {@code __attribute__((unused))} if you use compile-time asserts like
+ {@code sources/cxx-stl/stlport/stlport/stl/config/features.h}, line #311. For more
+ information, see
+ <a href="https://android-review.googlesource.com/#/c/55460">Change 55460</a></p>
+ <p class="note"><strong>Note:</strong>
+ In the GCC 4.7 release and later, ARM compilers generate unaligned access code by
+ default for ARMv6 and higher build targets. You may need to add the
+ {@code -mno-unaligned-access} build option when building for kernels that do not support
+ this feature.</p>
+ </li>
+ <li>Added Clang 3.3 support. The {@code NDK_TOOLCHAIN_VERSION=clang} build option
+ now picks Clang 3.3 by default.
+ <p class="note"><strong>Note:</strong>
+ Both GCC 4.4.3 and Clang 3.1 are deprecated, and will be removed from the next NDK
+ release.</p></li>
+ <li>Updated GNU Project Debugger (GDB) to support python 2.7.5.</li>
+ <li>Added MCLinker to support Windows hosts. Since {@code ld.gold}
+ is the default where available, you must add {@code -fuse-ld=mcld} in
+ {@code LOCAL_LDFLAGS} or {@code APP_LDFLAGS} to enable MCLinker.</li>
+ <li>Added {@code ndk-depends} tool which prints ELF library dependencies.
+ For more information, see {@code NDK-DEPENDS.html}.
+ (<a href="http://b.android.com/53486">Issue 53486</a>)</li>
+ </ul>
+ </dd>
+
+ <dt>Important bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed potential event handling issue in {@code android_native_app_glue}.
+ (<a href="http://b.android.com/41755">Issue 41755</a>)</li>
+ <li>Fixed ARM/GCC-4.7 build to generate sufficient alignment for NEON load and store
+ instructions VST and VLD.
+ (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57271">GCC Issue 57271</a>)</li>
+ <li>Fixed a GCC 4.4.3/4.6/4.7 internal compiler error (ICE) for a constant negative index
+ value on a string literal.
+ (<a href="http://b.android.com/54623">Issue 54623</a>)</li>
+ <li>Fixed GCC 4.7 segmentation fault for constant initialization with an object address.
+ (<a href="http://b.android.com/56508">Issue 56508</a>)</li>
+ <li>Fixed GCC 4.6 ARM segmentation fault for <code>-O</code> values when using Boost
+ 1.52.0. (<a href="http://b.android.com/42891">Issue 42891</a>)
+ <li>Fixed {@code libc.so} and {@code libc.a} to support the {@code wait4()} function.
+ (<a href="http://b.android.com/19854">Issue 19854</a>)</li>
+ <li>Updated the x86 libc.so and libc.a files to include the {@code clone()}
+ function.</li>
+ <li>Fixed {@code LOCAL_SHORT_COMMANDS} bug where the {@code linker.list} file is
+ empty or not used.</li>
+ <li>Fixed GCC MIPS build on Mac OS to use CFI directives, without which
+ {@code ld.mcld --eh-frame-hdr} fails frequently.</li>
+ <li>Fixed Clang 3.2 X86/MIPS internal compiler error in {@code llvm/lib/VMCore/Value.cpp}.
+ (<a href="https://android-review.googlesource.com/#/c/59021">Change 59021</a>)</li>
+ <li>Fixed GCC 4.7 64-bit Windows assembler crash. (Error: {@code out of memory allocating
+ 4294967280 bytes}).</li>
+ <li>Updated {@code ndk-gdb} script so that the {@code --start} or {@code --launch} actions
+ now wait for the GNU Debug Server, so that it can more reliably hit breakpoints set
+ early in the execution path (such as breakpoints in JNI code).
+ (<a href="http://b.android.com/41278">Issue 41278</a>)
+ <p class="note"><strong>Note:</strong>
+ This feature requires jdb and produces warning about pending breakpoints.
+ Specify the {@code --nowait} option to restore previous behavior.
+ </p>
+ </li>
+ <li>Fixed GDB crash when library list is empty.</li>
+ <li>Fixed GDB crash when using a {@code stepi} command past a {@code bx pc} or
+ {@code blx pc} Thumb instruction.
+ (<a href="http://b.android.com/56962">Issue 56962</a>,
+ <a href="http://b.android.com/36149">Issue 36149</a>)</li>
+ <li>Fixed MIPS {@code gdbserver} to look for {@code DT_MIPS_RLD_MAP} instead of
+ {@code DT_DEBUG}. (<a href="http://b.android.com/56586">Issue 56586</a>)</li>
+ <li>Fixed a circular dependency in the ndk-build script, for example: If A-&gt;B and
+ B-&gt;B, then B was dropped from build.
+ (<a href="http://b.android.com/56690">Issue 56690</a>)</li>
+ </ul>
+ </dd>
+
+ <dt>Other bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed the {@code ndk-build} script to enable you to specify a version of Clang as a
+ command line option (e.g., {@code NDK_TOOLCHAIN_VERSION=clang3.2}). Previously, only
+ specifying the version as an environment variable worked.</li>
+ <li>Fixed gabi++ size of {@code _Unwind_Exception} to be 24 for MIPS build targets when
+ using the Clang compiler.
+ (<a href="https://android-review.googlesource.com/#/c/54141">Change 54141</a>)</li>
+ <li>Fixed the {@code ndk-build} script to ensure that built libraries are actually
+ removed from projects that include prebuilt static libraries when using the
+ {@code ndk-build clean} command.
+ (<a href="https://android-review.googlesource.com/#/c/54461">Change 54461</a>,
+ <a href="https://android-review.googlesource.com/#/c/54480">Change 54480</a>)</li>
+ <li>Modified the {@code NDK_ANALYZE=1} option to be less verbose.</li>
+ <li>Fixed {@code gnu-libstdc++/Android.mk} to include a {@code backward/} path for builds
+ that use backward compability.
+ (<a href="http://b.android.com/53404">Issue 53404</a>)</li>
+ <li>Fixed a problem where {@code stlport new} sometimes returned random values.</li>
+ <li>Fixed {@code ndk-gdb} to match the order of {@code CPU_ABIS}, not {@code APP_ABIS}.
+ (<a href="http://b.android.com/54033">Issue 54033</a>)</li>
+ <li>Fixed a problem where the NDK 64-bit build on MacOSX choses the wrong path for
+ compiler.
+ (<a href="http://b.android.com/53769">Issue 53769</a>)</li>
+ <li>Fixed build scripts to detect 64-bit Windows Vista.
+ (<a href="http://b.android.com/54485">Issue 54485</a>)</li>
+ <li>Fixed x86 {@code ntonl/swap32} error: {@code invalid 'asm': operand number
+ out of range}.
+ (<a href="http://b.android.com/54465">Issue 54465</a>,
+ <a href="https://android-review.googlesource.com/#/c/57242">Change 57242</a>)</li>
+ <li>Fixed {@code ld.gold} to merge string literals.</li>
+ <li>Fixed {@code ld.gold} to handle large symbol alignment.</li>
+ <li>Updated {@code ld.gold} to enable the {@code --sort-section=name} option.</li>
+ <li>Fixed GCC 4.4.3/4.6/4.7 to suppress the {@code -export-dynamic} option for
+ statically linked programs. GCC no longer adds an {@code .interp} section for statically
+ linked programs.</li>
+ <li>Fixed GCC 4.4.3 {@code stlport} compilation error about inconsistent {@code typedef}
+ of {@code _Unwind_Control_Block}.
+ (<a href="http://b.android.com/54426">Issue 54426</a>)</li>
+ <li>Fixed {@code awk} scripts to handle {@code AndroidManifest.xml} files created on
+ Windows which may contain trailing {@code \r} characters and cause build errors.
+ (<a href="http://b.android.com/42548">Issue 42548</a>)</li>
+ <li>Fixed {@code make-standalone-toolchain.sh} to probe the {@code prebuilts/}
+ directory to detect if the host is 32 bit or 64 bit.</li>
+ <li>Fixed the Clang 3.2 {@code -integrated-as} option.</li>
+ <li>Fixed the Clang 3.2 ARM EHABI compact model {@code pr1} and {@code pr2} handler data.
+ </li>
+ <li>Added clang {@code -mllvm -arm-enable-ehabi} option to fix the following clang error:
+ <pre>clang: for the -arm-enable-ehabi option: may only occur zero or one times!</pre>
+ </li>
+ <li>Fixed build failure when there is no {@code uses-sdk} element in application
+ manifest. (<a href="http://b.android.com/57015">Issue 57015</a>)</li>
+ </ul>
+
+ </dd>
+ <dt>Other changes:</dt>
+ <dd>
+ <ul>
+ <li>Header Fixes
+ <ul>
+ <li>Modified headers to make {@code __set_errno} an inlined function, since
+ {@code __set_errno} in {@code errno.h} is deprecated, and {@code libc.so} no longer
+ exports it.</li>
+ <li>Modified {@code elf.h} to include {@code stdint.h}.
+ (<a href="http://b.android.com/55443">Issue 55443</a>)</li>
+ <li>Fixed {@code sys/un.h} to be included independently of other headers.
+ (<a href="http://b.android.com/53646">Issue 53646</a>)</li>
+ <li>Fixed all of the {@code MotionEvent_getHistorical} API family to take the
+ {@code const AInputEvent* motion_event}.
+ (<a href="http://b.android.com/55873">Issue 55873</a>)</li>
+ <li>Fixed {@code malloc_usable_size} to take {@code const void*}.
+ (<a href="http://b.android.com/55725">Issue 55725</a>)</li>
+ <li>Fixed stdint.h to be more compatible with C99.
+ (<a href="https://android-review.googlesource.com/#/c/46821">Change 46821</a>)</li>
+ <li>Modified {@code wchar.h} to not redefine {@code WCHAR_MAX} and
+ {@code WCHAR_MIN}</li>
+ <li>Fixed {@code &lt;inttypes.h&gt;} declaration for pointer-related {@code PRI} and
+ {@code SCN} macros. (<a href="http://b.android.com/57218">Issue 57218</a>)</li>
+ <li>Changed the {@code sys/cdefs.h} header so that {@code __WCHAR_TYPE__} is 32-bit
+ for API levels less than 9, which means that {@code wchat_t} is 32-bit for all
+ API levels. To restore the previous behavior, define the {@code _WCHAR_IS_8BIT}
+ boolean variable. (<a href="http://b.android.com/57267">Issue 57267</a>)</li>
+ </ul>
+ </li>
+ <li>Added more formatting in NDK {@code docs/} and miscellaneous documentation fixes.
+ </li>
+ <li>Added support for a thin archive technique when building static libraries.
+ (<a href="http://b.android.com/40303">Issue 40303</a>)</li>
+ <li>Updated script {@code make-standalone-toolchain.sh} to support the {@code stlport}
+ library in addition to {@code gnustl}, when you specify the option
+ {@code --stl=stlport}. For more information, see {@code STANDALONE-TOOLCHAIN.html}.</li>
+ <li>Updated the {@code make-standalone-toolchain.sh} script so that the
+ {@code --llvm-version=} option creates the {@code $TOOLCHAIN_PREFIX-clang} and
+ {@code $TOOLCHAIN_PREFIX-clang++} scripts in addition to {@code clang} and
+ {@code clang++}, to avoid using the host's clang and clang++ definitions by accident.
+ </li>
+ <li>Added two flags to re-enable two optimizations in upstream Clang but disabled in
+ NDK for better compatibility with code compiled by GCC:
+ <ul>
+ <li>Added a {@code -fcxx-missing-return-semantics} flag to re-enable <em>missing return
+ semantics</em> in Clang 3.2+. Normally, all paths should terminate with a return
+ statement for a value-returning function. If this is not the case, clang inserts
+ an undefined instruction (or trap in debug mode) at the path without a return
+ statement. If you are sure your code is correct, use this flag to allow the
+ optimizer to take advantage of the undefined behavior. If you are not sure, do not
+ use this flag. The caller may still receive a random incorrect value, but the
+ optimizer will not exploit it and make your code harder to debug.</li>
+ <li>Added a {@code -fglobal-ctor-const-promotion} flag to re-enable
+ promoting global variables with static constructor to be constants. With this flag,
+ the global variable optimization pass of LLVM tries to evaluate the global
+ variables with static constructors and promote them to global constants. Although
+ this optimization is correct, it may cause some incompatability with code compiled
+ by GCC. For example, code may do {@code const_cast} to cast the constant to mutable
+ and modify it. In GCC, the variable is in read-write and the code is run by
+ accident. In Clang, the const variable is in read-only memory and may cause your
+ application to crash.</li>
+ </ul>
+ </li>
+ <li>Added {@code -mldc1-sdc1} to the MIPS GCC and Clang compilers. By default, compilers
+ align 8-byte objects properly and emit the {@code ldc1} and {@code sdc1} instructions
+ to move them around. If your app uses a custom allocator that does not always align
+ with a new object's 8-byte boundary in the same way as the default allocator, your app
+ may crash due to {@code ldc1} and {@code sdc1} operations on unaligned memory. In this
+ case, use the {@code -mno-ldc1-sdc1} flag to workaround the problem.</li>
+ <li>Downgraded the event severity from warning to info if {@code APP_PLATFORM_LEVEL} is
+ larger than {@code APP_MIN_PLATFORM_LEVEL}. The {@code APP_PLATFORM_LEVEL} may be lower
+ than {@code APP_PLATFORM} in {@code jni/Application.mk} because the NDK does not have
+ headers for all levels. In this case, the actual level is shifted downwards. The
+ {@code APP_MIN_PLATFORM_LEVEL} is specified by the {@code android:minSdkVersion} in
+ your application's manifest.
+ (<a href="http://b.android.com/39752">Issue 39752</a>)</li>
+ <li>Added the {@code android_getCpuIdArm()} and {@code android_setCpuArm()} methods to
+ {@code cpu-features.c}. This addition enables easier retrieval of the ARM CPUID
+ information. (<a href="http://b.android.com/53689">Issue 53689</a>)</li>
+ <li>Modified {@code ndk-build} to use GCC 4.7's {@code as/ld} for Clang compiling.
+ <p class="note"><strong>Note:</strong>
+ In GCC 4.7, {@code monotonic_clock} and {@code is_monotonic} have been renamed to
+ {@code steady_clock} and {@code is_steady}, respectively.</p></li>
+ <li>Added the following new warnings to the {@code ndk-build} script:
+ <ul>
+ <li>Added warnings if {@code LOCAL_LDLIBS/LDFLAGS} are used in static library
+ modules.</li>
+ <li>Added a warning if a configuration has no module to build.</li>
+ <li>Added a warning for non-system libraries being used in
+ {@code LOCAL_LDLIBS/LDFLAGS} of a shared library or executable modules.</li>
+ </ul>
+ </li>
+ <li>Updated build scripts, so that if {@code APP_MODULES} is not defined and only static
+ libraries are listed in {@code Android.mk}, the script force-builds all of them.
+ (<a href="http://b.android.com/53502">Issue 53502</a>)</li>
+ <li>Updated {@code ndk-build} to support absolute paths in {@code LOCAL_SRC_FILES}.</li>
+ <li>Removed the {@code *-gdbtui} executables, which are duplicates of the {@code *-gdb}
+ executables with the {@code -tui} option enabled.</li>
+ <li>Updated the build scripts to warn you when the Edison Design Group (EDG) compiler
+ front-end turns {@code _STLP_HAS_INCLUDE_NEXT} back on.
+ (<a href="http://b.android.com/53646">Issue 53646</a>)</li>
+ <li>Added the environment variable {@code NDK_LIBS_OUT} to allow overriding of the
+ path for {@code libraries/gdbserver} from the default {@code $PROJECT/libs}.
+ For more information, see {@code OVERVIEW.html}.</li>
+ <li>Changed ndk-build script defaults to compile code with format string protection
+ {@code -Wformat -Werror=format-security}. You may set
+ {@code LOCAL_DISABLE_FORMAT_STRING_CHECKS=true} to disable it.
+ For more information, see {@code ANDROID-MK.html}</li>
+ <li>Added STL pretty-print support in {@code ndk-gdb-py}. For more information, see
+ {@code NDK-GDB.html}.</li>
+ <li>Added tests based on the googletest frameworks.</li>
+ <li>Added a notification to the toolchain build script that warns you if the current shell
+ is not {@code bash}.</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+</div>
+
+
+<div class="toggle-content closed">
<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
alt="">Android NDK, Revision 8e</a> <em>(March 2013)</em>
</p>
@@ -283,7 +556,7 @@ the NDK, as denoted by revision number. </p>
build automatically sorts out the order of libraries specified in
{@code LOCAL_STATIC_LIBRARIES}, {@code LOCAL_WHOLE_STATIC_LIBRARIES} and
{@code LOCAL_SHARED_LIBRARIES}. For more information, see {@code CHANGES.HTML}.
- (<a href="http://code.google.com/p/android/issues/detail?id=39378">Issue 39378</a>)</li>
+ (<a href="http://b.android.com/39378">Issue 39378</a>)</li>
</ul>
</dd>
@@ -295,23 +568,23 @@ the NDK, as denoted by revision number. </p>
<li>Fixed build script which unconditionally builds Clang/llvm for MacOSX in 64-bit.</li>
<li>Fixed GCC 4.6/4.7 internal compiler error:
{@code gen_thumb_movhi_clobber at config/arm/arm.md:5832}.
- (<a href="http://code.google.com/p/android/issues/detail?id=52732">Issue 52732</a>)</li>
+ (<a href="http://b.android.com/52732">Issue 52732</a>)</li>
<li>Fixed build problem where GCC/ARM 4.6/4.7 fails to link code using 64-bit atomic
built-in functions.
- (<a href="http://code.google.com/p/android/issues/detail?id=41297">Issue 41297</a>)</li>
+ (<a href="http://b.android.com/41297">Issue 41297</a>)</li>
<li>Fixed GCC 4.7 linker DIV usage mismatch errors.
(<a href="http://sourceware.org/ml/binutils/2012-12/msg00202.html">Sourceware Issue</a>)
<li>Fixed GCC 4.7 internal compiler error {@code build_data_member_initialization, at
cp/semantics.c:5790}.</li>
<li>Fixed GCC 4.7 internal compiler error {@code redirect_eh_edge_1, at tree-eh.c:2214}.
- (<a href="http://code.google.com/p/android/issues/detail?id=52909">Issue 52909</a>)</li>
+ (<a href="http://b.android.com/52909">Issue 52909</a>)</li>
<li>Fixed a GCC 4.7 segfault.
(<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55245">GCC Issue</a>)</li>
<li>Fixed {@code &lt;chrono&gt;} clock resolution and enabled {@code steady_clock}.
- (<a href="http://code.google.com/p/android/issues/detail?id=39680">Issue 39680</a>)</li>
+ (<a href="http://b.android.com/39680">Issue 39680</a>)</li>
<li>Fixed toolchain to enable {@code _GLIBCXX_HAS_GTHREADS} for GCC 4.7 libstdc++.
- (<a href="http://code.google.com/p/android/issues/detail?id=41770">Issue 41770</a>,
- <a href="http://code.google.com/p/android/issues/detail?id=41859">Issue 41859</a>)</li>
+ (<a href="http://b.android.com/41770">Issue 41770</a>,
+ <a href="http://b.android.com/41859">Issue 41859</a>)</li>
<li>Fixed problem with the X86 MXX/SSE code failing to link due to missing
{@code posix_memalign}.
(<a href="https://android-review.googlesource.com/#/c/51872">Change 51872</a>)</li>
@@ -321,24 +594,24 @@ the NDK, as denoted by revision number. </p>
<li>Fixed GCC4.7/X86 to restore earlier {@code cmov} behavior.
(<a href="http://gcc.gnu.org/viewcvs?view=revision&revision=193554">GCC Issue</a>)</li>
<li>Fixed handling NULL return value of {@code setlocale()} in libstdc++/GCC4.7.
- (<a href="http://code.google.com/p/android/issues/detail?id=46718">Issue 46718</a>)
+ (<a href="http://b.android.com/46718">Issue 46718</a>)
<li>Fixed {@code ld.gold} runtime undefined reference to {@code __exidx_start} and
{@code __exidx_start_end}.
(<a href="https://android-review.googlesource.com/#/c/52134">Change 52134</a>)</li>
<li>Fixed Clang 3.1 internal compiler error when using Eigen library.
- (<a href="http://code.google.com/p/android/issues/detail?id=41246">Issue 41246</a>)</li>
+ (<a href="http://b.android.com/41246">Issue 41246</a>)</li>
<li>Fixed Clang 3.1 internal compiler error including {@code &lt;chrono&gt;} in C++11 mode.
- (<a href="http://code.google.com/p/android/issues/detail?id=39600">Issue 39600</a>)</li>
+ (<a href="http://b.android.com/39600">Issue 39600</a>)</li>
<li>Fixed Clang 3.1 internal compiler error when generating object code for a method
call to a uniform initialized {@code rvalue}.
- (<a href="http://code.google.com/p/android/issues/detail?id=41387">Issue 41387</a>)</li>
+ (<a href="http://b.android.com/41387">Issue 41387</a>)</li>
<li>Fixed Clang 3.1/X86 stack realignment.
(<a href="https://android-review.googlesource.com/#/c/52154">Change 52154</a>)</li>
<li>Fixed problem with GNU Debugger (GDB) SIGILL when debugging on Android 4.1.2.
- (<a href="http://code.google.com/p/android/issues/detail?id=40941">Issue 40941</a>)</li>
+ (<a href="http://b.android.com/40941">Issue 40941</a>)</li>
<li>Fixed problem where GDB cannot set {@code source:line} breakpoints when symbols contain
long, indirect file paths.
- (<a href="http://code.google.com/p/android/issues/detail?id=42448">Issue 42448</a>)</li>
+ (<a href="http://b.android.com/42448">Issue 42448</a>)</li>
<li>Fixed GDB {@code read_program_header} for MIPS PIE executables.
(<a href="https://android-review.googlesource.com/#/c/49592">Change 49592</a>)</li>
<li>Fixed {@code STLport} segmentation fault in {@code uncaught_exception()}.
@@ -346,7 +619,7 @@ the NDK, as denoted by revision number. </p>
<li>Fixed {@code STLport} bus error in exception handling due to unaligned access of
{@code DW_EH_PE_udata2}, {@code DW_EH_PE_udata4}, and {@code DW_EH_PE_udata8}.</li>
<li>Fixed Gabi++ infinite recursion problem with {@code nothrow new[]} operator.
- (<a href="http://code.google.com/p/android/issues/detail?id=52833">Issue 52833</a>)</li>
+ (<a href="http://b.android.com/52833">Issue 52833</a>)</li>
<li>Fixed Gabi++ wrong offset to exception handler pointer.
(<a href="https://android-review.googlesource.com/#/c/53446">Change 53446</a>)</li>
<li>Removed Gabi++ redundant free on exception object
@@ -365,11 +638,11 @@ the NDK, as denoted by revision number. </p>
<li>Fixed {@code stddef.h} to not redefine {@code offsetof} since it already exists
in the toolchain.</li>
<li>Fixed {@code elf.h} to contain {@code Elf32_auxv_t} and {@code Elf64_auxv_t}.
- (<a href="http://code.google.com/p/android/issues/detail?id=38441">Issue 38441</a>)
+ (<a href="http://b.android.com/38441">Issue 38441</a>)
</li>
<li>Fixed the {@code #ifdef} C++ definitions in the
{@code OpenSLES_AndroidConfiguration.h} header file.
- (<a href="http://code.google.com/p/android/issues/detail?id=53163">Issue 53163</a>)
+ (<a href="http://b.android.com/53163">Issue 53163</a>)
</li>
</ul>
</li>
@@ -377,7 +650,7 @@ the NDK, as denoted by revision number. </p>
</li>
<li>Fixed system and Gabi++ headers to be able to compile with API level 8 and lower.</li>
<li>Fixed {@code cpufeatures} to not parse {@code /proc/self/auxv}.
- (<a href="http://code.google.com/p/android/issues/detail?id=43055">Issue 43055</a>)</li>
+ (<a href="http://b.android.com/43055">Issue 43055</a>)</li>
<li>Fixed {@code ld.gold} to not depend on host libstdc++ and on Windows platforms,
to not depend on the {@code libgcc_sjlj_1.dll} library.</li>
<li>Fixed Clang 3.1 which emits inconsistent register list in {@code .vsave} and fails
@@ -394,16 +667,16 @@ the NDK, as denoted by revision number. </p>
</li>
<li>Fixed X86 {@code libc.so} and {@code lib.a} which were missing the {@code sigsetjmp}
and {@code siglongjmp} functions already declared in {@code setjmp.h}.
- (<a href="http://code.google.com/p/android/issues/detail?id=19851">Issue 19851</a>)</li>
+ (<a href="http://b.android.com/19851">Issue 19851</a>)</li>
<li>Patched GCC 4.4.3/4.6/4.7 libstdc++ to work with Clang in C++ 11.
(<a href="http://clang.llvm.org/cxx_status.html">Clang Issue</a>)</li>
<li>Fixed cygwin path in argument passed to {@code HOST_AWK}.</li>
<li>Fixed {@code ndk-build} script warning in windows when running from project's JNI
directory.
- (<a href="http://code.google.com/p/android/issues/detail?id=40192">Issue 40192</a>)</li>
+ (<a href="http://b.android.com/40192">Issue 40192</a>)</li>
<li>Fixed problem where the {@code ndk-build} script does not build if makefile has
trailing whitespace in the {@code LOCAL_PATH} definition.
- (<a href="http://code.google.com/p/android/issues/detail?id=42841">Issue 42841</a>)</li>
+ (<a href="http://b.android.com/42841">Issue 42841</a>)</li>
</ul>
</dd>
@@ -419,13 +692,13 @@ the NDK, as denoted by revision number. </p>
hidden visibility except for exception handling helpers.</li>
<li>Updated build so that {@code STLport} is built for ARM in Thumb mode.</li>
<li>Added support for {@code std::set_new_handler} in Gabi++.
- (<a href="http://code.google.com/p/android/issues/detail?id=52805">Issue 52805</a>)</li>
+ (<a href="http://b.android.com/52805">Issue 52805</a>)</li>
<li>Enabled {@code FUTEX} system call in GNU libstdc++.</li>
<li>Updated {@code ndk-build} so that it no longer copies prebuilt static library to
a project's {@code obj/local/&lt;abi&gt;/} directory.
- (<a href="http://code.google.com/p/android/issues/detail?id=40302">Issue 40302</a>)</li>
+ (<a href="http://b.android.com/40302">Issue 40302</a>)</li>
<li>Removed {@code __ARM_ARCH_5*__} from ARM {@code toolchains/*/setup.mk} script.
- (<a href="http://code.google.com/p/android/issues/detail?id=21132">Issue 21132</a>)</li>
+ (<a href="http://b.android.com/21132">Issue 21132</a>)</li>
<li>Built additional GNU libstdc++ libraries in thumb for ARM.</li>
<li>Enabled MIPS floating-point {@code madd/msub/nmadd/nmsub/recip/rsqrt}
instructions with 32-bit FPU.</li>
@@ -458,7 +731,7 @@ the NDK, as denoted by revision number. </p>
which was preventing a significant amount of parallel build processing.</li>
<li>Updated {@code build-gabi++.sh} and {@code build-stlport.sh} so they can now run
from the NDK package.
- (<a href="http://code.google.com/p/android/issues/detail?id=52835">Issue 52835</a>)
+ (<a href="http://b.android.com/52835">Issue 52835</a>)
</li>
<li>Fixed {@code run-tests.sh} in the {@code MSys} utilities collection.</li>
<li>Improved 64-bit host toolchain and Canadian Cross build support.</li>
@@ -540,7 +813,7 @@ the NDK, as denoted by revision number. </p>
<dd>
<ul>
<li>Fixed unnecessary rebuild of object files when using the {@code ndk-build} script.
- (<a href="http://code.google.com/p/android/issues/detail?id=39810">Issue 39810</a>)</li>
+ (<a href="http://b.android.com/39810">Issue 39810</a>)</li>
<li>Fixed a linker failure with the NDK 8c release for Mac OS X 10.6.x that produced the
following error:
<pre>
@@ -551,29 +824,29 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
not compatible with Mac OS 10.6.x and the NDK.
</li>
<li>Removed the {@code -x c++} options from the Clang++ standalone build script.
- (<a href="http://code.google.com/p/android/issues/detail?id=39089">Issue 39089</a>)</li>
+ (<a href="http://b.android.com/39089">Issue 39089</a>)</li>
<li>Fixed issues using the {@code NDK_TOOLCHAIN_VERSION=clang3.1} option in Cygwin.
- (<a href="http://code.google.com/p/android/issues/detail?id=39585">Issue 39585</a>)</li>
+ (<a href="http://b.android.com/39585">Issue 39585</a>)</li>
<li>Fixed the {@code make-standalone-toolchain.sh} script to allow generation of a
standalone toolchain using the Cygwin or MinGW environments. The resulting toolchain
can be used in Cygwin, MingGW or CMD.exe environments.
- (<a href="http://code.google.com/p/android/issues/detail?id=39915">Issue 39915</a>,
- <a href="http://code.google.com/p/android/issues/detail?id=39585">Issue 39585</a>)</li>
+ (<a href="http://b.android.com/39915">Issue 39915</a>,
+ <a href="http://b.android.com/39585">Issue 39585</a>)</li>
<li>Added missing {@code SL_IID_ANDROIDBUFFERQUEUESOURCE} option in android-14 builds for
ARM and X86.
- (<a href="http://code.google.com/p/android/issues/detail?id=40625">Issue 40625</a>)</li>
+ (<a href="http://b.android.com/40625">Issue 40625</a>)</li>
<li>Fixed x86 CPU detection for the {@code ANDROID_CPU_X86_FEATURE_MOVBE} feature.
- (<a href="http://code.google.com/p/android/issues/detail?id=39317">Issue 39317</a>)</li>
+ (<a href="http://b.android.com/39317">Issue 39317</a>)</li>
<li>Fixed an issue preventing the Standard Template Library (STL) from using C++
sources that do not have a {@code .cpp} file extension.</li>
<li>Fixed GCC 4.6 ARM internal compiler error <em>at reload1.c:1061</em>.
- (<a href="http://code.google.com/p/android/issues/detail?id=20862">Issue 20862</a>)</li>
+ (<a href="http://b.android.com/20862">Issue 20862</a>)</li>
<li>Fixed GCC 4.4.3 ARM internal compiler error <em>at emit-rtl.c:1954</em>.
- (<a href="http://code.google.com/p/android/issues/detail?id=22336">Issue 22336</a>)</li>
+ (<a href="http://b.android.com/22336">Issue 22336</a>)</li>
<li>Fixed GCC 4.4.3 ARM internal compiler error <em>at postreload.c:396</em>.
- (<a href="http://code.google.com/p/android/issues/detail?id=22345">Issue 22345</a>)</li>
+ (<a href="http://b.android.com/22345">Issue 22345</a>)</li>
<li>Fixed problem with GCC 4.6/4.7 skipping lambda functions.
- (<a href="http://code.google.com/p/android/issues/detail?id=35933">Issue 35933</a>)</li>
+ (<a href="http://b.android.com/35933">Issue 35933</a>)</li>
</ul>
</dd>
@@ -584,21 +857,21 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
<ul>
<li>Fixed {@code __WINT_TYPE__} and {@code wint_t} to be the same type.</li>
<li>Corrected typo in {@code android/bitmap.h}.
- (<a href="http://code.google.com/p/android/issues/detail?id=15134">Issue 15134</a>)
+ (<a href="http://b.android.com/15134">Issue 15134</a>)
</li>
<li>Corrected typo in {@code errno.h}.</li>
<li>Added check for the presence of {@code __STDC_VERSION__} in {@code sys/cdefs.h}.
- (<a href="http://code.google.com/p/android/issues/detail?id=14627">Issue 14627</a>)
+ (<a href="http://b.android.com/14627">Issue 14627</a>)
</li>
<li>Reorganized headers in {@code byteswap.h} and {@code dirent.h}.</li>
<li>Fixed {@code limits.h} to include {@code page.h} which provides {@code PAGE_SIZE}
settings.
- (<a href="http://code.google.com/p/android/issues/detail?id=39983">Issue 39983</a>)
+ (<a href="http://b.android.com/39983">Issue 39983</a>)
</li>
<li>Fixed return type of {@code glGetAttribLocation()} and
{@code glGetUniformLocation()} from {@code int} to {@code GLint}.</li>
<li>Fixed {@code __BYTE_ORDER} constant for x86 builds.
- (<a href="http://code.google.com/p/android/issues/detail?id=39824">Issue 39824</a>)
+ (<a href="http://b.android.com/39824">Issue 39824</a>)
</li>
</ul>
</li>
@@ -611,7 +884,7 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
<li>Fixed ARM EHABI support in Clang to conform to specifications.</li>
<li>Fixed GNU Debugger (GDB) to shorten the time spent on walking the target's link map
during {@code solib} events.
- (<a href="http://code.google.com/p/android/issues/detail?id=38402">Issue 38402</a>)</li>
+ (<a href="http://b.android.com/38402">Issue 38402</a>)</li>
<li>Fixed missing {@code libgcc.a} file when linking shared libraries.</li>
</ul>
</dd>
@@ -712,7 +985,7 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
<ul>
<li>Fixed an issue where running {@code make-standalone-toolchain.sh} with root privileges
resulted in the stand alone tool chain being inaccessible to some users.
- (<a href="http://code.google.com/p/android/issues/detail?id=35279">Issue 35279</a>)
+ (<a href="http://b.android.com/35279">Issue 35279</a>)
<ul>
<li>All files and executables in the NDK release package are set to have read and
execute permissions for all.</li>
@@ -722,23 +995,23 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
<li>Removed redundant {@code \r} from Windows prebuilt {@code echo.exe}. The redundant
{@code \r} caused {@code gdb.setup} to fail in the GNU Debugger (GDB) because it
incorrectly became part of the path.
- (<a href="http://code.google.com/p/android/issues/detail?id=36054">Issue 36054</a>)</li>
+ (<a href="http://b.android.com/36054">Issue 36054</a>)</li>
<li>Fixed Windows parallel builds that sometimes failed due to timing issues in the
{@code host-mkdir} implementation.
- (<a href="http://code.google.com/p/android/issues/detail?id=25875">Issue 25875</a>)</li>
+ (<a href="http://b.android.com/25875">Issue 25875</a>)</li>
<li>Fixed GCC 4.4.3 GNU {@code libstdc++} to <em>not</em> merge {@code typeinfo} names by
default. For more details, see
{@code toolchain repo gcc/gcc-4.4.3/libstdc++-v3/libsupc++/typeinfo}.
- (<a href="http://code.google.com/p/android/issues/detail?id=22165">Issue 22165</a>)</li>
+ (<a href="http://b.android.com/22165">Issue 22165</a>)</li>
<li>Fixed problem on {@code null} context in GCC 4.6
{@code cp/mangle.c::write_unscoped_name}, where GCC may crash when the context is
{@code null} and dereferenced in {@code TREE_CODE}.</li>
<li>Fixed GCC 4.4.3 crashes on ARM NEON-specific type definitions for floats.
- (<a href="http://code.google.com/p/android/issues/detail?id=34613">Issue 34613</a>)</li>
+ (<a href="http://b.android.com/34613">Issue 34613</a>)</li>
<li>Fixed the {@code STLport} internal {@code _IteWrapper::operator*()} implementation
where a stale stack location holding the dereferenced value was returned and caused
runtime crashes.
- (<a href="http://code.google.com/p/android/issues/detail?id=38630">Issue 38630</a>)</li>
+ (<a href="http://b.android.com/38630">Issue 38630</a>)</li>
<li>ARM-specific fixes:
<ul>
@@ -755,17 +1028,17 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
<li>Fixed {@code binutils-2.21/ld.bfd} to be capable of linking object from older
binutils without {@code tag_FP_arch}, which was producing <em>assertion fail</em>
error messages in GNU Binutils.
- (<a href="http://code.google.com/p/android/issues/detail?id=35209">Issue 35209</a>)
+ (<a href="http://b.android.com/35209">Issue 35209</a>)
</li>
<li>Removed <em>Unknown EABI object attribute 44</em> warning when
{@code binutils-2.19/ld} links prebuilt object by newer {@code binutils-2.21}</li>
<li>Fixed an issue in GNU {@code stdc++} compilation with both {@code -mthumb} and
{@code -march=armv7-a}, by modifying {@code make-standalone-toolchain.sh} to populate
{@code headers/libs} in sub-directory {@code armv7-a/thumb}.
- (<a href="http://code.google.com/p/android/issues/detail?id=35616">Issue 35616</a>)
+ (<a href="http://b.android.com/35616">Issue 35616</a>)
</li>
<li>Fixed <em>unresolvable R_ARM_THM_CALL relocation</em> error.
- (<a href="http://code.google.com/p/android/issues/detail?id=35342">Issue 35342</a>)
+ (<a href="http://b.android.com/35342">Issue 35342</a>)
</li>
<li>Fixed internal compiler error at {@code reload1.c:3633}, caused by the ARM
back-end expecting the wrong operand type when sign-extend from {@code char}.
@@ -794,11 +1067,11 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
<li>Disabled Python support in gdb-7.x at build, otherwise the gdb-7.x configure
function may pick up whatever Python version is available on the host and build
{@code gdb} with a hard-wired dependency on a specific version of Python.
- (<a href="http://code.google.com/p/android/issues/detail?id=36120">Issue 36120</a>)
+ (<a href="http://b.android.com/36120">Issue 36120</a>)
</li>
<li>Fixed {@code ndk-gdb} when {@code APP_ABI} contains {@code all} and matchs none
of the known architectures.
- (<a href="http://code.google.com/p/android/issues/detail?id=35392">Issue 35392</a>)
+ (<a href="http://b.android.com/35392">Issue 35392</a>)
</li>
<li>Fixed Windows pathname support, by keeping the {@code :} character if it looks
like it could be part of a Windows path starting with a drive letter.
@@ -809,7 +1082,7 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
</li>
<li>Added fix to only read the current {@code solibs} when the linker is consistent.
This change speeds up {@code solib} event handling.
- (<a href="http://code.google.com/p/android/issues/detail?id=37677">Issue 37677</a>)
+ (<a href="http://b.android.com/37677">Issue 37677</a>)
</li>
<li>Added fix to make repeated attempts to find {@code solib} breakpoints. GDB now
retries {@code enable_break()} during every call to {@code svr4_current_sos()} until
@@ -817,13 +1090,13 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
(<a href="https://android-review.googlesource.com/#/c/43563">Change 43563</a>)</li>
<li>Fixed an issue where {@code gdb} would not stop on breakpoints placed in
{@code dlopen-ed} libraries.
- (<a href="http://code.google.com/p/android/issues/detail?id=34856">Issue 34856</a>)
+ (<a href="http://b.android.com/34856">Issue 34856</a>)
</li>
<li>Fixed {@code SIGILL} in dynamic linker when calling {@code dlopen()}, on system
where {@code /system/bin/linker} is stripped of symbols and
{@code rtld_db_dlactivity()} is implemented as {@code Thumb}, due to not preserving
{@code LSB} of {@code sym_addr}.
- (<a href="http://code.google.com/p/android/issues/detail?id=37147">Issue 37147</a>)
+ (<a href="http://b.android.com/37147">Issue 37147</a>)
</li>
</ul>
</li>
@@ -848,7 +1121,7 @@ Expected in: /usr/lib/libSystem.B.dylib</pre>
{@code __END_DECLS}.</li>
<li>Removed unimplemented functions in {@code malloc.h}.</li>
<li>Fixed {@code stdint.h} defintion of {@code uint64_t} for ANSI compilers.
- (<a href="http://code.google.com/p/android/issues/detail?id=1952">Issue 1952</a>)</li>
+ (<a href="http://b.android.com/1952">Issue 1952</a>)</li>
<li>Fixed preprocessor macros in {@code &lt;arch&gt;/include/machine/*}.</li>
<li>Replaced {@code link.h} for MIPS with new version supporting all platforms.</li>
<li>Removed {@code linux-unistd.h}</li>
@@ -904,7 +1177,7 @@ extern "C" {
{@code platforms/android-[3,4,5,8]}. Those headers were incomplete, since both X86 and
MIPS ABIs are only supported at API 9 or higher.</li>
<li>Simplified c++ include path in standalone packages, as shown below.
- (<a href="http://code.google.com/p/android/issues/detail?id=35279">Issue 35279</a>)
+ (<a href="http://b.android.com/35279">Issue 35279</a>)
<pre>
&lt;path&gt;/arm-linux-androideabi/include/c++/4.6.x-google
to:
@@ -916,7 +1189,7 @@ extern "C" {
<li>Fixed an issue in {@code samples/san-angeles} that caused a black screen or freeze
frame on re-launch.</li>
<li>Replaced deprecated APIs in NDK samples.
- (<a href="http://code.google.com/p/android/issues/detail?id=20017">Issue 20017</a>)
+ (<a href="http://b.android.com/20017">Issue 20017</a>)
<ul>
<li>{@code hello-gl2} from android-5 to android-7</li>
<li>{@code native-activity} from android-9 to android-10</li>
@@ -1196,7 +1469,7 @@ is compiled for the device's CPU architecture.</p>
<li>Fixed a typo in GAbi++ implementation where the result of {@code
dynamic_cast&lt;D&gt;(b)} of base class object {@code b} to derived class {@code D} is
incorrectly adjusted in the opposite direction from the base class.
- (<a href="http://code.google.com/p/android/issues/detail?id=28721">Issue 28721</a>)
+ (<a href="http://b.android.com/28721">Issue 28721</a>)
</li>
<li>Fixed an issue in which {@code make-standalone-toolchain.sh} fails to copy
{@code libsupc++.*}.</li>
@@ -1710,7 +1983,7 @@ LOCAL_CPP_EXTENSION := .cpp .cxx
<li>Fixed the standalone toolchain linker warnings about missing the definition and
size for the <code>__dso_handle</code> symbol (ARM only).</li>
<li>Fixed the inclusion order of <code>$(SYSROOT)/usr/include</code> for x86 builds.
- See the <a href="http://code.google.com/p/android/issues/detail?id=18540">bug</a> for
+ See the <a href="http://b.android.com/18540">bug</a> for
more information.</li>
<li>Fixed the definitions of <code>ptrdiff_t</code> and <code>size_t</code> in
x86-specific systems when they are used with the x86 standalone toolchain.</li>
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
index b58fdd1f62f7..cd2d986dade4 100644
--- a/docs/html/tools/sdk/tools-notes.jd
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -29,6 +29,42 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 22.0.4</a> <em>(July 2013)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>
+ <ul>
+ <li>Android SDK Platform-tools revision 16 or later.</li>
+ <li>If you are developing in Eclipse with the
+ <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a>, note that this version of
+ SDK Tools is designed for use with ADT 22.0.4 and later. If you haven't already, update
+ ADT to 22.0.4.</li>
+ <li>If you are using <a href="{@docRoot}sdk/installing/studio.html">Android Studio</a>,
+ note that this version of the SDK Tools is designed to work with Android Studio
+ 0.2.x and later.</li>
+ <li>If you are developing without an integrated development environment (IDE), you must have
+ <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
+ </ul>
+ </dd>
+
+ <dt>General Notes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed problem with compiling Renderscript code.</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+</div>
+
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
alt=""/>SDK Tools, Revision 22.0.1</a> <em>(May 2013)</em>
</p>
diff --git a/docs/html/training/implementing-navigation/nav-drawer.jd b/docs/html/training/implementing-navigation/nav-drawer.jd
index 527d570dfe0b..38b7345456dd 100644
--- a/docs/html/training/implementing-navigation/nav-drawer.jd
+++ b/docs/html/training/implementing-navigation/nav-drawer.jd
@@ -124,6 +124,7 @@ android.widget.ArrayAdapter} or {@link android.widget.SimpleCursorAdapter}).</p>
<pre>
public class MainActivity extends Activity {
private String[] mPlanetTitles;
+ private DrawerLayout mDrawerLayout;
private ListView mDrawerList;
...
@@ -133,6 +134,7 @@ public class MainActivity extends Activity {
setContentView(R.layout.activity_main);
mPlanetTitles = getResources().getStringArray(R.array.planets_array);
+ mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerList = (ListView) findViewById(R.id.left_drawer);
// Set the adapter for the list view
@@ -191,9 +193,9 @@ private void selectItem(int position) {
.commit();
// Highlight the selected item, update the title, and close the drawer
- mDrawer.setItemChecked(position, true);
+ mDrawerList.setItemChecked(position, true);
setTitle(mPlanetTitles[position]);
- mDrawerLayout.closeDrawer(mDrawer);
+ mDrawerLayout.closeDrawer(mDrawerList);
}
&#64;Override
diff --git a/services/java/com/android/server/AppOpsService.java b/services/java/com/android/server/AppOpsService.java
index a55fddcd7ed8..20ad63683acd 100644
--- a/services/java/com/android/server/AppOpsService.java
+++ b/services/java/com/android/server/AppOpsService.java
@@ -380,14 +380,12 @@ public class AppOpsService extends IAppOpsService.Stub {
HashMap<Callback, ArrayList<Pair<String, Integer>>> callbacks = null;
synchronized (this) {
boolean changed = false;
- for (int i=mUidOps.size()-1; i>=0; i--) {
+ for (int i=0; i<mUidOps.size(); i++) {
HashMap<String, Ops> packages = mUidOps.valueAt(i);
- Iterator<Map.Entry<String, Ops>> it = packages.entrySet().iterator();
- while (it.hasNext()) {
- Map.Entry<String, Ops> ent = it.next();
+ for (Map.Entry<String, Ops> ent : packages.entrySet()) {
String packageName = ent.getKey();
Ops pkgOps = ent.getValue();
- for (int j=pkgOps.size()-1; j>=0; j--) {
+ for (int j=0; j<pkgOps.size(); j++) {
Op curOp = pkgOps.valueAt(j);
if (curOp.mode != AppOpsManager.MODE_ALLOWED) {
curOp.mode = AppOpsManager.MODE_ALLOWED;
@@ -396,17 +394,9 @@ public class AppOpsService extends IAppOpsService.Stub {
mOpModeWatchers.get(curOp.op));
callbacks = addCallbacks(callbacks, packageName, curOp.op,
mPackageModeWatchers.get(packageName));
- if (curOp.time == 0 && curOp.rejectTime == 0) {
- pkgOps.removeAt(j);
- }
+ pruneOp(curOp, mUidOps.keyAt(i), packageName);
}
}
- if (pkgOps.size() == 0) {
- it.remove();
- }
- }
- if (packages.size() == 0) {
- mUidOps.removeAt(i);
}
}
if (changed) {
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 54bcdcbb27d2..00935f347202 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -175,7 +175,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
private static final int MAX_HOSTROUTE_CYCLE_COUNT = 10;
private Tethering mTethering;
- private boolean mTetheringConfigValid = false;
private KeyStore mKeyStore;
@@ -589,10 +588,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
}
mTethering = new Tethering(mContext, mNetd, statsService, this, mHandler.getLooper());
- mTetheringConfigValid = ((mTethering.getTetherableUsbRegexs().length != 0 ||
- mTethering.getTetherableWifiRegexs().length != 0 ||
- mTethering.getTetherableBluetoothRegexs().length != 0) &&
- mTethering.getUpstreamIfaceTypes().length != 0);
mVpn = new Vpn(mContext, mVpnCallback, mNetd, this);
mVpn.startMonitoring(mContext, mTrackerHandler);
@@ -2174,15 +2169,26 @@ public class ConnectivityService extends IConnectivityManager.Stub {
}
}
+ if (DBG) log("handleCaptivePortalTrackerCheck: call captivePortalCheckComplete ni=" + info);
thisNet.captivePortalCheckComplete();
}
/** @hide */
+ @Override
public void captivePortalCheckComplete(NetworkInfo info) {
enforceConnectivityInternalPermission();
+ if (DBG) log("captivePortalCheckComplete: ni=" + info);
mNetTrackers[info.getType()].captivePortalCheckComplete();
}
+ /** @hide */
+ @Override
+ public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) {
+ enforceConnectivityInternalPermission();
+ if (DBG) log("captivePortalCheckCompleted: ni=" + info + " captive=" + isCaptivePortal);
+ mNetTrackers[info.getType()].captivePortalCheckCompleted(isCaptivePortal);
+ }
+
/**
* Setup data activity tracking for the given network interface.
*
@@ -3002,7 +3008,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
int defaultVal = (SystemProperties.get("ro.tether.denied").equals("true") ? 0 : 1);
boolean tetherEnabledInSettings = (Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.TETHER_SUPPORTED, defaultVal) != 0);
- return tetherEnabledInSettings && mTetheringConfigValid;
+ return tetherEnabledInSettings && ((mTethering.getTetherableUsbRegexs().length != 0 ||
+ mTethering.getTetherableWifiRegexs().length != 0 ||
+ mTethering.getTetherableBluetoothRegexs().length != 0) &&
+ mTethering.getUpstreamIfaceTypes().length != 0);
}
// An API NetworkStateTrackers can call when they lose their network.
@@ -3734,11 +3743,26 @@ public class ConnectivityService extends IConnectivityManager.Stub {
// hipri connection so the default connection stays active.
log("isMobileOk: start hipri url=" + params.mUrl);
mCs.setEnableFailFastMobileData(DctConstants.ENABLED);
- mCs.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
- Phone.FEATURE_ENABLE_HIPRI, new Binder());
// Continue trying to connect until time has run out
long endTime = SystemClock.elapsedRealtime() + params.mTimeOutMs;
+
+ // First wait until we can start using hipri
+ Binder binder = new Binder();
+ while(SystemClock.elapsedRealtime() < endTime) {
+ int ret = mCs.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
+ Phone.FEATURE_ENABLE_HIPRI, binder);
+ if ((ret == PhoneConstants.APN_ALREADY_ACTIVE)
+ || (ret == PhoneConstants.APN_REQUEST_STARTED)) {
+ log("isMobileOk: hipri started");
+ break;
+ }
+ if (VDBG) log("isMobileOk: hipri not started yet");
+ result = ConnectivityManager.CMP_RESULT_CODE_NO_CONNECTION;
+ sleep(1);
+ }
+
+ // Continue trying to connect until time has run out
while(SystemClock.elapsedRealtime() < endTime) {
try {
// Wait for hipri to connect.
@@ -3747,8 +3771,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
NetworkInfo.State state = mCs
.getNetworkInfo(ConnectivityManager.TYPE_MOBILE_HIPRI).getState();
if (state != NetworkInfo.State.CONNECTED) {
- log("isMobileOk: not connected ni=" +
+ if (VDBG) {
+ log("isMobileOk: not connected ni=" +
mCs.getNetworkInfo(ConnectivityManager.TYPE_MOBILE_HIPRI));
+ }
sleep(1);
result = ConnectivityManager.CMP_RESULT_CODE_NO_CONNECTION;
continue;
@@ -4088,7 +4114,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
return null;
}
- private String getMobileRedirectedProvisioningUrl() {
+ @Override
+ public String getMobileRedirectedProvisioningUrl() {
+ enforceConnectivityInternalPermission();
String url = getProvisioningUrlBaseFromFile(REDIRECTED_PROVISIONING);
if (TextUtils.isEmpty(url)) {
url = mContext.getResources().getString(R.string.mobile_redirected_provisioning_url);
@@ -4096,14 +4124,15 @@ public class ConnectivityService extends IConnectivityManager.Stub {
return url;
}
+ @Override
public String getMobileProvisioningUrl() {
enforceConnectivityInternalPermission();
String url = getProvisioningUrlBaseFromFile(PROVISIONING);
if (TextUtils.isEmpty(url)) {
url = mContext.getResources().getString(R.string.mobile_provisioning_url);
- log("getProvisioningUrl: mobile_provisioining_url from resource =" + url);
+ log("getMobileProvisioningUrl: mobile_provisioining_url from resource =" + url);
} else {
- log("getProvisioningUrl: mobile_provisioning_url from File =" + url);
+ log("getMobileProvisioningUrl: mobile_provisioning_url from File =" + url);
}
// populate the iccid, imei and phone number in the provisioning url.
if (!TextUtils.isEmpty(url)) {
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index 32f39b7ed08b..b83d885fda81 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -157,6 +157,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
IntentFilter filter = new IntentFilter();
filter.addAction(UsbManager.ACTION_USB_STATE);
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
+ filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
mContext.registerReceiver(mStateReceiver, filter);
filter = new IntentFilter();
@@ -516,6 +517,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
if (VDBG) Log.d(TAG, "Tethering got CONNECTIVITY_ACTION");
mTetherMasterSM.sendMessage(TetherMasterSM.CMD_UPSTREAM_CHANGED);
}
+ } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
+ updateConfiguration();
}
}
}
@@ -618,7 +621,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
public int[] getUpstreamIfaceTypes() {
int values[];
synchronized (mPublicSync) {
- updateConfiguration();
+ updateConfiguration(); // TODO - remove?
values = new int[mUpstreamIfaceTypes.size()];
Iterator<Integer> iterator = mUpstreamIfaceTypes.iterator();
for (int i=0; i < mUpstreamIfaceTypes.size(); i++) {
@@ -1289,7 +1292,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
int upType = ConnectivityManager.TYPE_NONE;
String iface = null;
- updateConfiguration();
+ updateConfiguration(); // TODO - remove?
synchronized (mPublicSync) {
if (VDBG) {
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
index cbefd3d27882..b909bec6299e 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
@@ -30,6 +30,7 @@ import com.android.layoutlib.bridge.Bridge;
import com.android.layoutlib.bridge.android.BridgeContext;
import com.android.resources.Density;
import com.android.resources.ResourceType;
+import com.android.resources.ScreenOrientation;
import com.android.resources.ScreenSize;
import android.content.res.Configuration;
@@ -347,6 +348,23 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso
config.compatScreenWidthDp = config.screenWidthDp;
config.compatScreenHeightDp = config.screenHeightDp;
+ ScreenOrientation orientation = hardwareConfig.getOrientation();
+ if (orientation != null) {
+ switch (orientation) {
+ case PORTRAIT:
+ config.orientation = Configuration.ORIENTATION_PORTRAIT;
+ break;
+ case LANDSCAPE:
+ config.orientation = Configuration.ORIENTATION_LANDSCAPE;
+ break;
+ case SQUARE:
+ config.orientation = Configuration.ORIENTATION_SQUARE;
+ break;
+ }
+ } else {
+ config.orientation = Configuration.ORIENTATION_UNDEFINED;
+ }
+
// TODO: fill in more config info.
return config;
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 007735459aa7..6589ff5a8336 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -3166,6 +3166,7 @@ public class WifiStateMachine extends StateMachine {
class VerifyingLinkState extends State {
@Override
public void enter() {
+ log(getName() + " enter");
setNetworkDetailedState(DetailedState.VERIFYING_POOR_LINK);
mWifiConfigStore.updateStatus(mLastNetworkId, DetailedState.VERIFYING_POOR_LINK);
sendNetworkStateChangeBroadcast(mLastBssid);
@@ -3175,11 +3176,14 @@ public class WifiStateMachine extends StateMachine {
switch (message.what) {
case WifiWatchdogStateMachine.POOR_LINK_DETECTED:
//stay here
+ log(getName() + " POOR_LINK_DETECTED: no transition");
break;
case WifiWatchdogStateMachine.GOOD_LINK_DETECTED:
+ log(getName() + " GOOD_LINK_DETECTED: transition to captive portal check");
transitionTo(mCaptivePortalCheckState);
break;
default:
+ log(getName() + " what=" + message.what + " NOT_HANDLED");
return NOT_HANDLED;
}
return HANDLED;
@@ -3189,6 +3193,7 @@ public class WifiStateMachine extends StateMachine {
class CaptivePortalCheckState extends State {
@Override
public void enter() {
+ log(getName() + " enter");
setNetworkDetailedState(DetailedState.CAPTIVE_PORTAL_CHECK);
mWifiConfigStore.updateStatus(mLastNetworkId, DetailedState.CAPTIVE_PORTAL_CHECK);
sendNetworkStateChangeBroadcast(mLastBssid);
@@ -3197,6 +3202,7 @@ public class WifiStateMachine extends StateMachine {
public boolean processMessage(Message message) {
switch (message.what) {
case CMD_CAPTIVE_CHECK_COMPLETE:
+ log(getName() + " CMD_CAPTIVE_CHECK_COMPLETE");
try {
mNwService.enableIpv6(mInterfaceName);
} catch (RemoteException re) {
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java
index cf75381e6c45..461dedb8a04b 100644
--- a/wifi/java/android/net/wifi/WifiStateTracker.java
+++ b/wifi/java/android/net/wifi/WifiStateTracker.java
@@ -120,6 +120,11 @@ public class WifiStateTracker implements NetworkStateTracker {
mWifiManager.captivePortalCheckComplete();
}
+ @Override
+ public void captivePortalCheckCompleted(boolean isCaptivePortal) {
+ // not implemented
+ }
+
/**
* Turn the wireless radio off for a network.
* @param turnOn {@code true} to turn the radio on, {@code false}