Merge "LayoutLib: add a few misc implementations." into honeycomb
diff --git a/api/current.xml b/api/current.xml
index bf004c7..7e81eb7 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -2116,6 +2116,17 @@
  visibility="public"
 >
 </field>
+<field name="alertDialogIcon"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843607"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="alertDialogStyle"
  type="int"
  transient="false"
@@ -22806,32 +22817,6 @@
 <parameter name="args" type="java.lang.String[]">
 </parameter>
 </method>
-<method name="findFragmentById"
- return="android.app.Fragment"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-<parameter name="id" type="int">
-</parameter>
-</method>
-<method name="findFragmentByTag"
- return="android.app.Fragment"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-<parameter name="tag" type="java.lang.String">
-</parameter>
-</method>
 <method name="findViewById"
  return="android.view.View"
  abstract="false"
@@ -24054,17 +24039,6 @@
 <parameter name="view" type="android.view.View">
 </parameter>
 </method>
-<method name="openFragmentTransaction"
- return="android.app.FragmentTransaction"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-</method>
 <method name="openOptionsMenu"
  return="void"
  abstract="false"
@@ -26610,6 +26584,19 @@
 <parameter name="icon" type="android.graphics.drawable.Drawable">
 </parameter>
 </method>
+<method name="setIconAttribute"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="attrId" type="int">
+</parameter>
+</method>
 <method name="setInverseBackgroundForced"
  return="void"
  abstract="false"
@@ -26807,6 +26794,19 @@
 <parameter name="icon" type="android.graphics.drawable.Drawable">
 </parameter>
 </method>
+<method name="setIconAttribute"
+ return="android.app.AlertDialog.Builder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="attrId" type="int">
+</parameter>
+</method>
 <method name="setInverseBackgroundForced"
  return="android.app.AlertDialog.Builder"
  abstract="false"
@@ -43586,6 +43586,30 @@
 <parameter name="data" type="D">
 </parameter>
 </method>
+<method name="onLoadInBackground"
+ return="D"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+</method>
+<method name="setUpdateThrottle"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="delayMS" type="long">
+</parameter>
+</method>
 <method name="waitForLoader"
  return="void"
  abstract="false"
@@ -50175,21 +50199,6 @@
 <parameter name="cursor" type="android.database.Cursor">
 </parameter>
 </method>
-<method name="registerContentObserver"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="cursor" type="android.database.Cursor">
-</parameter>
-<parameter name="observer" type="android.database.ContentObserver">
-</parameter>
-</method>
 <method name="setProjection"
  return="void"
  abstract="false"
@@ -55416,7 +55425,7 @@
  native="false"
  synchronized="false"
  static="false"
- final="true"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
@@ -55541,7 +55550,7 @@
  native="false"
  synchronized="false"
  static="false"
- final="true"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
@@ -55563,7 +55572,7 @@
  native="false"
  synchronized="false"
  static="false"
- final="true"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
@@ -67980,6 +67989,21 @@
 <parameter name="selectionArgs" type="java.lang.String[]">
 </parameter>
 </method>
+<method name="concatenateWhere"
+ return="java.lang.String"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="a" type="java.lang.String">
+</parameter>
+<parameter name="b" type="java.lang.String">
+</parameter>
+</method>
 <method name="createDbFromSqlStatements"
  return="void"
  abstract="false"
@@ -90535,6 +90559,19 @@
 <exception name="IOException" type="java.io.IOException">
 </exception>
 </method>
+<method name="setPreviewTexture"
+ return="void"
+ abstract="false"
+ native="true"
+ synchronized="false"
+ static="false"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="surfaceTexture" type="android.graphics.SurfaceTexture">
+</parameter>
+</method>
 <method name="setZoomChangeListener"
  return="void"
  abstract="false"
@@ -165977,6 +166014,175 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<method name="copy1DRangeFrom"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="off" type="int">
+</parameter>
+<parameter name="count" type="int">
+</parameter>
+<parameter name="d" type="int[]">
+</parameter>
+</method>
+<method name="copy1DRangeFrom"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="off" type="int">
+</parameter>
+<parameter name="count" type="int">
+</parameter>
+<parameter name="d" type="short[]">
+</parameter>
+</method>
+<method name="copy1DRangeFrom"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="off" type="int">
+</parameter>
+<parameter name="count" type="int">
+</parameter>
+<parameter name="d" type="byte[]">
+</parameter>
+</method>
+<method name="copy1DRangeFrom"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="off" type="int">
+</parameter>
+<parameter name="count" type="int">
+</parameter>
+<parameter name="d" type="float[]">
+</parameter>
+</method>
+<method name="copy2DRangeFrom"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="yoff" type="int">
+</parameter>
+<parameter name="w" type="int">
+</parameter>
+<parameter name="h" type="int">
+</parameter>
+<parameter name="d" type="byte[]">
+</parameter>
+</method>
+<method name="copy2DRangeFrom"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="yoff" type="int">
+</parameter>
+<parameter name="w" type="int">
+</parameter>
+<parameter name="h" type="int">
+</parameter>
+<parameter name="d" type="short[]">
+</parameter>
+</method>
+<method name="copy2DRangeFrom"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="yoff" type="int">
+</parameter>
+<parameter name="w" type="int">
+</parameter>
+<parameter name="h" type="int">
+</parameter>
+<parameter name="d" type="int[]">
+</parameter>
+</method>
+<method name="copy2DRangeFrom"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="yoff" type="int">
+</parameter>
+<parameter name="w" type="int">
+</parameter>
+<parameter name="h" type="int">
+</parameter>
+<parameter name="d" type="float[]">
+</parameter>
+</method>
+<method name="copy2DRangeFrom"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="yoff" type="int">
+</parameter>
+<parameter name="b" type="android.graphics.Bitmap">
+</parameter>
+</method>
 <method name="copyFrom"
  return="void"
  abstract="false"
@@ -166068,6 +166274,58 @@
 <parameter name="b" type="android.graphics.Bitmap">
 </parameter>
 </method>
+<method name="copyTo"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="d" type="byte[]">
+</parameter>
+</method>
+<method name="copyTo"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="d" type="short[]">
+</parameter>
+</method>
+<method name="copyTo"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="d" type="int[]">
+</parameter>
+</method>
+<method name="copyTo"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="d" type="float[]">
+</parameter>
+</method>
 <method name="createCubemapFromBitmap"
  return="android.renderscript.Allocation"
  abstract="false"
@@ -166293,32 +166551,6 @@
  visibility="public"
 >
 </method>
-<method name="readData"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="d" type="int[]">
-</parameter>
-</method>
-<method name="readData"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="d" type="float[]">
-</parameter>
-</method>
 <method name="resize"
  return="void"
  abstract="false"
@@ -166332,148 +166564,6 @@
 <parameter name="dimX" type="int">
 </parameter>
 </method>
-<method name="subData"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="xoff" type="int">
-</parameter>
-<parameter name="fp" type="android.renderscript.FieldPacker">
-</parameter>
-</method>
-<method name="subData1D"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="off" type="int">
-</parameter>
-<parameter name="count" type="int">
-</parameter>
-<parameter name="d" type="int[]">
-</parameter>
-</method>
-<method name="subData1D"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="off" type="int">
-</parameter>
-<parameter name="count" type="int">
-</parameter>
-<parameter name="d" type="short[]">
-</parameter>
-</method>
-<method name="subData1D"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="off" type="int">
-</parameter>
-<parameter name="count" type="int">
-</parameter>
-<parameter name="d" type="byte[]">
-</parameter>
-</method>
-<method name="subData1D"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="off" type="int">
-</parameter>
-<parameter name="count" type="int">
-</parameter>
-<parameter name="d" type="float[]">
-</parameter>
-</method>
-<method name="subData2D"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="xoff" type="int">
-</parameter>
-<parameter name="yoff" type="int">
-</parameter>
-<parameter name="w" type="int">
-</parameter>
-<parameter name="h" type="int">
-</parameter>
-<parameter name="d" type="int[]">
-</parameter>
-</method>
-<method name="subData2D"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="xoff" type="int">
-</parameter>
-<parameter name="yoff" type="int">
-</parameter>
-<parameter name="w" type="int">
-</parameter>
-<parameter name="h" type="int">
-</parameter>
-<parameter name="d" type="float[]">
-</parameter>
-</method>
-<method name="subElementData"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="xoff" type="int">
-</parameter>
-<parameter name="component_number" type="int">
-</parameter>
-<parameter name="fp" type="android.renderscript.FieldPacker">
-</parameter>
-</method>
 <method name="syncAll"
  return="void"
  abstract="false"
@@ -216573,7 +216663,7 @@
 >
 <parameter name="data" type="android.content.ClipData">
 </parameter>
-<parameter name="thumbBuilder" type="android.view.View.DragThumbnailBuilder">
+<parameter name="shadowBuilder" type="android.view.View.DragShadowBuilder">
 </parameter>
 <parameter name="myWindowOnly" type="boolean">
 </parameter>
@@ -217420,7 +217510,7 @@
 >
 </field>
 </class>
-<class name="View.DragThumbnailBuilder"
+<class name="View.DragShadowBuilder"
  extends="java.lang.Object"
  abstract="false"
  static="true"
@@ -217428,8 +217518,8 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="View.DragThumbnailBuilder"
- type="android.view.View.DragThumbnailBuilder"
+<constructor name="View.DragShadowBuilder"
+ type="android.view.View.DragShadowBuilder"
  static="false"
  final="false"
  deprecated="not deprecated"
@@ -217449,7 +217539,7 @@
  visibility="public"
 >
 </method>
-<method name="onDrawThumbnail"
+<method name="onDrawShadow"
  return="void"
  abstract="false"
  native="false"
@@ -217462,7 +217552,7 @@
 <parameter name="canvas" type="android.graphics.Canvas">
 </parameter>
 </method>
-<method name="onProvideThumbnailMetrics"
+<method name="onProvideShadowMetrics"
  return="void"
  abstract="false"
  native="false"
@@ -217472,9 +217562,9 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<parameter name="thumbnailSize" type="android.graphics.Point">
+<parameter name="shadowSize" type="android.graphics.Point">
 </parameter>
-<parameter name="thumbnailTouchPoint" type="android.graphics.Point">
+<parameter name="shadowTouchPoint" type="android.graphics.Point">
 </parameter>
 </method>
 </class>
@@ -258107,7 +258197,7 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<parameter name="t" type="T">
+<parameter name="arg0" type="T">
 </parameter>
 </method>
 </interface>
diff --git a/core/java/android/animation/LayoutTransition.java b/core/java/android/animation/LayoutTransition.java
index 8931450..d534163 100644
--- a/core/java/android/animation/LayoutTransition.java
+++ b/core/java/android/animation/LayoutTransition.java
@@ -600,6 +600,18 @@
                 // Remove the animation from the cache when it ends
                 anim.addListener(new AnimatorListenerAdapter() {
                     private boolean canceled = false;
+
+                    @Override
+                    public void onAnimationStart(Animator animator) {
+                        if (mListeners != null) {
+                            for (TransitionListener listener : mListeners) {
+                                listener.startTransition(LayoutTransition.this, parent, child,
+                                        changeReason == APPEARING ?
+                                                CHANGE_APPEARING : CHANGE_DISAPPEARING);
+                            }
+                        }
+                    }
+
                     @Override
                     public void onAnimationCancel(Animator animator) {
                         // we remove canceled animations immediately, not here
@@ -607,11 +619,19 @@
                         child.removeOnLayoutChangeListener(listener);
                         layoutChangeListenerMap.remove(child);
                     }
+
                     @Override
                     public void onAnimationEnd(Animator animator) {
                         if (!canceled) {
                             currentChangingAnimations.remove(child);
                         }
+                        if (mListeners != null) {
+                            for (TransitionListener listener : mListeners) {
+                                listener.endTransition(LayoutTransition.this, parent, child,
+                                        changeReason == APPEARING ?
+                                                CHANGE_APPEARING : CHANGE_DISAPPEARING);
+                            }
+                        }
                     }
                 });
 
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 938c47d..ec2f771 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -73,13 +73,11 @@
 import android.view.WindowManager;
 import android.view.accessibility.AccessibilityEvent;
 import android.widget.AdapterView;
-import android.widget.FrameLayout;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 
 /**
  * An activity is a single, focused thing that the user can do.  Almost all
@@ -1579,16 +1577,6 @@
         return mFragments;
     }
 
-    /**
-     * Start a series of edit operations on the Fragments associated with
-     * this activity.
-     * @deprecated use {@link #getFragmentManager}.
-     */
-    @Deprecated
-    public FragmentTransaction openFragmentTransaction() {
-        return mFragments.openTransaction();
-    }
-    
     void invalidateFragmentIndex(int index) {
         //Log.v(TAG, "invalidateFragmentIndex: index=" + index);
         if (mAllLoaderManagers != null) {
@@ -1770,30 +1758,6 @@
     }
     
     /**
-     * Finds a fragment that was identified by the given id either when inflated
-     * from XML or as the container ID when added in a transaction.  This only
-     * returns fragments that are currently added to the activity's content.
-     * @return The fragment if found or null otherwise.
-     * @deprecated use {@link #getFragmentManager}.
-     */
-    @Deprecated
-    public Fragment findFragmentById(int id) {
-        return mFragments.findFragmentById(id);
-    }
-    
-    /**
-     * Finds a fragment that was identified by the given tag either when inflated
-     * from XML or as supplied when added in a transaction.  This only
-     * returns fragments that are currently added to the activity's content.
-     * @return The fragment if found or null otherwise.
-     * @deprecated use {@link #getFragmentManager}.
-     */
-    @Deprecated
-    public Fragment findFragmentByTag(String tag) {
-        return mFragments.findFragmentByTag(tag);
-    }
-    
-    /**
      * Set the activity content from a layout resource.  The resource will be
      * inflated, adding all top-level views to the activity.
      * 
diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java
index 9850a12..70e3616 100644
--- a/core/java/android/app/AlertDialog.java
+++ b/core/java/android/app/AlertDialog.java
@@ -270,6 +270,17 @@
         mAlert.setIcon(icon);
     }
 
+    /**
+     * Set an icon as supplied by a theme attribute. e.g. android.R.attr.alertDialogIcon
+     *
+     * @param attrId ID of a theme attribute that points to a drawable resource.
+     */
+    public void setIconAttribute(int attrId) {
+        TypedValue out = new TypedValue();
+        mContext.getTheme().resolveAttribute(attrId, out, true);
+        mAlert.setIcon(out.resourceId);
+    }
+
     public void setInverseBackgroundForced(boolean forceInverseBackground) {
         mAlert.setInverseBackgroundForced(forceInverseBackground);
     }
@@ -399,7 +410,19 @@
             P.mIcon = icon;
             return this;
         }
-        
+
+        /**
+         * Set an icon as supplied by a theme attribute. e.g. android.R.attr.alertDialogIcon
+         *
+         * @param attrId ID of a theme attribute that points to a drawable resource.
+         */
+        public Builder setIconAttribute(int attrId) {
+            TypedValue out = new TypedValue();
+            P.mContext.getTheme().resolveAttribute(attrId, out, true);
+            P.mIconId = out.resourceId;
+            return this;
+        }
+
         /**
          * Set a listener to be invoked when the positive button of the dialog is pressed.
          * @param textId The resource id of the text to display in the positive button
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 72f7286..16d3a7f 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -485,6 +485,11 @@
     }
 
     @Override
+    public int getThemeResId() {
+        return mThemeResource;
+    }
+
+    @Override
     public Resources.Theme getTheme() {
         if (mTheme == null) {
             if (mThemeResource == 0) {
diff --git a/core/java/android/app/DialogFragment.java b/core/java/android/app/DialogFragment.java
index bcd46d9..72a455e 100644
--- a/core/java/android/app/DialogFragment.java
+++ b/core/java/android/app/DialogFragment.java
@@ -211,7 +211,7 @@
      */
     @Deprecated
     public void show(Activity activity, String tag) {
-        FragmentTransaction ft = activity.openFragmentTransaction();
+        FragmentTransaction ft = activity.getFragmentManager().openTransaction();
         ft.add(this, tag);
         ft.commit();
     }
diff --git a/core/java/android/app/FragmentTransaction.java b/core/java/android/app/FragmentTransaction.java
index 5aec348..1b8debc 100644
--- a/core/java/android/app/FragmentTransaction.java
+++ b/core/java/android/app/FragmentTransaction.java
@@ -24,8 +24,8 @@
      * @param fragment The fragment to be added.  This fragment must not already
      * be added to the activity.
      * @param tag Optional tag name for the fragment, to later retrieve the
-     * fragment with {@link Activity#findFragmentByTag(String)
-     * Activity.findFragmentByTag(String)}.
+     * fragment with {@link FragmentManager#findFragmentByTag(String)
+     * FragmentManager.findFragmentByTag(String)}.
      * 
      * @return Returns the same FragmentTransaction instance.
      */
@@ -47,8 +47,8 @@
      * to be replaced.
      * @param fragment The new fragment to place in the container.
      * @param tag Optional tag name for the fragment, to later retrieve the
-     * fragment with {@link Activity#findFragmentByTag(String)
-     * Activity.findFragmentByTag(String)}.
+     * fragment with {@link FragmentManager#findFragmentByTag(String)
+     * FragmentManager.findFragmentByTag(String)}.
      * 
      * @return Returns the same FragmentTransaction instance.
      */
diff --git a/core/java/android/content/AsyncTaskLoader.java b/core/java/android/content/AsyncTaskLoader.java
index 01a2912..ec4e578 100644
--- a/core/java/android/content/AsyncTaskLoader.java
+++ b/core/java/android/content/AsyncTaskLoader.java
@@ -17,8 +17,13 @@
 package android.content;
 
 import android.os.AsyncTask;
+import android.os.Handler;
+import android.os.SystemClock;
 import android.util.Log;
+import android.util.TimeUtils;
 
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
 import java.util.concurrent.ExecutionException;
 
 /**
@@ -30,14 +35,15 @@
 
     private static final String TAG = "AsyncTaskLoader";
 
-    final class LoadTask extends AsyncTask<Void, Void, D> {
+    final class LoadTask extends AsyncTask<Void, Void, D> implements Runnable {
 
-        private D result;
+        D result;
+        boolean waiting;
 
         /* Runs on a worker thread */
         @Override
         protected D doInBackground(Void... params) {
-            result = AsyncTaskLoader.this.loadInBackground();
+            result = AsyncTaskLoader.this.onLoadInBackground();
             return result;
         }
 
@@ -49,38 +55,91 @@
 
         @Override
         protected void onCancelled() {
-            AsyncTaskLoader.this.onCancelled(result);
+            AsyncTaskLoader.this.dispatchOnCancelled(this, result);
+        }
+
+        @Override
+        public void run() {
+            waiting = false;
+            AsyncTaskLoader.this.executePendingTask();
         }
     }
 
     volatile LoadTask mTask;
+    volatile LoadTask mCancellingTask;
+
+    long mUpdateThrottle;
+    long mLastLoadCompleteTime = -10000;
+    Handler mHandler;
 
     public AsyncTaskLoader(Context context) {
         super(context);
     }
 
+    /**
+     * Set amount to throttle updates by.  This is the minimum time from
+     * when the last {@link #onLoadInBackground()} call has completed until
+     * a new load is scheduled.
+     *
+     * @param delayMS Amount of delay, in milliseconds.
+     */
+    public void setUpdateThrottle(long delayMS) {
+        mUpdateThrottle = delayMS;
+        if (delayMS != 0) {
+            mHandler = new Handler();
+        }
+    }
+
     @Override
     protected void onForceLoad() {
         super.onForceLoad();
         cancelLoad();
         mTask = new LoadTask();
-        mTask.execute((Void[]) null);
+        executePendingTask();
     }
 
     /**
      * Attempt to cancel the current load task. See {@link AsyncTask#cancel(boolean)}
-     * for more info.
+     * for more info.  Must be called on the main thread of the process.
      *
-     * @return <tt>false</tt> if the task could not be canceled,
+     * <p>Cancelling is not an immediate operation, since the load is performed
+     * in a background thread.  If there is currently a load in progress, this
+     * method requests that the load be cancelled, and notes this is the case;
+     * once the background thread has completed its work its remaining state
+     * will be cleared.  If another load request comes in during this time,
+     * it will be held until the cancelled load is complete.
+     *
+     * @return Returns <tt>false</tt> if the task could not be cancelled,
      *         typically because it has already completed normally, or
-     *         because {@link #startLoading()} hasn't been called, and
-     *         <tt>true</tt> otherwise
+     *         because {@link #startLoading()} hasn't been called; returns
+     *         <tt>true</tt> otherwise.
      */
     public boolean cancelLoad() {
         if (mTask != null) {
-            boolean cancelled = mTask.cancel(false);
-            mTask = null;
-            return cancelled;
+            if (mCancellingTask != null) {
+                // There was a pending task already waiting for a previous
+                // one being canceled; just drop it.
+                if (mTask.waiting) {
+                    mTask.waiting = false;
+                    mHandler.removeCallbacks(mTask);
+                }
+                mTask = null;
+                return false;
+            } else if (mTask.waiting) {
+                // There is a task, but it is waiting for the time it should
+                // execute.  We can just toss it.
+                mTask.waiting = false;
+                mHandler.removeCallbacks(mTask);
+                mTask = null;
+                return false;
+            } else {
+                boolean cancelled = mTask.cancel(false);
+                if (cancelled) {
+                    mCancellingTask = mTask;
+                }
+                mTask = null;
+                return cancelled;
+            }
         }
         return false;
     }
@@ -92,32 +151,67 @@
     public void onCancelled(D data) {
     }
 
+    void executePendingTask() {
+        if (mCancellingTask == null && mTask != null) {
+            if (mTask.waiting) {
+                mTask.waiting = false;
+                mHandler.removeCallbacks(mTask);
+            }
+            if (mUpdateThrottle > 0) {
+                long now = SystemClock.uptimeMillis();
+                if (now < (mLastLoadCompleteTime+mUpdateThrottle)) {
+                    // Not yet time to do another load.
+                    mTask.waiting = true;
+                    mHandler.postAtTime(mTask, mLastLoadCompleteTime+mUpdateThrottle);
+                    return;
+                }
+            }
+            mTask.execute((Void[]) null);
+        }
+    }
+
+    void dispatchOnCancelled(LoadTask task, D data) {
+        onCancelled(data);
+        if (mCancellingTask == task) {
+            mLastLoadCompleteTime = SystemClock.uptimeMillis();
+            mCancellingTask = null;
+            executePendingTask();
+        }
+    }
+
     void dispatchOnLoadComplete(LoadTask task, D data) {
         if (mTask != task) {
-            onCancelled(data);
+            dispatchOnCancelled(task, data);
         } else {
+            mLastLoadCompleteTime = SystemClock.uptimeMillis();
             mTask = null;
             deliverResult(data);
         }
     }
 
     /**
-     * Called on a worker thread to perform the actual load. Implementations should not deliver the
-     * results directly, but should return them from this method, which will eventually end up
-     * calling deliverResult on the UI thread. If implementations need to process
-     * the results on the UI thread they may override deliverResult and do so
-     * there.
-     *
-     * @return the result of the load
      */
     public abstract D loadInBackground();
 
     /**
+     * Called on a worker thread to perform the actual load. Implementations should not deliver the
+     * result directly, but should return them from this method, which will eventually end up
+     * calling {@link #deliverResult} on the UI thread. If implementations need to process
+     * the results on the UI thread they may override {@link #deliverResult} and do so
+     * there.
+     *
+     * @return Implementations must return the result of their load operation.
+     */
+    protected D onLoadInBackground() {
+        return loadInBackground();
+    }
+
+    /**
      * Locks the current thread until the loader completes the current load
      * operation. Returns immediately if there is no load operation running.
      * Should not be called from the UI thread.
      * <p>
-     * Used for testing.
+     * Use for testing only.  <b>Never</b> call this from a UI thread.
      */
     public void waitForLoader() {
         LoadTask task = mTask;
@@ -132,4 +226,25 @@
             }
         }
     }
+
+    @Override
+    public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
+        super.dump(prefix, fd, writer, args);
+        if (mTask != null) {
+            writer.print(prefix); writer.print("mTask="); writer.print(mTask);
+                    writer.print(" waiting="); writer.println(mTask.waiting);
+        }
+        if (mCancellingTask != null) {
+            writer.print(prefix); writer.print("mCancellingTask="); writer.print(mCancellingTask);
+                    writer.print(" waiting="); writer.println(mCancellingTask.waiting);
+        }
+        if (mUpdateThrottle != 0) {
+            writer.print(prefix); writer.print("mUpdateThrottle=");
+                    TimeUtils.formatDuration(mUpdateThrottle, writer);
+                    writer.print(" mLastLoadCompleteTime=");
+                    TimeUtils.formatDuration(mLastLoadCompleteTime,
+                            SystemClock.uptimeMillis(), writer);
+                    writer.println();
+        }
+    }
 }
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index b128d31..227df21 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -227,6 +227,12 @@
      */
     public abstract void setTheme(int resid);
 
+    /** @hide Needed for some internal implementation...  not public because
+     * you can't assume this actually means anything. */
+    public int getThemeResId() {
+        return 0;
+    }
+
     /**
      * Return the Theme object associated with this Context.
      */
diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java
index f8928e4..545144e 100644
--- a/core/java/android/content/ContextWrapper.java
+++ b/core/java/android/content/ContextWrapper.java
@@ -106,6 +106,12 @@
         mBase.setTheme(resid);
     }
 
+    /** @hide */
+    @Override
+    public int getThemeResId() {
+        return mBase.getThemeResId();
+    }
+
     @Override
     public Resources.Theme getTheme() {
         return mBase.getTheme();
diff --git a/core/java/android/content/CursorLoader.java b/core/java/android/content/CursorLoader.java
index 8ab0973..38ebaf2 100644
--- a/core/java/android/content/CursorLoader.java
+++ b/core/java/android/content/CursorLoader.java
@@ -55,7 +55,7 @@
      * Registers an observer to get notifications from the content provider
      * when the cursor needs to be refreshed.
      */
-    public void registerContentObserver(Cursor cursor, ContentObserver observer) {
+    void registerContentObserver(Cursor cursor, ContentObserver observer) {
         cursor.registerContentObserver(mObserver);
     }
 
diff --git a/core/java/android/content/Loader.java b/core/java/android/content/Loader.java
index ef81fe4..d63fe69 100644
--- a/core/java/android/content/Loader.java
+++ b/core/java/android/content/Loader.java
@@ -28,6 +28,13 @@
  * they should monitor the source of their data and deliver new results when the contents
  * change.
  *
+ * <p><b>Note on threading:</b> Clients of loaders should as a rule perform
+ * any calls on to a Loader from the main thread of their process (that is,
+ * the thread the Activity callbacks and other things occur on).  Subclasses
+ * of Loader (such as {@link AsyncTaskLoader}) will often perform their work
+ * in a separate thread, but when delivering their results this too should
+ * be done on the main thread.</p>
+ *
  * <p>Subclasses generally must implement at least {@link #onStartLoading()},
  * {@link #onStopLoading()}, {@link #onForceLoad()}, and {@link #onReset()}.
  *
@@ -80,7 +87,7 @@
     /**
      * Sends the result of the load to the registered listener. Should only be called by subclasses.
      *
-     * Must be called from the UI thread.
+     * Must be called from the process's main thread.
      *
      * @param data the result of the load
      */
@@ -105,10 +112,11 @@
     }
 
     /**
-     * Registers a class that will receive callbacks when a load is complete. The callbacks will
-     * be called on the UI thread so it's safe to pass the results to widgets.
+     * Registers a class that will receive callbacks when a load is complete.
+     * The callback will be called on the process's main thread so it's safe to
+     * pass the results to widgets.
      *
-     * Must be called from the UI thread
+     * <p>Must be called from the process's main thread.
      */
     public void registerListener(int id, OnLoadCompleteListener<D> listener) {
         if (mListener != null) {
@@ -119,7 +127,9 @@
     }
 
     /**
-     * Must be called from the UI thread
+     * Remove a listener that was previously added with {@link #registerListener}.
+     *
+     * Must be called from the process's main thread.
      */
     public void unregisterListener(OnLoadCompleteListener<D> listener) {
         if (mListener == null) {
@@ -150,17 +160,19 @@
     }
 
     /**
-     * Starts an asynchronous load of the contacts list data. When the result is ready the callbacks
-     * will be called on the UI thread. If a previous load has been completed and is still valid
-     * the result may be passed to the callbacks immediately. The loader will monitor the source of
-     * the data set and may deliver future callbacks if the source changes. Calling
-     * {@link #stopLoading} will stop the delivery of callbacks.
+     * Starts an asynchronous load of the Loader's data. When the result
+     * is ready the callbacks will be called on the process's main thread.
+     * If a previous load has been completed and is still valid
+     * the result may be passed to the callbacks immediately.
+     * The loader will monitor the source of
+     * the data set and may deliver future callbacks if the source changes.
+     * Calling {@link #stopLoading} will stop the delivery of callbacks.
      *
      * <p>This updates the Loader's internal state so that
      * {@link #isStarted()} and {@link #isReset()} will return the correct
      * values, and then calls the implementation's {@link #onStartLoading()}.
      *
-     * <p>Must be called from the UI thread.
+     * <p>Must be called from the process's main thread.
      */
     public final void startLoading() {
         mStarted = true;
@@ -182,14 +194,15 @@
      * implementation's {@link #onForceLoad()}.  You generally should only call this
      * when the loader is started -- that is, {@link #isStarted()} returns true.
      *
-     * <p>Must be called from the UI thread.
+     * <p>Must be called from the process's main thread.
      */
-    public final void forceLoad() {
+    public void forceLoad() {
         onForceLoad();
     }
 
     /**
      * Subclasses must implement this to take care of requests to {@link #forceLoad()}.
+     * This will always be called from the process's main thread.
      */
     protected void onForceLoad() {
     }
@@ -206,9 +219,9 @@
      * {@link #isStarted()} will return the correct
      * value, and then calls the implementation's {@link #onStopLoading()}.
      *
-     * <p>Must be called from the UI thread.
+     * <p>Must be called from the process's main thread.
      */
-    public final void stopLoading() {
+    public void stopLoading() {
         mStarted = false;
         onStopLoading();
     }
@@ -217,6 +230,7 @@
      * Subclasses must implement this to take care of stopping their loader,
      * as per {@link #stopLoading()}.  This is not called by clients directly,
      * but as a result of a call to {@link #stopLoading()}.
+     * This will always be called from the process's main thread.
      */
     protected void onStopLoading() {
     }
@@ -231,9 +245,9 @@
      * {@link #isStarted()} and {@link #isReset()} will return the correct
      * values, and then calls the implementation's {@link #onReset()}.
      *
-     * <p>Must be called from the UI thread.
+     * <p>Must be called from the process's main thread.
      */
-    public final void reset() {
+    public void reset() {
         onReset();
         mReset = true;
         mStarted = false;
@@ -244,6 +258,7 @@
      * Subclasses must implement this to take care of resetting their loader,
      * as per {@link #reset()}.  This is not called by clients directly,
      * but as a result of a call to {@link #reset()}.
+     * This will always be called from the process's main thread.
      */
     protected void onReset() {
     }
@@ -265,7 +280,7 @@
      * if so, it simply calls {@link #forceLoad()}; otherwise, it sets a flag
      * so that {@link #takeContentChanged()} returns true.
      *
-     * <p>Must be called from the UI thread.
+     * <p>Must be called from the process's main thread.
      */
     public void onContentChanged() {
         if (mStarted) {
diff --git a/core/java/android/database/DatabaseUtils.java b/core/java/android/database/DatabaseUtils.java
index 70a7fb6..f428aad 100644
--- a/core/java/android/database/DatabaseUtils.java
+++ b/core/java/android/database/DatabaseUtils.java
@@ -311,7 +311,6 @@
 
     /**
      * Concatenates two SQL WHERE clauses, handling empty or null values.
-     * @hide
      */
     public static String concatenateWhere(String a, String b) {
         if (TextUtils.isEmpty(a)) {
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index d4bef75..207785c 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -27,6 +27,7 @@
 import android.view.Surface;
 import android.view.SurfaceHolder;
 import android.graphics.ImageFormat;
+import android.graphics.SurfaceTexture;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
@@ -324,8 +325,10 @@
 
     /**
      * Sets the {@link Surface} to be used for live preview.
-     * A surface is necessary for preview, and preview is necessary to take
-     * pictures.  The same surface can be re-set without harm.
+     * Either a surface or surface texture is necessary for preview, and
+     * preview is necessary to take pictures.  The same surface can be re-set
+     * without harm.  Setting a preview surface will un-set any preview surface
+     * texture that was set via {@link #setPreviewTexture}.
      *
      * <p>The {@link SurfaceHolder} must already contain a surface when this
      * method is called.  If you are using {@link android.view.SurfaceView},
@@ -357,6 +360,29 @@
     private native final void setPreviewDisplay(Surface surface);
 
     /**
+     * Sets the {@link SurfaceTexture} to be used for live preview.
+     * Either a surface or surface texture is necessary for preview, and
+     * preview is necessary to take pictures.  The same surface texture can be
+     * re-set without harm.  Setting a preview surface texture will un-set any
+     * preview surface that was set via {@link #setPreviewDisplay}.
+     *
+     * <p>This method must be called before {@link #startPreview()}.  The
+     * one exception is that if the preview surface texture is not set (or set
+     * to null) before startPreview() is called, then this method may be called
+     * once with a non-null parameter to set the preview surface.  (This allows
+     * camera setup and surface creation to happen in parallel, saving time.)
+     * The preview surface texture may not otherwise change while preview is
+     * running.
+     *
+     * @param surfaceTexture the {@link SurfaceTexture} to which the preview
+     *     images are to be sent or null to remove the current preview surface
+     *     texture
+     * @throws IOException if the method fails (for example, if the surface
+     *     texture is unavailable or unsuitable).
+     */
+    public native final void setPreviewTexture(SurfaceTexture surfaceTexture);
+
+    /**
      * Callback interface used to deliver copies of preview frames as
      * they are displayed.
      *
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 873674d2..cec99e9 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3244,8 +3244,8 @@
 
         /**
          * Minimum percentage of free storage on the device that is used to determine if
-         * the device is running low on storage.
-         * Say this value is set to 10, the device is considered running low on storage
+         * the device is running low on storage.  The default is 10.
+         * <p>Say this value is set to 10, the device is considered running low on storage
          * if 90% or more of the device storage is filled up.
          * @hide
          */
@@ -3253,6 +3253,16 @@
                 "sys_storage_threshold_percentage";
 
         /**
+         * Maximum byte size of the low storage threshold.  This is to ensure
+         * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in
+         * an overly large threshold for large storage devices.  Currently this
+         * must be less than 2GB.  This default is 500MB.
+         * @hide
+         */
+        public static final String SYS_STORAGE_THRESHOLD_MAX_BYTES =
+                "sys_storage_threshold_max_bytes";
+
+        /**
          * Minimum bytes of free storage on the device before the data
          * partition is considered full. By default, 1 MB is reserved
          * to avoid system-wide SQLite disk full exceptions.
diff --git a/core/java/android/view/ContextThemeWrapper.java b/core/java/android/view/ContextThemeWrapper.java
index ae938e7..be4152b 100644
--- a/core/java/android/view/ContextThemeWrapper.java
+++ b/core/java/android/view/ContextThemeWrapper.java
@@ -51,6 +51,12 @@
         initializeTheme();
     }
     
+    /** @hide */
+    @Override
+    public int getThemeResId() {
+        return mThemeResource;
+    }
+
     @Override public Resources.Theme getTheme() {
         if (mTheme != null) {
             return mTheme;
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 38777ec..32f0b14 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -10482,17 +10482,17 @@
     /**
      * !!! TODO: real docs
      *
-     * The base class implementation makes the thumbnail the same size and appearance
+     * The base class implementation makes the shadow the same size and appearance
      * as the view itself, and positions it with its center at the touch point.
      */
-    public static class DragThumbnailBuilder {
+    public static class DragShadowBuilder {
         private final WeakReference<View> mView;
 
         /**
-         * Construct a thumbnail builder object for use with the given view.
+         * Construct a shadow builder object for use with the given view.
          * @param view
          */
-        public DragThumbnailBuilder(View view) {
+        public DragShadowBuilder(View view) {
             mView = new WeakReference<View>(view);
         }
 
@@ -10501,56 +10501,57 @@
         }
 
         /**
-         * Provide the draggable-thumbnail metrics for the operation: the dimensions of
-         * the thumbnail image itself, and the point within that thumbnail that should
+         * Provide the draggable-shadow metrics for the operation: the dimensions of
+         * the shadow image itself, and the point within that shadow that should
          * be centered under the touch location while dragging.
          * <p>
-         * The default implementation sets the dimensions of the thumbnail to be the
-         * same as the dimensions of the View itself and centers the thumbnail under
+         * The default implementation sets the dimensions of the shadow to be the
+         * same as the dimensions of the View itself and centers the shadow under
          * the touch point.
          *
-         * @param thumbnailSize The application should set the {@code x} member of this
-         *        parameter to the desired thumbnail width, and the {@code y} member to
+         * @param shadowSize The application should set the {@code x} member of this
+         *        parameter to the desired shadow width, and the {@code y} member to
          *        the desired height.
-         * @param thumbnailTouchPoint The application should set this point to be the
-         *        location within the thumbnail that should track directly underneath
+         * @param shadowTouchPoint The application should set this point to be the
+         *        location within the shadow that should track directly underneath
          *        the touch point on the screen during a drag.
          */
-        public void onProvideThumbnailMetrics(Point thumbnailSize, Point thumbnailTouchPoint) {
+        public void onProvideShadowMetrics(Point shadowSize, Point shadowTouchPoint) {
             final View view = mView.get();
             if (view != null) {
-                thumbnailSize.set(view.getWidth(), view.getHeight());
-                thumbnailTouchPoint.set(thumbnailSize.x / 2, thumbnailSize.y / 2);
+                shadowSize.set(view.getWidth(), view.getHeight());
+                shadowTouchPoint.set(shadowSize.x / 2, shadowSize.y / 2);
             } else {
                 Log.e(View.VIEW_LOG_TAG, "Asked for drag thumb metrics but no view");
             }
         }
 
         /**
-         * Draw the thumbnail image for the upcoming drag.  The thumbnail canvas was
-         * created with the dimensions supplied by the onProvideThumbnailMetrics()
-         * callback.
+         * Draw the shadow image for the upcoming drag.  The shadow canvas was
+         * created with the dimensions supplied by the
+         * {@link #onProvideShadowMetrics(Point, Point)} callback.
          *
          * @param canvas
          */
-        public void onDrawThumbnail(Canvas canvas) {
+        public void onDrawShadow(Canvas canvas) {
             final View view = mView.get();
             if (view != null) {
                 view.draw(canvas);
             } else {
-                Log.e(View.VIEW_LOG_TAG, "Asked to draw drag thumb but no view");
+                Log.e(View.VIEW_LOG_TAG, "Asked to draw drag shadow but no view");
             }
         }
     }
 
     /**
-     * Drag and drop.  App calls startDrag(), then callbacks to the thumbnail builder's
-     * onProvideThumbnailMetrics() and onDrawThumbnail() methods happen, then the drag
+     * Drag and drop.  App calls startDrag(), then callbacks to the shadow builder's
+     * {@link DragShadowBuilder#onProvideShadowMetrics(Point, Point)} and
+     * {@link DragShadowBuilder#onDrawShadow(Canvas)} methods happen, then the drag
      * operation is handed over to the OS.
      * !!! TODO: real docs
      *
      * @param data !!! TODO
-     * @param thumbBuilder !!! TODO
+     * @param shadowBuilder !!! TODO
      * @param myWindowOnly When {@code true}, indicates that the drag operation should be
      *     restricted to the calling application. In this case only the calling application
      *     will see any DragEvents related to this drag operation.
@@ -10563,37 +10564,37 @@
      * @return {@code true} if the drag operation was initiated successfully; {@code false} if
      *     an error prevented the drag from taking place.
      */
-    public final boolean startDrag(ClipData data, DragThumbnailBuilder thumbBuilder,
+    public final boolean startDrag(ClipData data, DragShadowBuilder shadowBuilder,
             boolean myWindowOnly, Object myLocalState) {
         if (ViewDebug.DEBUG_DRAG) {
             Log.d(VIEW_LOG_TAG, "startDrag: data=" + data + " local=" + myWindowOnly);
         }
         boolean okay = false;
 
-        Point thumbSize = new Point();
-        Point thumbTouchPoint = new Point();
-        thumbBuilder.onProvideThumbnailMetrics(thumbSize, thumbTouchPoint);
+        Point shadowSize = new Point();
+        Point shadowTouchPoint = new Point();
+        shadowBuilder.onProvideShadowMetrics(shadowSize, shadowTouchPoint);
 
-        if ((thumbSize.x < 0) || (thumbSize.y < 0) ||
-                (thumbTouchPoint.x < 0) || (thumbTouchPoint.y < 0)) {
-            throw new IllegalStateException("Drag thumb dimensions must not be negative");
+        if ((shadowSize.x < 0) || (shadowSize.y < 0) ||
+                (shadowTouchPoint.x < 0) || (shadowTouchPoint.y < 0)) {
+            throw new IllegalStateException("Drag shadow dimensions must not be negative");
         }
 
         if (ViewDebug.DEBUG_DRAG) {
-            Log.d(VIEW_LOG_TAG, "drag thumb: width=" + thumbSize.x + " height=" + thumbSize.y
-                    + " thumbX=" + thumbTouchPoint.x + " thumbY=" + thumbTouchPoint.y);
+            Log.d(VIEW_LOG_TAG, "drag shadow: width=" + shadowSize.x + " height=" + shadowSize.y
+                    + " shadowX=" + shadowTouchPoint.x + " shadowY=" + shadowTouchPoint.y);
         }
         Surface surface = new Surface();
         try {
             IBinder token = mAttachInfo.mSession.prepareDrag(mAttachInfo.mWindow,
-                    myWindowOnly, thumbSize.x, thumbSize.y, surface);
+                    myWindowOnly, shadowSize.x, shadowSize.y, surface);
             if (ViewDebug.DEBUG_DRAG) Log.d(VIEW_LOG_TAG, "prepareDrag returned token=" + token
                     + " surface=" + surface);
             if (token != null) {
                 Canvas canvas = surface.lockCanvas(null);
                 try {
                     canvas.drawColor(0, PorterDuff.Mode.CLEAR);
-                    thumbBuilder.onDrawThumbnail(canvas);
+                    shadowBuilder.onDrawShadow(canvas);
                 } finally {
                     surface.unlockCanvasAndPost(canvas);
                 }
@@ -10603,12 +10604,12 @@
                 // Cache the local state object for delivery with DragEvents
                 root.setLocalDragState(myLocalState);
 
-                // repurpose 'thumbSize' for the last touch point
-                root.getLastTouchPoint(thumbSize);
+                // repurpose 'shadowSize' for the last touch point
+                root.getLastTouchPoint(shadowSize);
 
                 okay = mAttachInfo.mSession.performDrag(mAttachInfo.mWindow, token,
-                        thumbSize.x, thumbSize.y,
-                        thumbTouchPoint.x, thumbTouchPoint.y, data);
+                        shadowSize.x, shadowSize.y,
+                        shadowTouchPoint.x, shadowTouchPoint.y, data);
                 if (ViewDebug.DEBUG_DRAG) Log.d(VIEW_LOG_TAG, "performDrag returned " + okay);
             }
         } catch (Exception e) {
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index 8c7205e..f659ead 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -265,11 +265,13 @@
             final View child = getChildAt(i);
             if (mMeasureAllChildren || child.getVisibility() != GONE) {
                 measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, 0);
-                maxWidth = Math.max(maxWidth, child.getMeasuredWidth());
-                maxHeight = Math.max(maxHeight, child.getMeasuredHeight());
+                final LayoutParams lp = (LayoutParams) child.getLayoutParams();
+                maxWidth = Math.max(maxWidth,
+                        child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin);
+                maxHeight = Math.max(maxHeight,
+                        child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin);
                 childState = combineMeasuredStates(childState, child.getMeasuredState());
                 if (measureMatchParentChildren) {
-                    final ViewGroup.LayoutParams lp = child.getLayoutParams();
                     if (lp.width == LayoutParams.MATCH_PARENT ||
                             lp.height == LayoutParams.MATCH_PARENT) {
                         mMatchParentChildren.add(child);
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index 5a08442..0102628 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -25,7 +25,6 @@
 import android.database.DataSetObserver;
 import android.util.AttributeSet;
 import android.util.DisplayMetrics;
-import android.util.Log;
 import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
@@ -262,7 +261,6 @@
             setMeasuredDimension(Math.min(Math.max(measuredWidth, mPopup.measureContentWidth()),
                     MeasureSpec.getSize(widthMeasureSpec)),
                     getMeasuredHeight());
-            Log.d(TAG, "onMeasure - old measured width " + measuredWidth + " new " + getMeasuredWidth());
         }
     }
 
@@ -672,6 +670,10 @@
         @Override
         public int measureContentWidth() {
             final SpinnerAdapter adapter = getAdapter();
+            if (adapter == null) {
+                return 0;
+            }
+
             int width = 0;
             View itemView = null;
             int itemType = 0;
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index 8fb6fa3..cd4b732 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -479,9 +479,9 @@
     }
 
     private void animateThumbToCheckedState(boolean newCheckedState) {
-        float targetPos = newCheckedState ? 0 : getThumbScrollRange();
         // TODO animate!
-        mThumbPosition = targetPos;
+        //float targetPos = newCheckedState ? 0 : getThumbScrollRange();
+        //mThumbPosition = targetPos;
         setChecked(newCheckedState);
     }
 
@@ -493,12 +493,15 @@
     public void setChecked(boolean checked) {
         super.setChecked(checked);
         mThumbPosition = checked ? 0 : getThumbScrollRange();
+        invalidate();
     }
 
     @Override
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
         super.onLayout(changed, left, top, right, bottom);
 
+        mThumbPosition = isChecked() ? 0 : getThumbScrollRange();
+
         int switchRight = getWidth() - getPaddingRight();
         int switchLeft = switchRight - mSwitchWidth;
         int switchTop = 0;
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 6a2a09a..af3ffe5 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -8036,32 +8036,32 @@
         return packRangeInLong(min, max);
     }
 
-    private DragThumbnailBuilder getTextThumbnailBuilder(CharSequence text) {
-        TextView thumbnail = (TextView) inflate(mContext,
+    private DragShadowBuilder getTextThumbnailBuilder(CharSequence text) {
+        TextView shadowView = (TextView) inflate(mContext,
                 com.android.internal.R.layout.text_drag_thumbnail, null);
 
-        if (thumbnail == null) {
+        if (shadowView == null) {
             throw new IllegalArgumentException("Unable to inflate text drag thumbnail");
         }
 
-        if (text.length() > DRAG_THUMBNAIL_MAX_TEXT_LENGTH) {
-            text = text.subSequence(0, DRAG_THUMBNAIL_MAX_TEXT_LENGTH);
+        if (text.length() > DRAG_SHADOW_MAX_TEXT_LENGTH) {
+            text = text.subSequence(0, DRAG_SHADOW_MAX_TEXT_LENGTH);
         }
-        thumbnail.setText(text);
-        thumbnail.setTextColor(getTextColors());
+        shadowView.setText(text);
+        shadowView.setTextColor(getTextColors());
 
-        thumbnail.setTextAppearance(mContext, R.styleable.Theme_textAppearanceLarge);
-        thumbnail.setGravity(Gravity.CENTER);
+        shadowView.setTextAppearance(mContext, R.styleable.Theme_textAppearanceLarge);
+        shadowView.setGravity(Gravity.CENTER);
 
-        thumbnail.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
+        shadowView.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
                 ViewGroup.LayoutParams.WRAP_CONTENT));
 
         final int size = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
-        thumbnail.measure(size, size);
+        shadowView.measure(size, size);
 
-        thumbnail.layout(0, 0, thumbnail.getMeasuredWidth(), thumbnail.getMeasuredHeight());
-        thumbnail.invalidate();
-        return new DragThumbnailBuilder(thumbnail);
+        shadowView.layout(0, 0, shadowView.getMeasuredWidth(), shadowView.getMeasuredHeight());
+        shadowView.invalidate();
+        return new DragShadowBuilder(shadowView);
     }
 
     private static class DragLocalState {
@@ -9503,7 +9503,7 @@
     private static final InputFilter[] NO_FILTERS = new InputFilter[0];
     private InputFilter[] mFilters = NO_FILTERS;
     private static final Spanned EMPTY_SPANNED = new SpannedString("");
-    private static int DRAG_THUMBNAIL_MAX_TEXT_LENGTH = 20;
+    private static int DRAG_SHADOW_MAX_TEXT_LENGTH = 20;
     // System wide time for last cut or copy action.
     private static long sLastCutOrCopyTime;
     // Used to highlight a word when it is corrected by the IME
diff --git a/core/java/com/android/internal/app/HeavyWeightSwitcherActivity.java b/core/java/com/android/internal/app/HeavyWeightSwitcherActivity.java
index 1984167..ef7e651 100644
--- a/core/java/com/android/internal/app/HeavyWeightSwitcherActivity.java
+++ b/core/java/com/android/internal/app/HeavyWeightSwitcherActivity.java
@@ -28,6 +28,7 @@
 import android.os.Bundle;
 import android.os.RemoteException;
 import android.util.Log;
+import android.util.TypedValue;
 import android.view.View;
 import android.view.Window;
 import android.view.View.OnClickListener;
@@ -84,8 +85,10 @@
         button = findViewById((R.id.cancel));
         button.setOnClickListener(mCancelListener);
         
+        TypedValue out = new TypedValue();
+        getTheme().resolveAttribute(android.R.attr.alertDialogIcon, out, true);
         getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, 
-                android.R.drawable.ic_dialog_alert);
+                out.resourceId);
     }
 
     void setText(int id, CharSequence text) {
diff --git a/core/java/com/android/internal/app/ShutdownThread.java b/core/java/com/android/internal/app/ShutdownThread.java
index cbdb947..d1c3e64 100644
--- a/core/java/com/android/internal/app/ShutdownThread.java
+++ b/core/java/com/android/internal/app/ShutdownThread.java
@@ -109,7 +109,7 @@
         if (confirm) {
             final CloseDialogReceiver closer = new CloseDialogReceiver(context);
             final AlertDialog dialog = new AlertDialog.Builder(context)
-                    .setIcon(android.R.drawable.ic_dialog_alert)
+                    .setIconAttribute(android.R.attr.alertDialogIcon)
                     .setTitle(com.android.internal.R.string.power_off)
                     .setMessage(resourceId)
                     .setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() {
diff --git a/core/java/com/android/internal/view/menu/ActionMenuView.java b/core/java/com/android/internal/view/menu/ActionMenuView.java
index 2c5baba..9381675 100644
--- a/core/java/com/android/internal/view/menu/ActionMenuView.java
+++ b/core/java/com/android/internal/view/menu/ActionMenuView.java
@@ -66,9 +66,10 @@
         }
 
         public void run() {
-            mOverflowPopup = mPopup;
-            mPopup.show();
-            mPostedOpenRunnable = null;
+            if (mPopup.tryShow()) {
+                mOverflowPopup = mPopup;
+                mPostedOpenRunnable = null;
+            }
         }
     }
 
diff --git a/core/java/com/android/internal/view/menu/MenuPopupHelper.java b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
index a070835..fe41f52 100644
--- a/core/java/com/android/internal/view/menu/MenuPopupHelper.java
+++ b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
@@ -69,6 +69,12 @@
     }
 
     public void show() {
+        if (!tryShow()) {
+            throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor");
+        }
+    }
+
+    public boolean tryShow() {
         mPopup = new ListPopupWindow(mContext, null, com.android.internal.R.attr.popupMenuStyle);
         mPopup.setOnItemClickListener(this);
         mPopup.setOnDismissListener(this);
@@ -92,13 +98,14 @@
             mTreeObserver.addOnGlobalLayoutListener(this);
             mPopup.setAnchorView(anchor);
         } else {
-            throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor");
+            return false;
         }
 
         mPopup.setContentWidth(Math.min(measureContentWidth(adapter), mPopupMaxWidth));
         mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
         mPopup.show();
         mPopup.getListView().setOnKeyListener(this);
+        return true;
     }
 
     public void dismiss() {
diff --git a/core/java/com/android/internal/widget/ActionBarContextView.java b/core/java/com/android/internal/widget/ActionBarContextView.java
index 5ae3616..23f89f1 100644
--- a/core/java/com/android/internal/widget/ActionBarContextView.java
+++ b/core/java/com/android/internal/widget/ActionBarContextView.java
@@ -159,7 +159,7 @@
     }
 
     public void initForMode(final ActionMode mode) {
-        if (mAnimationMode == ANIMATE_OUT) {
+        if (mAnimationMode != ANIMATE_IDLE || mAnimateInOnLayout) {
             killMode();
         }
 
@@ -216,6 +216,7 @@
         removeAllViews();
         mCustomView = null;
         mMenuView = null;
+        mAnimateInOnLayout = false;
     }
 
     public boolean showOverflowMenu() {
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index 10fe583..9f70509 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -25,6 +25,7 @@
 
 #include <utils/Vector.h>
 
+#include <gui/SurfaceTexture.h>
 #include <surfaceflinger/Surface.h>
 #include <camera/Camera.h>
 #include <binder/IMemory.h>
@@ -34,6 +35,7 @@
 struct fields_t {
     jfieldID    context;
     jfieldID    surface;
+    jfieldID    surfaceTexture;
     jfieldID    facing;
     jfieldID    orientation;
     jmethodID   post_event;
@@ -393,6 +395,24 @@
     }
 }
 
+static void android_hardware_Camera_setPreviewTexture(JNIEnv *env,
+        jobject thiz, jobject jSurfaceTexture)
+{
+    LOGV("setPreviewTexture");
+    sp<Camera> camera = get_native_camera(env, thiz, NULL);
+    if (camera == 0) return;
+
+    sp<SurfaceTexture> surfaceTexture = NULL;
+    if (jSurfaceTexture != NULL) {
+        surfaceTexture = reinterpret_cast<SurfaceTexture*>(env->GetIntField(
+                jSurfaceTexture, fields.surfaceTexture));
+    }
+    if (camera->setPreviewTexture(surfaceTexture) != NO_ERROR) {
+        jniThrowException(env, "java/io/IOException",
+                "setPreviewTexture failed");
+    }
+}
+
 static void android_hardware_Camera_startPreview(JNIEnv *env, jobject thiz)
 {
     LOGV("startPreview");
@@ -603,6 +623,9 @@
   { "setPreviewDisplay",
     "(Landroid/view/Surface;)V",
     (void *)android_hardware_Camera_setPreviewDisplay },
+  { "setPreviewTexture",
+    "(Landroid/graphics/SurfaceTexture;)V",
+    (void *)android_hardware_Camera_setPreviewTexture },
   { "startPreview",
     "()V",
     (void *)android_hardware_Camera_startPreview },
@@ -688,6 +711,8 @@
     field fields_to_find[] = {
         { "android/hardware/Camera", "mNativeContext",   "I", &fields.context },
         { "android/view/Surface",    ANDROID_VIEW_SURFACE_JNI_ID, "I", &fields.surface },
+        { "android/graphics/SurfaceTexture",
+          ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID, "I", &fields.surfaceTexture },
         { "android/hardware/Camera$CameraInfo", "facing",   "I", &fields.facing },
         { "android/hardware/Camera$CameraInfo", "orientation",   "I", &fields.orientation },
     };
@@ -708,4 +733,3 @@
     return AndroidRuntime::registerNativeMethods(env, "android/hardware/Camera",
                                               camMethods, NELEM(camMethods));
 }
-
diff --git a/core/res/res/drawable-hdpi/ic_dialog_alert_holo_dark.png b/core/res/res/drawable-hdpi/ic_dialog_alert_holo_dark.png
new file mode 100644
index 0000000..f0ba889
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_dialog_alert_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_dialog_alert_holo_light.png b/core/res/res/drawable-hdpi/ic_dialog_alert_holo_light.png
new file mode 100644
index 0000000..1374a53
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_dialog_alert_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_dialog_alert_holo_dark.png b/core/res/res/drawable-mdpi/ic_dialog_alert_holo_dark.png
new file mode 100644
index 0000000..75d9db7
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_dialog_alert_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_dialog_alert_holo_light.png b/core/res/res/drawable-mdpi/ic_dialog_alert_holo_light.png
new file mode 100644
index 0000000..9e7f0bd
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_dialog_alert_holo_light.png
Binary files differ
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 7275ef4..b8b9e6c 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -636,6 +636,8 @@
         <attr name="dialogTheme" format="reference" />
         <!-- Theme to use for alert dialogs spawned from this theme. -->
         <attr name="alertDialogTheme" format="reference" />
+        <!-- Icon drawable to use for alerts -->
+        <attr name="alertDialogIcon" format="reference" />
 
         <!-- Drawable to use for generic vertical dividers. -->
         <attr name="dividerVertical" format="reference" />
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 0ce351c..c2a848d 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1421,6 +1421,7 @@
   <public type="attr" name="editTextBackground" />
   <public type="attr" name="horizontalScrollViewStyle" />
   <public type="attr" name="layerType" />
+  <public type="attr" name="alertDialogIcon" />
 
   <!-- A simple fade-in animation. -->
   <public type="animator" name="fade_in" id="0x010b0000" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 09842f0..7c6dbe3 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2152,7 +2152,8 @@
     <!-- Preference framework strings. -->
     <string name="no">Cancel</string>
     <!-- This is the generic "attention" string to be used in attention dialogs.  Typically
-         combined with setIcon(android.R.drawable.ic_dialog_alert) -->
+         combined with setIconAttribute(android.R.attr.alertDialogIcon)
+         (or setIcon(android.R.drawable.ic_dialog_alert) on legacy versions of the platform) -->
     <string name="dialog_alert_title">Attention</string>
 
     <!-- Text shown by list fragment when waiting for data to display. -->
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 231e570a..ed8b20d 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -144,6 +144,7 @@
         <item name="dialogTheme">@android:style/Theme.Dialog</item>
         <item name="alertDialogTheme">@android:style/Theme.Dialog.Alert</item>
         <item name="alertDialogCenterButtons">true</item>
+        <item name="alertDialogIcon">@android:drawable/ic_dialog_alert</item>
         
         <!-- Panel attributes -->
         <item name="panelBackground">@android:drawable/menu_background</item>
@@ -808,6 +809,7 @@
         <item name="dialogTheme">@android:style/Theme.Holo.Dialog</item>
         <item name="alertDialogTheme">@android:style/Theme.Holo.Dialog.Alert</item>
         <item name="alertDialogCenterButtons">false</item>
+        <item name="alertDialogIcon">@android:drawable/ic_dialog_alert_holo_dark</item>
         
         <!-- Panel attributes -->
         <item name="panelBackground">@android:drawable/menu_background</item>
@@ -1064,6 +1066,7 @@
         <item name="alertDialogStyle">@android:style/AlertDialog.Holo.Light</item>
         <item name="dialogTheme">@android:style/Theme.Holo.Light.Dialog</item>
         <item name="alertDialogTheme">@android:style/Theme.Holo.Light.Dialog.Alert</item>
+        <item name="alertDialogIcon">@android:drawable/ic_dialog_alert_holo_light</item>
         
         <!-- Panel attributes -->
         <item name="panelBackground">@android:drawable/menu_background</item>
diff --git a/core/tests/coretests/apks/install_uses_feature/Android.mk b/core/tests/coretests/apks/install_uses_feature/Android.mk
new file mode 100644
index 0000000..c0a5067
--- /dev/null
+++ b/core/tests/coretests/apks/install_uses_feature/Android.mk
@@ -0,0 +1,11 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_uses_feature
+
+include $(BUILD_PACKAGE)
+
diff --git a/core/tests/coretests/apks/install_uses_feature/AndroidManifest.xml b/core/tests/coretests/apks/install_uses_feature/AndroidManifest.xml
new file mode 100644
index 0000000..ecbd7c4
--- /dev/null
+++ b/core/tests/coretests/apks/install_uses_feature/AndroidManifest.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+        package="com.android.frameworks.coretests.install_uses_feature">
+
+    <uses-feature android:name="com.android.frameworks.coretests.nonexistent" />
+        
+    <application android:hasCode="false">
+    </application>
+</manifest>
diff --git a/core/tests/coretests/apks/install_uses_feature/res/values/strings.xml b/core/tests/coretests/apks/install_uses_feature/res/values/strings.xml
new file mode 100644
index 0000000..3b8b3b1
--- /dev/null
+++ b/core/tests/coretests/apks/install_uses_feature/res/values/strings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- Just need this dummy file to have something to build. -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+  <string name="dummy">dummy</string>
+</resources>
diff --git a/core/tests/coretests/res/raw/install_uses_feature b/core/tests/coretests/res/raw/install_uses_feature
new file mode 100644
index 0000000..769a246
--- /dev/null
+++ b/core/tests/coretests/res/raw/install_uses_feature
Binary files differ
diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
index d5f385b..30a43c3 100755
--- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
+++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
@@ -23,6 +23,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.pm.PackageManager;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.res.Resources;
 import android.content.res.Resources.NotFoundException;
@@ -215,7 +216,7 @@
         }
     }
 
-    public void invokeInstallPackageFail(Uri packageURI, int flags, int result) {
+    public void invokeInstallPackageFail(Uri packageURI, int flags, int expectedResult) {
         PackageInstallObserver observer = new PackageInstallObserver();
         try {
             // Wait on observer
@@ -233,7 +234,7 @@
                 if(!observer.isDone()) {
                     fail("Timed out waiting for packageInstalled callback");
                 }
-                assertEquals(observer.returnCode, result);
+                assertEquals(expectedResult, observer.returnCode);
             }
         } finally {
         }
@@ -2838,6 +2839,13 @@
         installFromRawResource("install.apk", rapk2, PackageManager.INSTALL_REPLACE_EXISTING, true,
                 fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
     }
+
+    @LargeTest
+    public void testUsesFeatureMissingFeature() {
+        int retCode = PackageManager.INSTALL_FAILED_MISSING_FEATURE;
+        installFromRawResource("install.apk", R.raw.install_uses_feature, 0, true, true, retCode,
+                PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
+    }
     /*---------- Recommended install location tests ----*/
     /*
      * TODO's
diff --git a/docs/html/guide/appendix/api-levels.jd b/docs/html/guide/appendix/api-levels.jd
index 5898fe5..6ab0fc2 100644
--- a/docs/html/guide/appendix/api-levels.jd
+++ b/docs/html/guide/appendix/api-levels.jd
@@ -294,12 +294,11 @@
 <p>To run your application against different platform versions in the emulator,
 create an AVD for each platform version that you want to test. For more
 information about AVDs, see <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>. If
+href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a>. If
 you are using a physical device for testing, ensure that you know the API Level
 of the Android platform it runs. See the table at the top of this document for
 a list of platform versions and their API Levels. </p>
 
-
 <h2 id="provisional">Using a Provisional API Level</h2>
 
 <p>In some cases, an "Early Look" Android SDK platform may be available. To let
diff --git a/docs/html/guide/appendix/glossary.jd b/docs/html/guide/appendix/glossary.jd
index 97669ba..06fdef2 100644
--- a/docs/html/guide/appendix/glossary.jd
+++ b/docs/html/guide/appendix/glossary.jd
@@ -91,8 +91,7 @@
     with the SDK. It provides screen capture, log dump, and process
     examination capabilities. If you are developing in Eclipse using the ADT
     Plugin, DDMS is integrated into your development environment. See <a
-    href="{@docRoot}guide/developing/tools/ddms.html">Dalvik Debug Monitor
-    Server</a> to learn more about the program.</dd>
+    href="{@docRoot}guide/developing/debugging/ddms.html">Using DDMS</a> to learn more about the program.</dd>
 
     <dt id="dialog">Dialog</dt> <dd> A floating window that that acts as a lightweight
     form. A dialog can have button controls only and is intended to perform a
diff --git a/docs/html/guide/developing/building/building-cmdline.jd b/docs/html/guide/developing/building/building-cmdline.jd
index 934e936..f40ad04 100644
--- a/docs/html/guide/developing/building/building-cmdline.jd
+++ b/docs/html/guide/developing/building/building-cmdline.jd
@@ -1,4 +1,4 @@
-page.title=Building and Running Apps in Other IDEs
+page.title=Building and Running Apps on the Command Line
 @jd:body
 
  <div id="qv-wrapper">
diff --git a/docs/html/guide/developing/building/index.jd b/docs/html/guide/developing/building/index.jd
index 83a7bb3..b001ebc 100644
--- a/docs/html/guide/developing/building/index.jd
+++ b/docs/html/guide/developing/building/index.jd
@@ -1,4 +1,4 @@
-page.title=Building and Running Applications
+page.title=Building and Running Apps
 @jd:body
 
 <div id="qv-wrapper">
@@ -54,6 +54,7 @@
   <p>The general process for a typical build is outlined below:</p>
 
   <ul>
+  
     <li>The Android Asset Packaging Tool (aapt) takes your application resource files, such as the
     <code>AndroidManifest.xml</code> file and the XML files for your Activities, and compiles them. An <code>R.java</code> is
     also produced so you can reference your resources from your Java code.</li>
diff --git a/docs/html/guide/developing/debug-tasks.html b/docs/html/guide/developing/debug-tasks.html
new file mode 100644
index 0000000..4e738041
--- /dev/null
+++ b/docs/html/guide/developing/debug-tasks.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/debugging/index.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/guide/developing/debugging/index.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/debug-tasks.jd b/docs/html/guide/developing/debug-tasks.jd
deleted file mode 100644
index 8f40b48..0000000
--- a/docs/html/guide/developing/debug-tasks.jd
+++ /dev/null
@@ -1,232 +0,0 @@
-page.title=Debugging Tasks
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-  <h2>In this document</h2>
-  <ol>
-    <li><a href="#tools">Tools</a></li>
-    <li><a href="#additionaldebugging">Debug with Dev Tools</a></li>
-    <li><a href="#DebuggingWebPages">Debugging Web Pages</a></li>
-    <li><a href="#toptips">Top Debugging Tips</a></li>
-    <li><a href="#ide-debug-port">Configuring Your IDE to Attach to the Debugging Port</a></li>
-  </ol>
-</div>
-</div>
-
-<p>This document offers some helpful guidance to debugging applications on Android.
-
-
-<h2 id="tools">Tools</h2>
-
-<p>The Android SDK includes a set of tools to help you debug and profile
-your applications. Here are some tools that you'll use most often:</p>
-
-<dl>
-  <dt><strong><a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge
-(ADB)</a></strong></dt>
-  <dd>Provides various device management capabilities, including
-    moving and syncing files to the emulator, forwarding ports, and running a UNIX
-    shell on the emulator.</dd>
-  <dt><strong><a href="{@docRoot}guide/developing/tools/ddms.html">Dalvik Debug Monitor Server
-(DDMS)</a></strong></dt>
-  <dd>A graphical program that
-        supports port forwarding (so you can set up breakpoints in your code in your
-        IDE), screen captures on the emulator, thread and stack information,
-        and many other features. You can also run logcat to retrieve your Log messages.</dd>
-  </dd>
-  <dt><strong><a href="{@docRoot}guide/developing/tools/traceview.html">Traceview</a></strong></dt>
-  <dd>A graphical viewer that displays trace file data for method calls and times saved by
-  your application, which can help you profile the performance of your application.</dd>
-  <dt><strong><a href="{@docRoot}guide/developing/tools/ddms.html#logcat">logcat</a></strong></dt>
-  <dd>Dumps a log of system
-      messages. The messages include a stack trace when the device throws an error,
-      as well as {@link android.util.Log} messages you've written from your application. To run
-      logcat, execute <code>adb logcat</code> from your Android SDK {@code platform-tools/}
-directory or, from DDMS, select <strong>Device > Run
-      logcat</strong>. When using the <a href="{@docRoot}sdk/eclipse-adt.html">ADT plugin for
-Eclipse</a>, you can also view logcat messages by opening the Logcat view, available from
-<strong>Window > Show View > Other > Android > Logcat</strong>.
-      <p>{@link android.util.Log} is a logging
-      class you can use to print out messages to the logcat. You can read messages
-      in real time if you run logcat on DDMS (covered next). Common logging methods include:
-      {@link android.util.Log#v(String,String)} (verbose), {@link
-      android.util.Log#d(String,String)} (debug), {@link android.util.Log#i(String,String)}
-      (information), {@link android.util.Log#w(String,String)} (warning) and {@link
-      android.util.Log#e(String,String)} (error). For example:</p>
-<pre class="no-pretty-print">
-Log.i("MyActivity", "MyClass.getView() &mdash; get item number " + position);
-</pre>
-      <p>The logcat will then output something like:</p>
-<pre class="no-pretty-print">
-I/MyActivity( 1557): MyClass.getView() &mdash; get item number 1
-</pre>
-      <p>Logcat is also the place to look when debugging a web page in the Android Browser app. See
-<a href="#DebuggingWebPages">Debugging Web Pages</a> below.</p>
-</dl>
-
-<p>For more information about all the development tools provided with the Android SDK, see the <a
-href="{@docRoot}guide/developing/tools/index.html">Tools</a> document.</p>
-
-<p>In addition to the above tools, you may also find the following useful for debugging:
-<dl>
-  <dt><a href="{@docRoot}guide/developing/eclipse-adt.html"><strong>Eclipse ADT
-plugin</strong></a></dt>
-  <dd>The ADT Plugin for Eclipse integrates a number of the Android development tools (ADB, DDMS,
-logcat output, and other functionality), so that you won't work with them directly but will utilize
-them through the Eclipse IDE.</dd>
-  <dt><strong>Developer Settings in the Dev Tools app</strong></dt>
-  <dd>The Dev Tools application included in the emulator system image exposes several settings
-        that provide useful information such as CPU usage and frame rate. See <a
-href="#additionaldebugging">Debugging and Testing with Dev Tools</a> below.</dd>
-</dl>
-
-<h2 id="additionaldebugging">Debugging and Testing with Dev Tools</h2>
-
-<p>With the Dev Tools application, you can enable a number of settings on your device that will
-make it easier to test and debug your applications.</p>
-
-<p>The Dev Tools application is installed by default
-on all system images included with the SDK, so you can use it with the Android Emulator. If you'd
-like to install the Dev Tools application on a real development device, you can copy the
-application from your emulator and then install it on your device using ADB. To copy the
-application from a running emulator, execute:
-</p>
-<pre>
-adb -e pull /system/app/Development.apk ./Development.apk
-</pre>
-<p>This copies the .apk file into the current directory. Then install it on your connected device
-with:</p>
-<pre>
-adb -d install Development.apk
-</pre>
-
-<p>To get started, launch the Dev Tools application and
-select Development Settings. This will open the Development Settings page with the
-following options (among others):</p>
-
-<dl>
-    <dt><strong>Debug app</strong></dt>
-    <dd>Lets you select the application to debug. You do not need to set this to attach a debugger,
-    but setting this value has two effects:
-        <ul>
-            <li>It will prevent Android from throwing an error if you pause on
-                    a breakpoint for a long time while debugging.</li>
-            <li>It will enable you to select the <em>Wait for Debugger</em> option
-                to pause application startup until your debugger attaches (described
-                next). </li>
-        </ul>
-    </dd>
-    <dt><strong>Wait for debugger</strong></dt>
-    <dd>Blocks the selected application from loading until a debugger attaches. This
-            way you can set a breakpoint in onCreate(), which is important to debug
-            the startup process of an Activity. When you change this option, any
-            currently running instances of the selected application will be killed.
-            In order to check this box, you must have selected a debug application
-            as described in the previous option. You can do the same thing by adding
-            {@link android.os.Debug#waitForDebugger()} to your code.</dd>
-    <dt><strong>Show screen updates</strong></dt>
-    <dd>Flashes a momentary pink rectangle on any screen sections that are being
-            redrawn. This is very useful for discovering unnecessary screen drawing.</dd>
-    <dt><strong>Immediately destroy activities</strong></dt>
-    <dd>Tells the
-        system to destroy an activity as soon as it is stopped (as if Android had to
-        reclaim memory).&nbsp; This is very useful for testing the {@link android.app.Activity#onSaveInstanceState}
-        / {@link android.app.Activity#onCreate(android.os.Bundle)} code path, which would
-        otherwise be difficult to force. Choosing this option will probably reveal
-        a number of problems in your application due to not saving state.</dd>
-    <dt><strong>Show CPU usage</strong></dt>
-    <dd>Displays CPU meters at the
-        top of the screen, showing how much the CPU is being used. The top red bar
-        shows overall CPU usage, and the green bar underneath it shows the CPU time
-        spent in compositing the screen. <em>Note: You cannot turn this feature off
-        once it is on, without restarting the emulator.</em> </dd>
-    <dt><strong>Show background</strong></dt>
-    <dd>Displays a background pattern
-        when no activity screens are visible. This typically does not happen, but
-        can happen during debugging.</dd>
-</dl>
-
-<p>These settings will be remembered across emulator restarts.</p>
-
-<h2 id="DebuggingWebPages">Debugging Web Pages</h2>
-
-<p>See the <a href="{@docRoot}guide/webapps/debugging.html">Debugging Web Apps</a> document.</p>
-
-
-<h2 id="toptips">Top Debugging Tips</h2>
-
-<dl>
-<dt><strong>Dump the stack trace</strong></dt>
-<dd>To obtain a stack dump from emulator, you can log
-in with <code>adb shell</code>, use &quot;ps&quot; to find the process you
-want, and then &quot;kill -3 &quot;. The stack trace appears in the log file.
-</dd>
-
-<dt><strong>Display useful info on the emulator screen</strong></dt>
-<dd>The device can display useful information such as CPU usage or highlights
-around redrawn areas. Turn these features on and off in the developer settings
-window as described in <a href="#additionaldebugging">Setting debug and test
-configurations on the emulator</a>.
-</dd>
-
-<dt><strong>Get system state information from the emulator (dumpstate)</strong></dt>
-<dd>You can access dumpstate information from the Dalvik Debug Monitor Service
-tool. See <a href="{@docRoot}guide/developing/tools/adb.html#dumpsys">dumpsys and
-dumpstate</a> on the adb topic page.</dd>
-
-<dt><strong>Get application state information from the emulator (dumpsys)</strong></dt>
-<dd>You can access dumpsys information from the Dalvik Debug Monitor Service
-tool. See <a href="{@docRoot}guide/developing/tools/adb.html#dumpsys">dumpsys and
-dumpstate</a> on the adb topic page.</dd>
-
-<dt><strong>Get wireless connectivity information</strong></dt>
-<dd>You can get information about wireless connectivity using the Dalvik Debug
-Monitor Service tool. From the <strong>Device</strong> menu, select &quot;Dump
-radio state&quot;.</dd>
-
-<dt><strong>Log trace data</strong></dt>
-<dd>You can log method calls and other tracing data in an activity by calling
-{@link android.os.Debug#startMethodTracing(String) startMethodTracing()}. See <a
-href="{@docRoot}guide/developing/tools/traceview.html">Running the Traceview Debugging
-Program</a> for details. </dd>
-
-<dt><strong>Log radio data</strong></dt>
-<dd>By default, radio information is not logged to the system (it is a lot of
-data). However, you can enable radio logging using the following commands:
-
-<pre class="no-pretty-print">
-adb shell
-logcat -b radio
-</pre>
-</dd>
-
-<dt><strong>Capture screenshots</strong></dt>
-<dd>The Dalvik Debug Monitor Server (DDMS) can capture screenshots from the emulator. Select
-<strong>Device > Screen capture</strong>.</dd>
-
-<dt><strong>Use debugging helper classes</strong></dt>
-<dd>Android provides debug helper classes such as {@link android.util.Log
-    util.Log} and {@link android.os.Debug} for your convenience. </dd>
-</dl>
-
-<p>Also see the <a href="{@docRoot}resources/faq/troubleshooting.html">Troubleshooting</a> document
-for answers to some common developing and debugging issues.</p>
-
-
-<h2 id="ide-debug-port">Configuring Your IDE to Attach to the Debugging Port</h2>
-
-<p>DDMS will assign a specific debugging port to every virtual machine that it
-    finds on the emulator. You must either attach your IDE to that
-    port (listed on the Info tab for that VM), or you can use a default port 8700
-    to connect to whatever application is currently selected on the list of discovered
-    virtual machines.</p>
-<p>Your IDE should attach to your application running on the emulator, showing you
-    its threads and allowing you to suspend them, inspect their state, and set breakpoints.
-    If you selected &quot;Wait for debugger&quot; in the Development settings panel
-    the application will run when Eclipse connects, so you will need to set any breakpoints
-    you want before connecting.</p>
-<p>Changing either the application being debugged or the &quot;Wait for debugger&quot;
-    option causes the system to kill the selected application if it is currently
-        running. You can use this to kill your application if it is in a bad state
-        by simply going to the settings and toggling the checkbox.</p>
diff --git a/docs/html/guide/developing/debugging/ddms.jd b/docs/html/guide/developing/debugging/ddms.jd
index d22ad2f..8f5e706 100644
--- a/docs/html/guide/developing/debugging/ddms.jd
+++ b/docs/html/guide/developing/debugging/ddms.jd
@@ -280,5 +280,5 @@
   </ul>
   
   For more information about providing mock location data, see 
-  <a href="guide/topics/location/obtaining-user-location.html#MockData">Obtaining User Location</a>.
+  <a href="{@docRoot}guide/topics/location/obtaining-user-location.html#MockData">Obtaining User Location</a>.
   
diff --git a/docs/html/guide/developing/debugging/debugging-tracing.jd b/docs/html/guide/developing/debugging/debugging-tracing.jd
index cfa1bb1..dcc889d 100644
--- a/docs/html/guide/developing/debugging/debugging-tracing.jd
+++ b/docs/html/guide/developing/debugging/debugging-tracing.jd
@@ -204,9 +204,9 @@
   <h2 id="creatingtracefiles">Creating Trace Files</h2>
 
   <p>To use Traceview, you need to generate log files containing the trace information you want to
-  analyze.<p>
+  analyze.</p>
   
-  <p>There are two ways to generate trace logs:<p>
+  <p>There are two ways to generate trace logs:</p>
   <ul>
     <li>Include the {@link android.os.Debug} class in your code and call its
   methods to start and stop logging of trace information to disk. This method is very precise because
@@ -293,7 +293,7 @@
   <p class="note"><strong>Note:</strong> If you are trying to view the trace logs of an application 
   that is built with ProGuard enabled (release mode build), some method and member names might be obfuscated.
   You can use the Proguard <code>mapping.txt</code> file to figure out the original unobfuscated names. For more information
-  on this file, see the <a href="{@docRoot}/guide/developing/tools/proguard.html>Proguard</a> documentation.</p>
+  on this file, see the <a href="{@docRoot}guide/developing/tools/proguard.html">Proguard</a> documentation.</p>
 
       <h2 id="dmtracedump">Using dmtracdedump</h2>
 
@@ -308,7 +308,7 @@
       "{@docRoot}images/tracedump.png"
           width="485"
           height="401" />
-       <p class="image-caption><strong>Figure 3.</strong> Screenshot of dmtracedump</p>
+       <p class="image-caption"><strong>Figure 3.</strong> Screenshot of dmtracedump</p>
 
       <p>For each node, dmtracedump shows <code>&lt;ref&gt;
       <em>callname</em> (&lt;inc-ms&gt;, &lt;exc-ms&gt;,&lt;numcalls&gt;)</code>, where</p>
@@ -378,8 +378,6 @@
           is 20%.</td>
         </tr>
       </table>
-    </dd>
-  </dl>
   
   
     
diff --git a/docs/html/guide/developing/debugging/debugging-ui.jd b/docs/html/guide/developing/debugging/debugging-ui.jd
index eba5bf1..9b02d34 100644
--- a/docs/html/guide/developing/debugging/debugging-ui.jd
+++ b/docs/html/guide/developing/debugging/debugging-ui.jd
@@ -9,9 +9,10 @@
         <li>
           <a href="#hierarchyViewer">Debugging and Optimizing User Interfaces with Hierarchy
           Viewer</a>
-          <ul>
+          <ol>
             <li><a href="#layoutview">Layout View</a></li>
-        
+            <li><a href="#pixelperfect">Pixel Perfect View</a></li>
+          </ol>       
         </li>
 
         <li><a href="#layoutopt">Optimizing Layouts with <code>layoutopt</code></a></li>
@@ -94,7 +95,7 @@
   automatically refresh. You must reload the Layout View by clicking <strong>Load View
   Hierarchy</strong>.</p>
 
-  <h3>Pixel Perfect View</h3>
+  <h3 id="pixelperfect">Pixel Perfect View</h3>
 
   <p>The Pixel Perfect View provides a magnified look at the current device window. It helps you
   design your UI better by giving you a closer look at your UI's image quality, alignment, and other
@@ -190,7 +191,7 @@
 
 <p>
 For more information on running the tool, see the
-<a href="${@docRoot}guide/developing/tools/layoutopt.html">layoutopt</a> reference.</p>
+<a href="${@docRoot}guide/developing/debugging/debugging-ui.html#layoutopt">layoutopt</a> reference.</p>
   
     
 
diff --git a/docs/html/guide/developing/debugging/index.jd b/docs/html/guide/developing/debugging/index.jd
index 362f459..f9202ce 100644
--- a/docs/html/guide/developing/debugging/index.jd
+++ b/docs/html/guide/developing/debugging/index.jd
@@ -32,19 +32,19 @@
     UNIX shell on the device or emulator, and providing a general means to communicate with
     connected emulators and devices.</dd>
 
-    <dt><a href="{@docRoot}guide/developing/tools/ddms.html"><strong>Dalvik Debug Monitor
+    <dt><a href="{@docRoot}guide/developing/debugging/ddms.html"><strong>Dalvik Debug Monitor
     Server</strong></a></dt>
 
     <dd>DDMS is a graphical program that communicates with your devices through <code>adb</code>. DDMS can
     capture screenshots, gather thread and stack information, spoof incoming calls and SMS
     messages, and has many other features.</dd>
 
-    <dt><a href="{@docRoot}guide/developing/devices/avds-devices.html"><strong>Device or
-    Emulator</strong></a></dt>
+    <dt><strong><a href="{@docRoot}guide/developing/device.html">Device</a> or
+    <a href="{@docRoot}guide/developing/devices/index.html">Android Virtual Device</a></strong></dt>
 
-    <dd>Your application must run in a device or emulator so that it can be debugged. An <code>adb</code> device
+    <dd>Your application must run in a device or in an AVD so that it can be debugged. An <code>adb</code> device
     daemon runs on the device or emulator and provides a means for the <code>adb</code> host daemon to
-    communicate with the device.</dd>
+    communicate with the device or emulator.</dd>
 
     <dt><strong>JDWP debugger</strong></dt>
 
diff --git a/docs/html/guide/developing/device.jd b/docs/html/guide/developing/device.jd
index 337b6d8..4bed963c 100644
--- a/docs/html/guide/developing/device.jd
+++ b/docs/html/guide/developing/device.jd
@@ -41,7 +41,7 @@
 
 <p class="note"><strong>Note:</strong> When developing on a device, keep in mind that you should
 still use the <a
-href="{@docRoot}guide/developing/tools/emulator.html">Android emulator</a> to test your application
+href="{@docRoot}guide/developing/devices/emulator.html">Android emulator</a> to test your application
 on configurations that are not equivalent to those of your real device. Although the emulator
 does not allow you to test every device feature (such as the accelerometer), it does
 allow you to verify that your application functions properly on different versions of the Android
diff --git a/docs/html/guide/developing/devices/emulator.jd b/docs/html/guide/developing/devices/emulator.jd
index 08fb89d..a3cd5c5 100644
--- a/docs/html/guide/developing/devices/emulator.jd
+++ b/docs/html/guide/developing/devices/emulator.jd
@@ -33,7 +33,6 @@
 </div>
 </div>
 
-
 <img src="/images/emulator-wvga800l.png" alt="Image of the Android Emulator"
 width="367" height="349" style="margin-left:2em;float:right;"/>
 <p>The Android SDK includes a virtual mobile device emulator
@@ -119,9 +118,10 @@
 it automatically loads the user data and SD card data from the AVD directory. By default,
 the emulator stores the user data, SD card data, and cache in the AVD directory.</p>
 
-<p>To create and manage AVDs you use the android tool, a command-line utility
-included in the SDK. For complete information about how to set up AVDs, see <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>.</p>
+<p>To create and manage AVDs you use the AVD Manager UI or the <code>android</code> tool
+that is included in the SDK. 
+For complete information about how to set up AVDs, see <a
+href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a>.</p>
 
 <a name="starting"></a>
 
@@ -352,8 +352,8 @@
   <td><strong>Required</strong>. Specifies the AVD to load for this emulator
       instance.</td>
   <td>You must create an AVD configuration before launching the emulator. For
-      information, see <a href="{@docRoot}guide/developing/tools/avd.html">Android
-      Virtual Devices</a>.</td>
+      information, see <a href="{@docRoot}guide/developing/devices/managing-avds.html">Creating and Managing
+      Virtual Devices with AVD Manager</a>.</td>
 <tr>
   <td rowspan="7">Disk Images</td>
   <td><code>-cache&nbsp;&lt;filepath&gt;</code></td>
@@ -708,7 +708,8 @@
 results, since the density with which to render the skin may not be defined.
 AVDs let you associate each skin with a default density and override the default
 as needed. For more information, see <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>.
+href="{@docRoot}guide/developing/devices/managing-avds.html">Creating and Managing Virtual Devices
+with AVD Manager</a>.
 </td>
 </tr>
 <tr>
@@ -718,15 +719,6 @@
 </table>
 
 
-
-
-
-
-
-
-
-
-
 <a name="diskimages"></a>
 
 <h2>Working with Emulator Disk Images</h2>
@@ -892,7 +884,7 @@
 
 <p>You can also use the android tool to automatically create an SD Card image
 for you, when creating an AVD. For more information, see <a 
-href="{@docRoot}guide/developing/tools/avd.html#options">Command-line options for AVDs</a>.
+href="{@docRoot}guide/developing/devices/managing-avds.html">Creating and Managing Virtual Devices with AVD Manager</a>.
 
 <a name="temporaryimages"></a>
 <h3>Temporary Images</h3>
@@ -1643,7 +1635,7 @@
 <h2>Using Emulator Skins</h2>
 
 <p>The Android SDK includes several Emulator skins that you can use to control the resolution and density of the emulated device's screen. To select a specific skin for running the emulator, create an AVD that uses that skin. Please do not use deprecated emulator options such as <code>-skin</code> to control the skin used by an emulator instance. For more information about AVDs, see <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>.  </p>
+href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a>.</p>
 
 
 <a name="multipleinstances"></a>
@@ -1662,9 +1654,9 @@
 
 <p>If you don't have access to Eclipse or the ADT Plugin, you can install 
 your application on the emulator <a href="{@docRoot}guide/developing/tools/adb.html#move">using 
-the adb utility</a>. Before installing the application, you need to package it 
-in a .apk file using the <a href="{@docRoot}guide/developing/tools/aapt.html">Android Asset Packaging Tool</a>. 
-Once the application is installed, you can start the emulator from the command 
+the adb utility</a>. Before installing the application, you need to build and package it 
+into an <code>.apk</code> as described in <a href="{@docRoot}guide/developing/building/index.html">Building and
+Running Apps</a>. Once the application is installed, you can start the emulator from the command 
 line, as described in this document, using any startup options necessary. 
 When the emulator is running, you can also connect to the emulator instance's 
 console to issue commands as needed.</p>
@@ -1707,7 +1699,7 @@
 
 <p>You can also use the <code>-c</code> option to specify a path to an SD card
 image to use in the new AVD. For more information, see <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>.
+href="{@docRoot}guide/developing/devices/managing-avds-cmdline.html">Creating and Managing Virtual Devices on the Command Line</a>.
 </p>
 
 <h3 id="creatingm">Creating an SD card image using mksdcard</h3>
@@ -1722,7 +1714,7 @@
 
 <pre>mksdcard 1024M sdcard1.iso</pre>
 
-<p>For more information, see <a href="{@docRoot}guide/developing/tools/othertools.html">Other Tools</a>. </p>
+<p>For more information, see <a href="{@docRoot}guide/developing/tools/mksdcard.html"><code>mksdcard</code></a>.</p>
 
 <a name="copying"></a>
 <h3>Copying Files to a Disk Image</h3>
diff --git a/docs/html/guide/developing/devices/managing-avds.jd b/docs/html/guide/developing/devices/managing-avds.jd
index 73a6b6c..27d2b55 100644
--- a/docs/html/guide/developing/devices/managing-avds.jd
+++ b/docs/html/guide/developing/devices/managing-avds.jd
@@ -6,7 +6,11 @@
       <h2>In this document</h2>
 
       <ol>
-        <li><a href="#AVDEclipse">Creating an AVD</a></li>
+        <li><a href="#createavd">Creating an AVD</a>
+          <ol>
+            <li><a href="#hardwareopts">Hardware options</a></li>
+          </ol>
+        </li>        
       </ol>
     </div>
   </div>
@@ -25,7 +29,7 @@
   of each AVD. </p>
 
   
-  <h2>Creating an AVD</h2>
+  <h2 id="createavd">Creating an AVD</h2>
 
   <p>You can create as many AVDs as you would like to test on. It is recommended that you test your
   applications on all API levels higher than the target API level for your application.</p>
diff --git a/docs/html/guide/developing/eclipse-adt.html b/docs/html/guide/developing/eclipse-adt.html
new file mode 100644
index 0000000..879a356
--- /dev/null
+++ b/docs/html/guide/developing/eclipse-adt.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/projects/projects-eclipse.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/guide/developing/projects/projects-eclipse.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/eclipse-adt.jd b/docs/html/guide/developing/eclipse-adt.jd
deleted file mode 100644
index f8d32e7..0000000
--- a/docs/html/guide/developing/eclipse-adt.jd
+++ /dev/null
@@ -1,860 +0,0 @@
-page.title=Developing In Eclipse, with ADT
-@jd:body
-
-<div id="qv-wrapper">
-  <div id="qv">
-  <h2>In this document</h2>
-  <ol>
-    <li><a href="#CreatingAProject">Creating an Android Project</a></li>
-    <li><a href="#AVD">Creating an AVD</a></li>
-    <li><a href="#Running">Running Your Application</a>
-      <ol>
-        <li><a href="#RunningOnEmulator">Running on the emulator</a></li>
-        <li><a href="#RunningOnDevice">Running on a device</a></li>
-      </ol>
-    </li>
-    <li><a href="#RunConfig">Creating a Run Configuration</a></li>
-    <li><a href="#Signing">Setting Up Application Signing</a></li>
-    <li><a href="#libraryProject">Working with Library Projects</a>
-      <ol>
-        <li><a href="#libraryReqts">Development requirements</a></li>
-        <li><a href="#librarySetup">Setting up a library project</a></li>
-        <li><a href="#libraryReference">Referencing a library project</a></li>
-        <li><a href="#considerations">Development considerations</a></li>
-        <li><a href="#libraryMigrating">Migrating library projects to ADT 0.9.8</a></li>
-      </ol>
-    </li>
-    <li><a href="#Tips">Eclipse Tips</a></li>
-  </div>
-</div>
-
-
-<p>The Android Development Tools (ADT) plugin for Eclipse adds powerful extensions to the Eclipse 
-integrated development environment. It allows you to create and debug Android applications easier 
-and faster. If you use Eclipse, the ADT plugin gives you an incredible boost in developing Android 
-applications:</p>
-
-<ul>
-  <li>It gives you access to other Android development tools from inside the Eclipse IDE. For 
-example, ADT lets you access the many capabilities of the DDMS tool: take screenshots, manage 
-port-forwarding, set breakpoints, and view thread and process information directly from
-Eclipse.</li>
-  <li>It provides a New Project Wizard, which helps you quickly create and set up all of the 
-basic files you'll need for a new Android application.</li>
-  <li>It automates and simplifies the process of building your Android application.</li>
-  <li>It provides an Android code editor that helps you write valid XML for your Android 
-manifest and resource files.</li>
-  <li>It will even export your project into a signed APK, which can be distributed to users.</li>
-</ul>
-
-<p>To begin developing Android applications in the Eclipse IDE with ADT, you first need to 
-download the Eclipse IDE and then download and install the ADT plugin. To do so, follow the 
-steps given in <a href="{@docRoot}sdk/eclipse-adt.html#installing">Installing 
-the ADT Plugin</a>.</p>
-
-<p>If you are already developing applications using a version of ADT earlier than 0.9, make
-sure to upgrade to the latest version before continuing. See the guide to
-<a href="{@docRoot}sdk/eclipse-adt.html#updating">Updating Your ADT Plugin</a>.</p>
-
-<p class="note"><strong>Note:</strong> This guide assumes you are using the latest version of
-the ADT plugin. While most of the information covered also applies to previous 
-versions, if you are using an older version, you may want to consult this document from
-the set of documentation included in your SDK package (instead of the online version).</p>
-
-
-<h2  id="CreatingAProject">Creating an Android Project</h2>
-
-<p>The ADT plugin provides a New Project Wizard that you can use to quickly create a new
-Android project (or a project from existing code). To create a new project:</p>
-
-<ol>
-  <li>Select <strong>File</strong> &gt; <strong>New</strong> &gt; <strong>Project</strong>.</li>
-  <li>Select <strong>Android</strong> &gt; <strong>Android Project</strong>, and click
-    <strong>Next</strong>.</li>
-  <li>Select the contents for the project:
-    <ul>
-      <li>Enter a <em>Project Name</em>. This will be the name of the folder where your
-        project is created.</li>
-      <li>Under Contents, select <strong>Create new project in workspace</strong>.
-        Select your project workspace location.</li>
-      <li>Under Target, select an Android target to be used as the project's Build Target. 
-        The Build Target
-        specifies which Android platform you'd like your application built against.
-        <p>Unless you know that you'll be using new APIs introduced in the latest SDK, you should
-        select a target with the lowest platform version possible.</p>
-        <p class="note"><strong>Note:</strong> You can change your the Build Target for your 
-        project at any time: Right-click the project in the Package Explorer, select
-        <strong>Properties</strong>, select <strong>Android</strong> and then check 
-        the desired Project Target.</p>
-      </li>
-      <li>Under Properties, fill in all necessary fields.
-        <ul>
-          <li>Enter an <em>Application name</em>. This is the human-readable title for your 
-            application &mdash; the name that will appear on the Android device.</li>
-          <li>Enter a <em>Package name</em>. This is the package namespace (following the same rules
-            as for packages in the Java programming language) where all your source code
-            will reside.</li>
-          <li>Select <em>Create Activity</em> (optional, of course, but common) and enter a name
-            for your main Activity class.</li>
-          <li>Enter a <em>Min SDK Version</em>. This is an integer that indicates
-            the minimum API Level required to properly run your application. 
-            Entering this here automatically sets the <code>minSdkVersion</code> attribute in the 
-            <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</a>
-            of your Android Manifest file. If you're unsure of the appropriate <a
-href="{@docRoot}guide/appendix/api-levels.html">API Level</a> to use,
-            copy the API Level listed for the Build Target you selected in the Target tab.</li>
-        </ul>
-      </li>
-    </ul>
-  </li>
-  <li>Click <strong>Finish</strong>.</li>
-</ol>
-
-<p class="note"><strong>Tip:</strong>
-You can also start the New Project Wizard from the <em>New</em> icon in the toolbar.</p>
-
-<p>Once you complete the New Project Wizard, ADT creates the following 
-folders and files in your new project:</p>
-  <dl>
-    <dt><code>src/</code></dt>
-      <dd>Includes your stub Activity Java file. All other Java files for your application
-      go here.</dd>
-    <dt><code><em>&lt;Android Version&gt;</em>/</code> (e.g., <code>Android 1.1/</code>)</dt>
-      <dd>Includes the <code>android.jar</code> file that your application will build against. 
-      This is determined by the build target that you have chosen in the <em>New Project
-      Wizard</em>.</dd>
-    <dt><code>gen/</code></dt>
-      <dd>This contains the Java files generated by ADT, such as your <code>R.java</code> file
-      and interfaces created from AIDL files.</dd>
-    <dt><code>assets/</code></dt>
-      <dd>This is empty. You can use it to store raw asset files. </dd>
-    <dt><code>res/</code></dt>
-      <dd>A folder for your application resources, such as drawable files, layout files, string
-      values, etc. See 
-      <a href="{@docRoot}guide/topics/resources/index.html">Application Resources</a>.</dd>
-    <dt><code>AndroidManifest.xml</code></dt>
-      <dd>The Android Manifest for your project. See 
-      <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml 
-      File</a>.</dd>
-    <dt><code>default.properties</code></dt>
-      <dd>This file contains project settings, such as the build target. This files is integral
-      to the project, as such, it should be maintained in a Source Revision Control system. 
-      It should never be edited manually &mdash; to edit project properties, 
-      right-click the project folder and select "Properties".</dd>
-  </dl>
-
-
-<h2 id="AVD">Creating an AVD</h2>
-
-<p>An Android Virtual Device (AVD) is a device configuration for the emulator that
-allows you to model real world devices. In order to run an instance of the emulator, you must create
-an AVD.</p>
-
-<p>To create an AVD from Eclipse:</p>
-
-<ol>
-  <li>Select <strong>Window > Android SDK and AVD Manager</strong>, or click the Android SDK and
-AVD Manager icon in the Eclipse toolbar.</p>
-  </li>
-  <li>In the <em>Virtual Devices</em> panel, you'll see a list of existing AVDs. Click
-<strong>New</strong> to create a new AVD.</li>
-  <li>Fill in the details for the AVD.
-    <p>Give it a name, a platform target, an SD card size, and
-    a skin (HVGA is default).</p>
-    <p class="note"><strong>Note:</strong> Be sure to define
-    a target for your AVD that satisfies your application's Build Target (the AVD
-    platform target must have an API Level equal to or greater than the API Level that your
-application compiles against).</p>
-  </li>
-  <li>Click <strong>Create AVD</strong>.</li>
-</ol>
-
-<p>Your AVD is now ready and you can either close the SDK and AVD Manager, create more AVDs, or
-launch an emulator with the AVD by selecting a device and clicking <strong>Start</strong>.</p>
-
-<p>For more information about AVDs, read the
-<a href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>
-documentation.</p>
-
-
-<h2 id="Running">Running Your Application</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Use the Emulator to Test Different Configurations</h2>
-<p>Create multiple AVDs that each define a different device configuration with which your
-application is compatible, then launch each AVD into a new emulator from the SDK and AVD Manager.
-Set the target mode in your app's run configuration to manual, so that when you run your
-application, you can select from the available virtual devices.</p>
-</div>
-</div>
-
-<p>Running your application from Eclipse will usually require just a couple clicks, whether you're
-running it on the emulator or on an attached device. The information below describes how to get
-set up and run your application from Eclipse.</p>
-
-<h3 id="RunningOnEmulator">Running on the emulator</h3>
-
-<p>Before you can run your application on the Android Emulator,
-you <strong>must</strong> <a href="#AVD">create an AVD</a>.</p>
-
-<p>To run (or debug) your application, select <strong>Run</strong> &gt; <strong>Run</strong> (or
-<strong>Run</strong> &gt; <strong>Debug</strong>) from the Eclipse menu bar. The ADT plugin
-will automatically create a default launch configuration for the project. Eclipse will then perform
-the following:</p>
-
-<ol>
-  <li>Compile the project (if there have been changes since the last build).</li>
-  <li>Create a default launch configuration (if one does not already exist for the
-project).</li>
-  <li>Install and start the application on an emulator (or device), based on the Deployment
-Target
-    defined by the run configuration.
-    <p>By default, Android run configurations use an "automatic target" mode for
-    selecting a device target. For information on how automatic target mode selects a
-    deployment target, see <a href="#AutoAndManualTargetModes">Automatic and manual
-    target modes</a> below.</p>
-  </li>
-</ol>
-
-<p>If debugging, the application will start in the "Waiting For Debugger" mode. Once the
-debugger is attached, Eclipse will open the Debug perspective.</p>
-
-<p>To set or change the launch configuration used for your project, use the launch configuration
-manager.
-See <a href="#RunConfig">Creating a Run Configuration</a> for information.</p>
-
-<p>Be certain to create multiple AVDs upon which to test your application. You should have one AVD
-for each platform and screen type with which your application is compatible. For
-instance, if your application compiles against the Android 1.5 (API Level 3) platform, you should
-create an AVD for each platform equal to and greater than 1.5 and an AVD for each <a
-href="{@docRoot}guide/practices/screens_support.html">screen type</a> you support, then test
-your application on each one.</p>
-
-
-<h3 id="RunningOnDevice">Running on a device</h3>
-
-<p>Before you can run your application on a device, you must perform some basic setup for your
-device:</p>
-
-<ul>
-  <li>Declare your application as debuggable in your manifest</li>
-  <li>Enable USB Debugging on your device</li>
-  <li>Ensure that your development computer can detect your device when connected via USB</li>
-</ul>
-<p>Read <a href="{@docRoot}guide/developing/device.html#setting-up">Setting up a Device for
-Development</a> for more information.</p>
-
-<p>Once set up and your device is connected via USB, install your application on the device by
-selecting <strong>Run</strong> &gt; <strong>Run</strong> (or
-<strong>Run</strong> &gt; <strong>Debug</strong>) from the Eclipse menu bar.</p>
-
-
-
-<h2 id="RunConfig">Creating a Run Configuration</h2>
-
-<p>The run configuration specifies the project to run, the Activity 
-to start, the emulator or connected device to use, and so on. When you first run a project
-as an <em>Android Application</em>, ADT will automatically create a run configuration.
-The default run configuration will
-launch the default project Activity and use automatic target mode for device selection 
-(with no preferred AVD). If the default settings don't suit your project, you can 
-customize the launch configuration or even create a new.</p>
-
-<p>To create or modify a launch configuration, follow these steps as appropriate 
-for your Eclipse version:</p>
-
-<ol>
-  <li>Open the run configuration manager.
-        <ul>
-          <li>In Eclipse 3.3 (Europa), select <strong>Run</strong> &gt; 
-            <strong>Open Run Dialog</strong> (or <strong>Open Debug Dialog</strong>)
-          </li>
-          <li>In Eclipse 3.4 (Ganymede), select <strong>Run </strong>&gt; 
-            <strong>Run Configurations</strong> (or
-            <strong>Debug Configurations</strong>)
-          </li>
-      </ul>
-  </li>
-  <li>Expand the <strong>Android Application</strong> item and create a new
-  configuration or open an existing one.
-    <ul>
-      <li>To create a new configuration:
-        <ol>
-          <li>Select <strong>Android Application</strong> and click the <em>New launch
-configuration</em>
-          icon above the list (or, right-click  <strong>Android Application</strong> and click 
-          <strong>New</strong>).</li>
-          <li>Enter a Name for your configuration.</li>
-          <li>In the Android tab, browse and select the project you'd like to run with the
-          configuration.</li>
-        </ol>
-      <li>To open an existing configuration, select the configuration name from the list
-      nested below <strong>Android Application</strong>.</li>
-    </ul>
-  </li>
-  <li>Adjust your desired launch configuration settings.
-    <p>In the Target tab, consider whether you'd like to use Manual or Automatic mode
-    when selecting an AVD to run your application.
-    See the following section on <a href="#AutoAndManualTargetModes">Automatic and manual target 
-    modes</a>).</p>
-    <p>You can specify any emulator options to the Additional Emulator Command
-    Line Options field. For example, you could add <code>-scale 96dpi</code> to
-    scale the AVD's screen to an accurate size, based on the dpi of your
-    computer monitor. For a full list of emulator options, see the <a
-    href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a>
-document.</p>
-  </li>
-</ol>
-
-
-<h3 id="AutoAndManualTargetModes">Automatic and manual target modes</h3>
-
-<p>By default, a run configuration uses the <strong>automatic</strong> target mode in order to
-select an AVD. In this mode, ADT will select an AVD for the application in the following manner:</p>
-
-<ol>
-  <li>If there's a device or emulator already running and its AVD configuration
-  meets the requirements of the application's build target, the application is installed
-  and run upon it.</li>
-  <li>If there's more than one device or emulator running, each of which meets the requirements
-  of the build target, a "device chooser" is shown to let you select which device to use.</li>
-  <li>If there are no devices or emulators running that meet the requirements of the build target, 
-  ADT looks at the available AVDs. If one meets the requirements of the build target,
-  the AVD is used to launch a new emulator, upon which the application is installed and run.</li>
-  <li>If all else fails, the application will not be run and you will see a console error warning
-  you that there is no existing AVD that meets the build target requirements.</li>
-</ol>
-
-<p>However, if a "preferred AVD" is selected in the run configuration, then the application 
-will <em>always</em> be deployed to that AVD. If it's not already running, then a new emulator
-will be launched.</p>
-
-<p>If your run configuration uses <strong>manual</strong> mode, then the "device chooser" 
-is presented every time that your application is run, so that you can select which AVD to use.</p>
-
-
-<h2 id="Signing">Signing your Applications</h2>
-
-<p>As you begin developing Android applications, understand that all
-Android applications must be digitally signed before the system will install
-them on an emulator or an actual device. There are two ways to do this:
-with a debug key (for immediate testing on an emulator or development device)
-or with a private key (for application distribution).</p>
-
-<p>The ADT plugin helps you get started quickly by signing your .apk files with
-a debug key, prior to installing them on an emulator or development device. This means that you can
-quickly run your application from Eclipse without having to
-generate your own private key. No specific action on your part is needed, 
-provided ADT has access to Keytool.However, please note that if you intend
-to publish your application, you <strong>must</strong> sign the application with your
-own private key, rather than the debug key generated by the SDK tools.</p>
-
-<p>Please read <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your
-Applications</a>, which provides a thorough guide to application signing on Android
-and what it means to you as an Android application developer. The document also includes
-a guide to exporting and signing your application with the ADT's Export Wizard.</p>
-
-
-<h2 id="libraryProject">Working with Library Projects</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Library project example code</h2>
-
-<p>The SDK includes an example application called TicTacToeMain that shows how a
-dependent application can use code and resources from an Android Library
-project. The TicTacToeMain application uses code and resources from an example
-library project called TicTacToeLib. 
-
-<p style="margin-top:1em;">To download the sample applications and run them as
-projects in your environment, use the <em>Android SDK and AVD Manager</em> to
-download the "Samples for SDK API 8" component into your SDK. </p>
-
-<p style="margin-top:1em;">For more information and to browse the code of the
-samples, see the <a
-href="{@docRoot}resources/samples/TicTacToeMain/index.html">TicTacToeMain
-application</a>.</p>
-</div>
-</div>
-
-<p>An Android <em>library project</em> is a development project that holds
-shared Android source code and resources. Other Android application projects can
-reference the library project and, at build time, include its compiled sources
-in their <code>.apk</code> files. Multiple application projects can reference
-the same library project and any single application project can reference
-multiple library projects. </p>
-
-<p>If you have source code and resources that are common to multiple application
-projects, you can move them to a library project so that it is easier to
-maintain across applications and versions. Here are some common scenarios in
-which you could make use of library projects: </p>
-
-<ul>
-<li>If you are developing multiple related applications that use some of the
-same components, you could move the redundant components out of their respective
-application projects and create a single, reuseable set of the same components
-in a library project. </li>
-<li>If you are creating an application that exists in both free and paid
-versions, you could move the part of the application that is common to both versions
-into a library project. The two dependent projects, with their different package
-names, will reference the library project and provide only the difference
-between the two application versions.</li>
-</ul>
-
-<p>Structurally, a library project is similar to a standard Android application
-project. For example, it includes a manifest file at the project root, as well
-as <code>src/</code>, <code>res/</code> and similar directories. The project can
-contain the same types of source code and resources as a standard
-Android project, stored in the same way. For example, source code in the library
-project can access its own resources through its <code>R</code> class. </p>
-
-<p>However, a library project differs from an standard Android application
-project in that you cannot compile it directly to its own <code>.apk</code> or
-run it on the Android platform. Similarly, you cannot export the library project
-to a self-contained JAR file, as you would do for a true library. Instead, you
-must compile the library indirectly, by referencing the library from a dependent
-application's build path, then building that application. </p>
-
-<p>When you build an application that depends on a library project, the SDK
-tools compile the library and merge its sources with those in the main project,
-then use the result to generate the <code>.apk</code>. In cases where a resource
-ID is defined in both the application and the library, the tools ensure that the
-resource declared in the application gets priority and that the resource in the
-library project is not compiled into the application <code>.apk</code>. This
-gives your application the flexibility to either use or redefine any resource
-behaviors or values that are defined in any library.</p>
-
-<p>To organize your code further, your application can add references to
-multiple library projects, then specify the relative priority of the resources
-in each library. This lets you build up the resources actually used in your
-application in a cumulative manner. When two libraries referenced from an
-application define the same resource ID, the tools select the resource from the
-library with higher priority and discard the other. </p>
-
-<p>ADT lets you add references to library projects and set their relative
-priority from the application project's Properties. As shown in Figure 2,
-below, once you've added a reference to a library project, you can use the
-<strong>Up</strong> and <strong>Down</strong> controls to change the ordering,
-with the library listed at the top getting the higher priority. At build time,
-the libraries are merged with the application one at a time, starting from the
-lowest priority to the highest. </p>
-
-<p>Note that a library project cannot itself reference another library project
-and that, at build time, library projects are <em>not</em> merged with each
-other before being merged with the application. However, note that a library can
-import an external library (JAR) in the normal way.</p>
-
-<p>The sections below describe how to use ADT to set up and manage library your
-projects. Once you've set up your library projects and moved code into them, you
-can import library classes and resources to your application in the normal way.
-</p>
-
-
-<h3 id="libraryReqts">Development requirements</h3>
-
-<p>Android library projects are a build-time construct, so you can use them to
-build a final application <code>.apk</code> that targets any API level and is
-compiled against any version of the Android library. </p>
-
-<p>However, to use library projects, you need to update your development
-environment to use the latest tools and platforms, since older releases of the
-tools and platforms do not support building with library projects. Specifically,
-you need to download and install the versions listed below:</p>
-
-<p class="table-caption"><strong>Table 1.</strong> Minimum versions of SDK tools
-and plaforms on which you can develop library projects.</p>
-
-<table>
-<tr>
-<th>Component</th>
-<th>Minimum Version</th>
-</tr>
-<tr>
-<td>SDK Tools</td>
-<td>r6 (or higher)</td>
-</tr>
-<tr><td>Android 2.2 platform</td><td>r1 (or higher)</td></tr>
-<tr><td>Android 2.1 platform</td><td>r2 (or higher)</td></tr>
-<tr><td style="color:gray">Android 2.0.1 platform</td><td style="color:gray"><em>not supported</em></td></tr>
-<tr><td style="color:gray">Android 2.0 platform</td><td style="color:gray"><em>not supported</em></td></tr>
-<tr><td>Android 1.6 platform</td><td>r3 (or higher)</td></tr>
-<tr><td>Android 1.5 platform</td><td>r4 (or higher)</td></tr>
-<tr><td>ADT Plugin</td><td>0.9.7 (or higher)</td></tr>
-</table>
-
-<p>You can download the tools and platforms using the <em>Android SDK and AVD
-Manager</em>, as described in <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>. To install or update ADT, use the Eclipse Updater as described
-in <a href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>.</p>
-
-
-<h3 id="librarySetup">Setting up a library project</h3>
-
-<p>A library project is a standard Android project, so you can create a new one in the
-same way as you would a new application project. Specifically, you can use
-the New Project Wizard, as described in <a href="#CreatingAProject">Creating an
-Android Project</a>, above. </p>
-
-<p>When you are creating the library project, you can select any application
-name, package, and set other fields as needed, as shown in the diagram below.
-Click Finish to create the project in the workspace.</p>
-
-<p>Next, set the project's Properties to indicate that it is a library project:</p>
-
-<ol>
-<li>In the <strong>Package Explorer</strong>, right-click the library project
-and select <strong>Properties</strong>.</li>
-<li>In the <strong>Properties</strong> window, select the "Android" properties
-group at left and locate the <strong>Library</strong> properties at right. </li>
-<li>Select the "is Library" checkbox and click <strong>Apply</strong>.</li>
-<li>Click <strong>OK</strong> to close the <strong>Properties</strong> window.</li>
-</ol>
-
-<p>The new project is now marked as a library project. You can begin moving
-source code and resources into it, as described in the sections below. </p>
-
-<p>You can also convert an existing application project into a library. To do
-so, simply open the Properties for the project and select the "is Library"
-checkbox. Other application projects can now reference the existing project as a
-library project.</p>
-
-<img src="{@docRoot}images/developing/adt-props-isLib.png" style="margin:0;padding:0;" />
-<p class="img-caption" style="margin-left:3em;margin-bottom:2em;"><strong>Figure 1.</strong>
-Marking a project as an Android library project. </p>
-
-<h4>Creating the manifest file</h4>
-
-<p>A library project's manifest file must declare all of the shared components
-that it includes, just as would a standard Android application. For more
-information, see the documentation for <a
-href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
-
-<p>For example, the <a
-href="{@docRoot}resources/samples/TicTacToeLib/AndroidManifest.html">TicTacToeLib</a>
-example library project declares the Activity <code>GameActivity</code>: </p>
-
-<pre>&lt;manifest&gt;
-  ...
-  &lt;application&gt;
-    ...
-    &lt;activity android:name="GameActivity" /&gt;
-    ...
-  &lt;/application&gt;
-&lt;/manifest&gt;</pre>
-
-
-<h3 id="libraryReference">Referencing a library project from an application</h3>
-
-<p>If you are developing an application and want to include the shared code or
-resources from a library project, you can do so easily by adding a reference to
-the library project in the application project's Properties.</p>
-
-<p>To add a reference to a library project, follow these steps: </p>
-
-<ol>
-<li>In the <strong>Package Explorer</strong>, right-click the dependent project
-and select <strong>Properties</strong>.</li>
-<li>In the <strong>Properties</strong> window, select the "Android" properties group
-at left and locate the <strong>Library</strong> properties at right.</li>
-<li>Click <strong>Add</strong> to open the <strong>Project Selection</strong>
-dialog. </li>
-<li>From the list of available library projects, select a project and click
-<strong>OK</strong>.</li>
-<li>When the dialog closes, click <strong>Apply</strong> in the
-<strong>Properties</strong> window.</li>
-<li>Click <strong>OK</strong> to close the <strong>Properties</strong> window.</li>
-</ol>
-
-<p>As soon as the Properties dialog closes, Eclipse rebuilds the project,
-including the contents of the library project. </p>
-
-<p>The figure below shows the Properties dialog that lets you add library
-references and move them up and down in priority. </p>
-
-<img src="{@docRoot}images/developing/adt-props-libRef.png" style="margin:0;padding:0;" />
-<p class="img-caption" style="margin-left:3em;margin-bottom:2em;"><strong>Figure 2.</strong>
-Adding a reference to a library project in the properties of an application project. </p>
-
-<p>If you are adding references to multiple libraries, note that you can set
-their relative priority (and merge order) by selecting a library and using the
-<strong>Up</strong> and <strong>Down</strong> controls. The tools merge the
-referenced libraries with your application starting from lowest priority (bottom
-of the list) to highest (top of the list). If more than one library defines the
-same resource ID, the tools select the resource from the library with higher
-priority. The application itself has highest priority and its resources are
-always used in preference to identical resource IDs defined in libraries.</p>
-
-<h4>Declaring library components in the the manifest file</h4>
-
-<p>In the manifest file of the application project, you must add declarations
-of all components that the application will use that are imported from a library
-project. For example, you must declare any <code>&lt;activity&gt;</code>,
-<code>&lt;service&gt;</code>, <code>&lt;receiver&gt;</code>,
-<code>&lt;provider&gt;</code>, and so on, as well as
-<code>&lt;permission&gt;</code>, <code>&lt;uses-library&gt;</code>, and similar
-elements.</p>
-
-<p>Declarations should reference the library components by their fully-qualified
-package names, where appropriate. </p>
-
-<p>For example, the <a 
-href="{@docRoot}resources/samples/TicTacToeMain/AndroidManifest.html">TicTacToeMain</a>
-example application declares the library Activity <code>GameActivity</code>
-like this: </p>
-
-<pre>&lt;manifest&gt;
-  ...
-  &lt;application&gt;
-    ...
-    &lt;activity android:name="com.example.android.tictactoe.library.GameActivity" /&gt;
-    ...
-  &lt;/application&gt;
-&lt;/manifest&gt;</pre>
-
-<p>For more information about the manifest file, see the documentation for <a
-href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
-
-
-<h3 id="considerations">Development considerations</h3>
-
-<p>As you develop your library project and dependent applications, keep the 
-points listed below in mind.</p>
-
-<p><strong>Resource conflicts</strong></p>
-
-<p>Since the tools merge the resources of a library project with those of a
-dependent application project, a given resource ID might be defined in both
-projects. In this case, the tools select the resource from the application, or
-the library with highest priority, and discard the other resource. As you
-develop your applications, be aware that common resource IDs are likely to be
-defined in more than one project and will be merged, with the resource from the
-application or highest-priority library taking precedence.</p>
-
-<p><strong>Using prefixes to avoid resource conflicts</strong></p>
-
-<p>To avoid resource conflicts for common resource IDs, consider using a prefix
-or other consistent naming scheme that is unique to the project (or is  unique
-across all projects). </p>
-
-<p><strong>No export of library project to JAR</strong></p>
-
-<p>A library cannot be distributed as a binary file (such as a jar file). This
-is because the library project is compiled by the main project to use the
-correct resource IDs.</p>
-
-<p><strong>A library project can include a JAR library</strong></p>
-
-<p>You can develop a library project that itself includes a JAR library, however
-you need to manually edit the dependent application project's build path and add
-a path to the JAR file. </p>
-
-<p><strong>A library project can depend on an external JAR library</strong></p>
-
-<p>You can develop a library project that depends on an external library (for
-example, the Maps external library). In this case, the dependent application
-must build against a target that includes the external library (for example, the
-Google APIs Add-On). Note also that both the library project and the dependent
-application must declare the external library their manifest files, in a <a
-href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code>&lt;uses-library&gt;</code></a>
-element. </p>
-
-<p><strong>Library project can not include raw assets</strong></p>
-
-<p>The tools do not support the use of raw asset files in a library project.
-Any asset resources used by an application must be stored in the 
-<code>assets/</code> directory of the application project
-itself.</p>
-
-<p><strong>Targeting different Android platform versions in library project and
-application project</strong></p>
-
-<p>A library is compiled as part of the dependent application project, so the
-API used in the library project must be compatible with the version of the
-Android library used to compile the application project. In general, the library
-project should use an <a href="{@docRoot}guide/appendix/api-levels.html">API level</a>
-that is the same as &mdash; or lower than &mdash; that used by the application.
-If the library project uses an API level that is higher than that of the
-application, the application project will fail to compile. It is perfectly
-acceptable to have a library that uses the Android 1.5 API (API level 3) and
-that is used in an Android 1.6 (API level 4) or Android 2.1 (API level 7)
-project, for instance.</p>
-
-<p><strong>No restriction on library package name</strong></p>
-
-<p>There is no requirement for the package name of a library to be the same as
-that of applications that use it.</p>
-
-<p><strong>Multiple R classes in gen/ folder of application project</strong></p>
-
-<p>When you build the dependent application project, the code of any libraries
-is compiled and merged to the application project. Each library has its own
-<code>R</code> class, named according to the library's package name. The
-<code>R</code> class generated from the resources of the main project and of the
-library is created in all the packages that are needed including the main
-project’s package and the libraries’ packages.</p>
-
-<p><strong>Testing a library project</strong></p>
-
-<p>There are two recommended ways of setting up testing on code and resources in
-a library project: </p>
-
-<ul>
-<li>You can set up a <a
-href="{@docRoot}guide/developing/testing/testing_otheride.html">test project</a>
-that instruments an application project that depends on the library project. You
-can then add tests to the project for library-specific features.</li>
-<li>You can set up a set up a standard application project that depends on the
-library and put the instrumentation in that project. This lets you create a
-self-contained project that contains both the tests/instrumentations and the
-code to test.</li>
-</ul>
-
-<p><strong>Library project storage location</strong></p>
-
-<p>There are no specific requirements on where you should store a library
-project, relative to a dependent application project, as long as the application
-project can reference the library project by a relative link. You can place the
-library project What is important is that the main project can reference the
-library project through a relative link.</p>
-
-<h3 id="libraryMigrating">Migrating library projects to ADT 0.9.8</h3>
-
-<p>This section provides information about how to migrate a library project
-created with ADT 0.9.7 to ADT 0.9.8 (or higher). The migration is needed only if
-you are developing in Eclipse with ADT and assumes that you have also upgraded
-to SDK Tools r7 (or higher). </p>
-
-<p>The way that ADT handles library projects has changed between
-ADT 0.9.7 and ADT 0.9.8. Specifically, in ADT 0.9.7, the <code>src/</code>
-source folder of the library was linked into the dependent application project
-as a folder that had the same name as the library project. This worked because
-of two restrictions on the library projects:</p>
-
-<ul>
-<li>The library was only able to contain a single source folder (excluding the
-special <code>gen/</code> source folder), and</li>
-<li>The source folder was required to have the name <code>src/</code> and be
-stored at the root of the project.</li>
-</ul>
-
-<p>In ADT 0.9.8, both of those restrictions were removed. A library project can
-have as many source folders as needed and each can have any name. Additionally,
-a library project can store source folders in any location of the project. For
-example, you could store sources in a <code>src/java/</code> directory. In order
-to support this, the name of the linked source folders in the main project are
-now called &lt;<em>library-name</em>&gt;_&lt;<em>folder-name</em>&gt; For
-example: <code>MyLibrary_src/</code> or <code>MyLibrary_src_java/</code>.</p>
-
-<p>Additionally, the linking process now flags those folders in order for ADT to
-recognize that it created them. This will allow ADT to automatically migrate the
-project to new versions of ADT, should they contain changes to the handling of
-library projects. ADT 0.9.7 did not flag the linked source folders, so ADT 0.9.8
-cannot be sure whether the old linked folders can be removed safely. After
-upgrading ADT to 0.9.8, you will need to remove the old linked folders manually
-in a simple two-step process, as described below.</p>
-
-<p>Before you begin, make sure to create a backup copy of your application or
-save the latest version to your code version control system. This ensures that
-you will be able to easily revert the migration changes in case there is a
-problem in your environment.</p>
-
-<p>When you first upgrade to ADT 0.9.8, your main project will look as shown
-below, with two linked folders (in this example, <code>MyLibrary</code> and
-<code>MyLibrary_src</code> &mdash; both of which link to
-<code>MyLibrary/src</code>. Eclipse shows an error on one of them because they
-are duplicate links to a single class.</p>
-
-<img src="{@docRoot}images/developing/lib-migration-0.png" alt="">
-
-<p>To fix the error, remove the linked folder that <em>does not</em> contain the
-<code>_src</code> suffix. </p>
-
-<ol>
-<li>Right click the folder that you want to remove (in this case, the
-<code>MyLibrary</code> folder) and choose <strong>Build Path</strong> &gt;
-<strong>Remove from Build Path</strong>, as shown below.</li>
-
-<img src="{@docRoot}images/developing/lib-migration-1.png" style="height:600px"
-alt="">
-
-<li>Next, When asked about unlinking the folder from the project, select
-<strong>Yes</strong>, as shown below.</li>
-
-<img src="{@docRoot}images/developing/lib-migration-2.png" alt="">
-</ol>
-
-<p>This should resolve the error and migrate your library project to the new
-ADT environment. </p>
-
-<h2 id="Tips">Eclipse Tips</h2>
-
-<h3 id="arbitraryexpressions">Executing arbitrary Java expressions in Eclipse</h3>
-
-<p>You can execute arbitrary code when paused at a breakpoint in Eclipse. For example,
-    when in a function with a String argument called &quot;zip&quot;, you can get
-    information about packages and call class methods. You can also invoke arbitrary
-    static methods: for example, entering <code>android.os.Debug.startMethodTracing()</code> will
-    start dmTrace. </p>
-<p>Open a code execution window, select <strong>Window</strong> &gt; <strong>Show
-        View</strong> &gt; <strong>Display</strong> from the main menu to open the
-        Display window, a simple text editor. Type your expression, highlight the
-        text, and click the 'J' icon (or CTRL + SHIFT + D) to run your
-        code. The code runs in the context of the selected thread, which must be
-        stopped at a breakpoint or single-step point. (If you suspend the thread
-        manually, you have to single-step once; this doesn't work if the thread is
-        in Object.wait().)</p>
-<p>If you are currently paused on a breakpoint, you can simply highlight and execute
-    a piece of source code by pressing CTRL + SHIFT + D. </p>
-<p>You can highlight a block of text within the same scope by pressing ALT +SHIFT
-    + UP ARROW to select larger and larger enclosing blocks, or DOWN ARROW to select
-    smaller blocks. </p>
-<p>Here are a few sample inputs and responses in Eclipse using the Display window.</p>
-
-<table width="100%" border="1">
-    <tr>
-        <th scope="col">Input</th>
-        <th scope="col">Response</th>
-    </tr>
-    <tr>
-        <td><code>zip</code></td>
-        <td><code>(java.lang.String) 
-        /work/device/out/linux-x86-debug/android/app/android_sdk.zip</code></td>
-    </tr>
-    <tr>
-        <td><code>zip.endsWith(&quot;.zip&quot;)</code></td>
-        <td><code>(boolean) true</code></td>
-    </tr>
-    <tr>
-        <td><code>zip.endsWith(&quot;.jar&quot;)</code></td>
-        <td><code>(boolean) false</code></td>
-    </tr>
-</table>
-<p>You can also execute arbitrary code when not debugging by using a scrapbook page.
-    Search the Eclipse documentation for &quot;scrapbook&quot;.</p>
-
-
-<h3>Running DDMS Manually</h3>
-
-<p>Although the recommended way to debug is to use the ADT plugin, you can manually run 
-DDMS and configure Eclipse to debug on port 8700. (<strong>Note: </strong>Be sure that you 
-have first started <a href="{@docRoot}guide/developing/tools/ddms.html">DDMS</a>). </p>
-
-
-
-
-<!-- TODO: clean this up and expand it to cover more wizards and features
-<h3>ADT Wizards</h3>
-
-<p>Notice that the "New Android Project" wizard has been expanded to use the multi-platform
-capabilities of the new SDK.</p>
-
-<p>There is now a "New XML File" wizard that lets you create skeleton XML resource
-files for your Android projects. This makes it easier to create a new layout, a new menu, a
-new strings file, etc.</p>
-
-<p>Both wizards are available via <strong>File > New</strong> and new icons in the main
-Eclipse toolbar (located to the left of the Debug and Run icons). 
-If you do not see the new icons, you may need to select <strong>Window > Reset
-Perspective</strong> from the Java perspective.</p>
--->
diff --git a/docs/html/guide/developing/index.jd b/docs/html/guide/developing/index.jd
index 879986c..f19f97e 100644
--- a/docs/html/guide/developing/index.jd
+++ b/docs/html/guide/developing/index.jd
@@ -23,32 +23,33 @@
       before continuing.</p>
     </li>
 
-    <li>
-      <a href="{@docRoot}guide/developing/devices/avds-devices.html">Set up Android Virtual Devices
-      or hardware devices</a>.
+    <li>Set up Android Virtual Devices or hardware devices</a>.
 
       <p>You need to create Android Virtual Devices (AVD) or connect hardware devices on which
       you will install your applications.</p>
+      
+      <p>See <a href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a>
+      and <a href="{@docRoot}guide/developing/device.html">Connecting Hardware Devices</a> for more information.
     </li>
 
     <li>
-      <a href="{@docRoot}guide/developing/projects/projects.html">Create an Android project</a>.
+      <a href="{@docRoot}guide/developing/projects/index.html">Create an Android project</a>.
 
       <p>An Android project contains all source code and resource files for your application. It is
       built into an <code>.apk</code> package that you can install on Android devices.</p>
     </li>
 
     <li>
-      <a href="{@docRoot}guide/developing/building/building.html">Build and run your
+      <a href="{@docRoot}guide/developing/building/index.html">Build and run your
       application</a>.
 
       <p>If you are using Eclipse, builds are generated each time you save changes and you can install
       your application on a device by clicking <strong>Run</strong>. If you're using another IDE, you can build your
-      project using Ant and install it on a device using ADB.</p>
+      project using Ant and install it on a device using <code>adb</code>.</p>
     </li>
 
     <li>
-      <a href="{@docRoot}guide/developing/debugging/debugging.html">Debug your application with the
+      <a href="{@docRoot}guide/developing/debugging/index.html">Debug your application with the
       SDK debugging and logging tools</a>.
 
       <p>Debugging your application involves using a JDWP-compliant debugger along with the
@@ -110,6 +111,6 @@
   Eclipse, such as the <code>adb</code> shell commands. You might also need to call Keytool and Jarsigner to
   sign your applications, but you can set up Eclipse to do this automatically as well.</p>
   
-  <p>For more information on these tools, see the <a href="@{docRoot}guide/developing/tools/index.html">
-  Tools</a> section of the documentation.</p>
+  <p>For more information on the tools provided with the Android SDK, see the
+  <a href="{@docRoot}guide/developing/tools/index.html">Tools</a> section of the documentation.</p>
 
diff --git a/docs/html/guide/developing/other-ide.html b/docs/html/guide/developing/other-ide.html
new file mode 100644
index 0000000..41dba05
--- /dev/null
+++ b/docs/html/guide/developing/other-ide.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/projects/projects-cmdline.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/guide/developing/projects/projects-cmdline.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/other-ide.jd b/docs/html/guide/developing/other-ide.jd
deleted file mode 100644
index d309f47..0000000
--- a/docs/html/guide/developing/other-ide.jd
+++ /dev/null
@@ -1,937 +0,0 @@
-page.title=Developing In Other IDEs
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-  <h2>In this document</h2>
-  <ol>
-    <li><a href="#CreatingAProject">Creating an Android Project</a></li>
-    <li><a href="#Signing">Preparing to Sign Your Application</a></li>
-    <li><a href="#Building">Building Your Application</a>
-      <ol>
-        <li><a href="#DebugMode">Building in debug mode</a></li>
-        <li><a href="#ReleaseMode">Building in release mode</a></li>
-      </ol>
-    </li>
-    <li><a href="#AVD">Creating an AVD</a></li>
-    <li><a href="#Running">Running Your Application</a>
-      <ol>
-        <li><a href="#RunningOnEmulator">Running on the emulator</a></li>
-        <li><a href="#RunningOnDevice">Running on a device</a></li>
-      </ol>
-    </li>
-    <li><a href="#libraryProject">Working with Library Projects</a>
-      <ol>
-        <li><a href="#libraryReqts">Development requirements</a></li>
-        <li><a href="#librarySetup">Setting up a library project</a></li>
-        <li><a href="#libraryReference">Referencing a library project</a></li>
-        <li><a href="#depAppBuild">Building a dependent application project</a></li>
-        <li><a href="#considerations">Development considerations</a></li>
-      </ol>
-    </li>
-    <li><a href="#AttachingADebugger">Attaching a Debugger to Your Application</a></li>
-  </ol>
-
-  <h2>See also</h2>
-  <ol>
-    <li><a href="{@docRoot}guide/developing/tools/othertools.html#android">android Tool</a></li>
-    <li><a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a></li>
-    <li><a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a></li>
-  </ol>
-</div>
-</div>
-
-<p>The recommended way to develop an Android application is to use 
-<a href="{@docRoot}guide/developing/eclipse-adt.html">Eclipse with the ADT plugin</a>.
-The ADT plugin provides editing, building, debugging, and .apk packaging and signing functionality 
-integrated right into the IDE.</p>
-
-<p>However, if you'd rather develop your application in another IDE, such as IntelliJ,
-or in a basic editor, such as Emacs, you can do that instead. The SDK
-includes all the tools you need to set up an Android project, build it, debug it and then
-package it for distribution. This document is your guide to using these tools.</p>
-
-
-<h2 id="EssentialTools">Essential Tools</h2>
-
-<p>When developing in IDEs or editors other than Eclipse, you'll require
-familiarity with the following Android SDK tools:</p>
-
-<dl>
-  <dt><a href="{@docRoot}guide/developing/tools/othertools.html#android">android</a></dt>
-    <dd>To create/update Android projects and to create/move/delete AVDs.</dd>
-  <dt><a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a></dt>
-    <dd>To run your Android applications on an emulated Android platform.</dd>
-  <dt><a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a></dt>
-    <dd>To interface with your emulator or connected device (install apps,
-    shell the device, issue commands, etc.).
-    </dd>
-</dl>
-
-<p>In addition to the above tools, included with the SDK, you'll use the following
-open source and third-party tools:</p>
-
-<dl>
-  <dt>Ant</dt>
-    <dd>To compile and build your Android project into an installable .apk file.</dd>
-  <dt>Keytool</dt>
-    <dd>To generate a keystore and private key, used to sign your .apk file.</dd>
-  <dt>Jarsigner (or similar signing tool)</dt>
-    <dd>To sign your .apk file with a private key generated by keytool.</dd>
-</dl>
-
-<p>In the topics that follow, you'll be introduced to each of these tools as necessary.
-For more advanced operations, please read the respective documentation for each tool.</p>
-
-
-<h2 id="CreatingAProject">Creating an Android Project</h2>
-
-<p>To create an Android project, you must use the <code>android</code> tool. When you create
-a new project with <code>android</code>, it will generate a project directory
-with some default application files, stub files, configuration files and a build file.</p>
-
-
-<h3 id="CreatingANewProject">Creating a new Project</h3>
-
-<p>If you're starting a new project, use the <code>android create project</code>
-command to generate all the necessary files and folders.</p>
-
-<p>To create a new Android project, open a command-line,
-navigate to the <code>tools/</code> directory of your SDK and run:</p>
-<pre>
-android create project \
---target <em>&lt;target_ID&gt;</em> \
---name <em>&lt;your_project_name&gt;</em> \
---path <em>path/to/your/project</em> \
---activity <em>&lt;your_activity_name&gt;</em> \
---package <em>&lt;your_package_namespace&gt;</em>
-</pre>
-
-<ul>
-  <li><code>target</code> is the "build target" for your application. It corresponds
-  to an Android platform library (including any add-ons, such as Google APIs) that you would like to
-  build your project against. To see a list of available targets and their corresponding IDs, 
-  execute: <code>android list targets</code>.</li>
-  <li><code>name</code> is the name for your project. This is optional. If provided, this name will
-be used
-  for your .apk filename when you build your application.</li>
-  <li><code>path</code> is the location of your project directory. If the directory does not exist,
-  it will be created for you.</li>
-  <li><code>activity</code> is the name for your default {@link android.app.Activity} class. This
-class file
-  will be created for you inside 
- 
-<code><em>&lt;path_to_your_project&gt;</em>/src/<em>&lt;your_package_namespace_path&gt;</em>/</code>
-.
-  This will also be used for your .apk filename unless you provide a the <code>name</code>.</li>
-  <li><code>package</code> is the package namespace for your project, following the same rules as
-for
-  packages in the Java programming language.</li>
-</ul>
-
-<p>Here's an example:</p>
-<pre>
-android create project \
---target 1 \
---name MyAndroidApp \
---path ./MyAndroidAppProject \
---activity MyAndroidAppActivity \
---package com.example.myandroid
-</pre>
-
-<p>The tool generates the following files and directories:</p>
-
-<ul>
-  <li><code>AndroidManifest.xml</code> - The application manifest file, 
-  synced to the specified Activity class for the project.</li>
-  <li><code>build.xml</code> - Build file for Ant.</li>
-  <li><code>default.properties</code> - Properties for the build system. <em>Do not modify 
-  this file</em>.</li>
-  <li><code>build.properties</code> - Customizable properties for the build system. You can edit
-this
-  file to override default build settings used by Ant and provide a pointer to your keystore and key
-alias
-  so that the build tools can sign your application when built in release mode.</li>
-  <li><code>src<em>/your/package/namespace/ActivityName</em>.java</code> - The Activity class 
-  you specified during project creation.</li>
-  <li><code>bin/</code>  - Output directory for the build script.</li>
-  <li><code>gen/</code>  - Holds <code>Ant</code>-generated files, such as <code>R.java</code>.
-</li>
-  <li><code>libs/</code>  - Holds private libraries.</li>
-  <li><code>res/</code>  - Holds project resources.</li>
-  <li><code>src/</code>  - Holds source code.</li>
-  <li><code>tests/</code>  - Holds a duplicate of all-of-the-above, for testing purposes.</li>
-</ul>
-
-<p>Once you've created your project, you're ready to begin development.
-You can move your project folder wherever you want for development, but keep in mind
-that you must use the <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a> 
-(adb) &mdash; located in the SDK <code>platform-tools/</code> directory &mdash; to send your
-application 
-to the emulator (discussed later). So you need access between your project solution and 
-the <code>platform-tools/</code> folder.</p>
-
-<p class="caution"><strong>Caution:</strong> You should refrain from moving the
-location of the SDK directory, because this will break the build scripts. (They
-will need to be manually updated to reflect the new SDK location before they will
-work again.)</p>
-
-
-<h3 id="UpdatingAProject">Updating a project</h3>
-
-<p>If you're upgrading a project from an older version of the Android SDK or want to create
-a new project from existing code, use the
-<code>android update project</code> command to update the project to the new development
-environment. You can also use this command to revise the build target of an existing project
-(with the <code>--target</code> option) and the project name (with the <code>--name</code> 
-option). The <code>android</code> tool will generate any files and 
-folders (listed in the previous section) that are either missing or need to be updated, 
-as needed for the Android project.</p>
-
-<p>To update an existing Android project, open a command-line
-and navigate to the <code>tools/</code> directory of your SDK. Now run:</p>
-<pre>
-android update project --name <em>&lt;project_name&gt;</em> --target <em>&lt;target_ID&gt;</em>
---path <em>&lt;path_to_your_project&gt;</em>
-</pre>
-
-<ul>
-  <li><code>target</code> is the "build target" for your application. It corresponds to 
-  an Android platform library (including any add-ons, such as Google APIs) that you would 
-  like to build your project against. To see a list of available targets and their corresponding
-IDs,
-  execute: <code>android list targets</code>.</li>
-  <li><code>path</code> is the location of your project directory.</li>
-  <li><code>name</code> is the name for the project. This is optional&mdash;if you're not 
-  changing the project name, you don't need this.</li>
-</ul>
-
-<p>Here's an example:</p>
-<pre>
-android update project --name MyApp --target 2 --path ./MyAppProject
-</pre>
-
-
-<h2 id="Signing">Preparing to Sign Your Application</h2>
-
-<p>As you begin developing Android applications, understand that all
-Android applications must be digitally signed before the system will install
-them on an emulator or device. There are two ways to do this:
-with a <em>debug key</em> (for immediate testing on an emulator or development device)
-or with a <em>private key</em> (for application distribution).</p>
-
-<p>The Android build tools help you get started by automatically signing your .apk
-files with a debug key at build time. This means
-that you can compile your application and install it on the emulator without
-having to generate your own private key. However, please note that if you intend
-to publish your application, you <strong>must</strong> sign the application with your
-own private key, rather than the debug key generated by the SDK tools. </p>
-
-<p>Please read <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your
-Applications</a>, which provides a thorough guide to application signing on Android
-and what it means to you as an Android application developer.</p>
-
-
-
-<h2 id="Building">Building Your Application</h2>
-
-<p>There are two ways to build your application: one for testing/debugging your application
-&mdash; <em>debug mode</em> &mdash; and one for building your final package for release &mdash; 
-<em>release mode</em>. As described in the previous
-section, your application must be signed before it can be installed on an emulator
-or device.</p>
-
-<p>Whether you're building in debug mode or release mode, you
-need to use the Ant tool to compile and build your project. This will create the .apk file
-that is installed onto the emulator or device. When you build in debug mode, the .apk
-file is automatically signed by the SDK tools with a debug key, so it's instantly ready for
-installation
-(but only onto an emulator or attached development device).
-When you build in release mode, the .apk file is <em>unsigned</em>, so you must manually
-sign it with your own private key, using Keytool and Jarsigner.</p>
-
-<p>It's important that you read and understand 
-<a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>, particularly
-once you're ready to release your application and share it with end-users. That document describes
-the procedure for generating a private key and then using it to sign your .apk file.
-If you're just getting started, however, 
-you can quickly run your applications on an emulator or your own development device by building in
-debug mode.</p>
-
-<p>If you don't have Ant, you can obtain it from the 
-<a href="http://ant.apache.org/">Apache Ant home page</a>. Install it and make
-sure it is in your executable PATH. Before calling Ant, you need to declare the JAVA_HOME 
-environment variable to specify the path to where the JDK is installed.</p>
-
-<p class="note"><strong>Note:</strong> When installing JDK on Windows, the default is to install 
-in the "Program Files" directory. This location will cause <code>ant</code> to fail, because of 
-the space. To fix the problem, you can specify the JAVA_HOME variable like this: 
-<code>set JAVA_HOME=c:\Progra~1\Java\&lt;jdkdir&gt;</code>. The easiest solution, however, is to
-install JDK in a non-space directory, for example: <code>c:\java\jdk1.6.0_02</code>.</p>
-
-
-<h3 id="DebugMode">Building in debug mode</h3>
-
-<p>For immediate application testing and debugging, you can build your application 
-in debug mode and immediately install it on an emulator. In debug mode, the build tools 
-automatically sign your application with a debug key and optimize the package with 
-{@code zipalign}. However, you can (and should) also test your
-application in release mode. Debug mode simply allows you to run your application without
-manually signing the application.</p>
-
-<p>To build in debug mode:</p>
-
-<ol>
-  <li>Open a command-line and navigate to the root of your project directory.</li>
-  <li>Use Ant to compile your project in debug mode:
-    <pre>ant debug</pre>
-    <p>This creates your debug .apk file inside the project <code>bin/</code>
-    directory, named <code><em>&lt;your_project_name&gt;</em>-debug.apk</code>. The file
-    is already signed with the debug key and has been aligned with {@code zipalign}.</p>
-  </li>
-</ol>
-
-<p>Each time you change a source file or resource, you must run Ant 
-again in order to package up the latest version of the application.</p>
-
-<p>To install and run your application on an emulator, see the following section
-about <a href="#Running">Running Your Application</a>.</p>
-
-
-<h3 id="ReleaseMode">Building in release mode</h3>
-
-<p>When you're ready to release and distribute your application to end-users, you must build
-your application in release mode. Once you have built in release mode, it's a good idea to perform 
-additional testing and debugging with the final .apk.</p>
-
-<p>Before you start building your application in release mode, be aware that you must sign
-the resulting application package with your private key, and should then align it using the
-{@code zipalign} tool. There are two approaches to building in release mode:
-build an unsigned package in release mode and then manually sign and align 
-the package, or allow the build script
-to sign and align the package for you.</p>
-
-<h4 id="ManualReleaseMode">Build unsigned</h4>
-
-<p>If you build your application <em>unsigned</em>, then you will need to
-manually sign and align the package.</p>
-
-<p>To build an <em>unsigned</em> .apk in release mode:</p>
-
-<ol>
-  <li>Open a command-line and navigate to the root of your project directory.</li>
-  <li>Use Ant to compile your project in release mode:
-    <pre>ant release</pre>
-  </li>
-</ol>
-
-<p>This creates your Android application .apk file inside the project <code>bin/</code>
-directory, named <code><em>&lt;your_project_name&gt;</em>-unsigned.apk</code>.</p>
-    
-<p class="note"><strong>Note:</strong> The .apk file is <em>unsigned</em> at this point 
-and can't be installed until signed with your private key.</p>
-
-<p>Once you have created the unsigned .apk, your next step is to sign the .apk
-with your private key and then align it with {@code zipalign}. To complete this procedure, 
-read <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>.</p>
-
-<p>When your .apk has been signed and aligned, it's ready to be distributed to end-users.</p>
-
-<h4 id="AutoReleaseMode">Build signed and aligned</h4>
-
-<p>If you would like, you can configure the Android build script to automatically
-sign and align your application package. To do so, you must provide the path to your keystore 
-and the name of your key alias in your project's {@code build.properties} file. With this
-information provided, the build script will prompt you for your keystore and alias password
-when you build in release mode and produce your final application package, which will be ready
-for distribution.</p>
-
-<p class="caution"><strong>Caution:</strong> Due to the way Ant handles input, the password that
-you enter during the build process <strong>will be visible</strong>. If you are
-concerned about your keystore and alias password being visible on screen, then you
-may prefer to perform the application signing manually, via Jarsigner (or a similar tool). To
-instead
-perform the signing procedure manually, <a href="#ManualReleaseMode">build unsigned</a> and then
-continue
-with <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>.</p>
-
-<p>To specify your keystore and alias, open the project {@code build.properties} file (found in the
-root of the project directory) and add entries for {@code key.store} and {@code key.alias}. 
-For example:</p>
-
-<pre>
-key.store=path/to/my.keystore
-key.alias=mykeystore
-</pre>
-
-<p>Save your changes. Now you can build a <em>signed</em> .apk in release mode:</p>
-
-<ol>
-  <li>Open a command-line and navigate to the root of your project directory.</li>
-  <li>Use Ant to compile your project in release mode:
-    <pre>ant release</pre>
-  </li>
-  <li>When prompted, enter you keystore and alias passwords.
-    <p class="caution"><strong>Caution:</strong> As described above, 
-    your password will be visible on the screen.</p>
-  </li>
-</ol>
-
-<p>This creates your Android application .apk file inside the project <code>bin/</code>
-directory, named <code><em>&lt;your_project_name&gt;</em>-release.apk</code>.
-This .apk file has been signed with the private key specified in
-{@code build.properties} and aligned with {@code zipalign}. It's ready for 
-installation and distribution.</p>
-
-
-<h4>Once built and signed in release mode</h4>
-
-<p>Once you have signed your application with a private key, you can install it on an 
-emulator or device as discussed in the following section about 
-<a href="#Running">Running Your Application</a>.
-You can also try installing it onto a device from a web server.
-Simply upload the signed APK to a web site, then load the .apk URL in your Android web browser to 
-download the application and begin installation.
-(On your device, be sure you have enabled <em>Settings > Applications > Unknown sources</em>.)</p>
-
-
-<h2 id="AVD">Creating an AVD</h2>
-
-<p>An Android Virtual Device (AVD) is a device configuration for the emulator that
-allows you to model real world devices. In order to run an instance of the emulator, you must create
-an AVD.</p>
-
-<p>To create an AVD using the SDK tools:</p>
-
-<ol>
-  <li>Navigate to your SDK's <code>tools/</code> directory and execute the {@code android}
-tool with no arguments:
-    <pre>android</pre>
-    <p>This will launch the SDK and AVD Manager GUI.</p>
-  </li>
-  <li>In the <em>Virtual Devices</em> panel, you'll see a list of existing AVDs. Click
-<strong>New</strong>
-  to create a new AVD.</li>
-  <li>Fill in the details for the AVD.
-    <p>Give it a name, a platform target, an SD card size, and
-    a skin (HVGA is default).</p>
-    <p class="note"><strong>Note:</strong> Be sure to define
-    a target for your AVD that satisfies your application's build target (the AVD
-    platform target must have an API Level equal to or greater than the API Level that your
-application compiles against).</p>
-  </li>
-  <li>Click <strong>Create AVD</strong>.</li>
-</ol>
-
-<p>Your AVD is now ready and you can either close the AVD Manager, create more AVDs, or
-launch an emulator with the AVD by clicking <strong>Start</strong>.</p>
-
-<p>For more information about AVDs, read the
-<a href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>
-documentation.</p>
-
-
-<h2 id="Running">Running Your Application</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Use the Emulator to Test Different Configurations</h2>
-<p>Create multiple AVDs that each define a different device configuration with which your
-application is compatible, then launch each AVD into a new emulator from the SDK and AVD Manager.
-Set the target mode in your app's run configuration to manual, so that when you run your
-application, you can select from the available virtual devices.</p>
-</div>
-</div>
-
-<p>Running your application on a virtual or real device takes just a couple steps. Remember to
-first <a href="#Building">build your application</a>.</p>
-
-<h3 id="RunningOnEmulator">Running on the emulator</h3>
-
-<p>Before you can run your application on the Android Emulator,
-you must <a href="#AVD">create an AVD</a>.</p>
-
-<p>To run your application:</p>
-<ol>
-  <li><strong>Open the SDK and AVD Manager and launch a virtual device</strong></li>
-    <p>From your SDK's <code>tools/</code> directory, execute the {@code android} tool with no
-arguments:
-    <pre>android</pre>
-    <p>In the <em>Virtual Devices</em> view, select an AVD and click <strong>Start</strong>.</p>
-  </li>
-
-  <li><strong>Install your application</strong>
-    <p>From your SDK's <code>platform-tools/</code> directory, install the {@code .apk} on the
-emulator:
-    <pre>adb install <em>&lt;path_to_your_bin&gt;</em>.apk</pre>
-    <p>Your APK file (signed with either a release or debug key) is in your project {@code bin/}
-directory after you <a href="#Building">build your application</a>.</p>
-    <p>If there is more than one emulator running, you must specify the emulator upon which to
-install the application, by its serial number, with the <code>-s</code> option. For example:</p>
-    <pre>adb -s emulator-5554 install <em>path/to/your/app</em>.apk</pre>
-    <p>To see a list of available device serial numbers, execute {@code adb devices}.</p>
-  </li>
-</ol>
-
-<p>If you don't see your application on the emulator. Try closing the emulator and launching the
-virtual device again from the SDK and AVD Manager. Sometimes when you install an Activity for the
-first time, it won't show up in the application launcher or be accessible by other 
-applications. This is because the package manager usually examines manifests 
-completely only on emulator startup.</p>
-
-<p>Be certain to create multiple AVDs upon which to test your application. You should have one AVD
-for each platform and screen type with which your application is compatible. For
-instance, if your application compiles against the Android 1.5 (API Level 3) platform, you should
-create an AVD for each platform equal to and greater than 1.5 and an AVD for each <a
-href="{@docRoot}guide/practices/screens_support.html">screen type</a> you support, then test
-your application on each one.</p>
-
-<p class="note"><strong>Tip:</strong> If you have <em>only one</em> emulator running,
-you can build your application and install it on the emulator in one simple step. 
-Navigate to the root of your project directory and use Ant to compile the project 
-with <em>install mode</em>:
-<code>ant install</code>. This will build your application, sign it with the debug key,
-and install it on the currently running emulator.</p>
-
-
-<h3 id="RunningOnDevice">Running on a device</h3>
-
-<p>Before you can run your application on a device, you must perform some basic setup for your
-device:</p>
-
-<ul>
-  <li>Declare your application as debuggable in your manifest</li>
-  <li>Enable USB Debugging on your device</li>
-  <li>Ensure that your development computer can detect your device when connected via USB</li>
-</ul>
-<p>Read <a href="{@docRoot}guide/developing/device.html#setting-up">Setting up a Device for
-Development</a> for more information.</p>
-
-<p>Once your device is set up and connected via USB, navigate to your
-SDK's <code>platform-tools/</code> directory and install the <code>.apk</code> on the device:
-    <pre>adb -d install <em>path/to/your/app</em>.apk</pre>
-    <p>The {@code -d} flag specifies that you want to use the attached device (in case you also
-have an emulator running).</p>
-
-<p>For more information on the tools used above, please see the following documents:</p>
-<ul>
-  <li><a href="{@docRoot}guide/developing/tools/othertools.html#android">android Tool</a></li>
-  <li><a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a></li>
-  <li><a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a> (ADB)</li>
-</ul>
-
-<h2 id="libraryProject">Working with Library Projects</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Library project example code</h2>
-
-<p>The SDK includes an example application called TicTacToeMain that shows how a
-dependent application can use code and resources from an Android Library
-project. The TicTacToeMain application uses code and resources from an example
-library project called TicTacToeLib. 
-
-<p style="margin-top:1em;">To download the sample applications and run them as
-projects in your environment, use the <em>Android SDK and AVD Manager</em> to
-download the "Samples for SDK API 8" component into your SDK. </p>
-
-<p style="margin-top:1em;">For more information and to browse the code of the
-samples, see the <a
-href="{@docRoot}resources/samples/TicTacToeMain/index.html">TicTacToeMain
-application</a>.</p>
-</div>
-</div>
-
-<p>An Android <em>library project</em> is a development project that holds
-shared Android source code and resources. Other Android application projects can
-reference the library project and, at build time, include its compiled sources
-in their <code>.apk</code> files. Multiple application projects can reference
-the same library project and any single application project can reference
-multiple library projects. </p>
-
-<p>If you have source code and resources that are common to multiple application
-projects, you can move them to a library project so that it is easier to
-maintain across applications and versions. Here are some common scenarios in
-which you could make use of library projects: </p>
-
-<ul>
-<li>If you are developing multiple related applications that use some of the
-same components, you could move the redundant components out of their respective
-application projects and create a single, reuseable set of the same components
-in a library project. </li>
-<li>If you are creating an application that exists in both free and paid
-versions, you could move the part of the application that is common to both versions
-into a library project. The two dependent projects, with their different package
-names, will reference the library project and provide only the difference
-between the two application versions.</li>
-</ul>
-
-<p>Structurally, a library project is similar to a standard Android application
-project. For example, it includes a manifest file at the project root, as well
-as <code>src/</code>, <code>res/</code> and similar directories. The project can
-contain the same types of source code and resources as a standard
-Android project, stored in the same way. For example, source code in the library
-project can access its own resources through its <code>R</code> class. </p>
-
-<p>However, a library project differs from an standard Android application
-project in that you cannot compile it directly to its own <code>.apk</code> or
-run it on the Android platform. Similarly, you cannot export the library project
-to a self-contained JAR file, as you would do for a true library. Instead, you
-must compile the library indirectly, by referencing the library from a dependent
-application's build path, then building that application. </p>
-
-<p>When you build an application that depends on a library project, the SDK
-tools compile the library and merge its sources with those in the main project,
-then use the result to generate the <code>.apk</code>. In cases where a resource
-ID is defined in both the application and the library, the tools ensure that the
-resource declared in the application gets priority and that the resource in the
-library project is not compiled into the application <code>.apk</code>. This
-gives your application the flexibility to either use or redefine any resource
-behaviors or values that are defined in any library.</p>
-
-<p>To organize your code further, your application can add references to
-multiple library projects, then specify the relative priority of the resources
-in each library. This lets you build up the resources actually used in your
-application in a cumulative manner. When two libraries referenced from an
-application define the same resource ID, the tools select the resource from the
-library with higher priority and discard the other. 
-
-<p>Once you've have added references, the tools let you set their relative
-priority by editing the application project's build properties. At build time,
-the tools merge the libraries with the application one at a time, starting from
-the lowest priority to the highest. </p>
-
-<p>Note that a library project cannot itself reference another library project
-and that, at build time, library projects are <em>not</em> merged with each
-other before being merged with the application. However, note that a library can
-import an external library (JAR) in the normal way.</p>
-
-<p>The sections below describe how to use ADT to set up and manage library your
-projects. Once you've set up your library projects and moved code into them, you
-can import library classes and resources to your application in the normal way.
-</p>
-
-
-<h3 id="libraryReqts">Development requirements</h3>
-
-<p>Android library projects are a build-time construct, so you can use them to
-build a final application <code>.apk</code> that targets any API level and is
-compiled against any version of the Android library. </p>
-
-<p>However, to use library projects, you need to update your development
-environment to use the latest tools and platforms, since older releases of the
-tools and platforms do not support building with library projects. Specifically,
-you need to download and install the versions listed below:</p>
-
-<p class="table-caption"><strong>Table 1.</strong> Minimum versions of SDK tools
-and plaforms on which you can develop library projects.</p>
-
-<table>
-<tr>
-<th>Component</th>
-<th>Minimum Version</th>
-</tr>
-<tr>
-<td>SDK Tools</td>
-<td>r6 (or higher)</td>
-</tr>
-<tr><td>Android 2.2 platform</td><td>r1 (or higher)</td></tr>
-<tr><td>Android 2.1 platform</td><td>r2 (or higher)</td></tr>
-<tr><td style="color:gray">Android 2.0.1 platform</td><td style="color:gray"><em>not supported</em></td></tr>
-<tr><td style="color:gray">Android 2.0 platform</td><td style="color:gray"><em>not supported</em></td></tr>
-<tr><td>Android 1.6 platform</td><td>r3 (or higher)</td></tr>
-<tr><td>Android 1.5 platform</td><td>r4 (or higher)</td></tr>
-<tr><td>ADT Plugin</td><td>0.9.7 (or higher)</td></tr>
-</table>
-
-<p>You can download the tools and platforms using the <em>Android SDK and AVD
-Manager</em>, as described in <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>.</p>
-
-
-<h3 id="librarySetup">Setting up a new library project</h3>
-
-<p>A library project is a standard Android project, so you can create a new one in the
-same way as you would a new application project. Specifically, you can use
-the <code>android</code> tool to generate a new library project with all of the
-necessary files and folders. </p>
-
-<h4>Creating a library project</h4>
-
-<p>To create a new library project, navigate to the <code>&lt;sdk&gt;/tools/</code> directory
-and use this command:</p>
-
-<pre class="no-pretty-print" style="color:black">
-android create lib-project --name <em>&lt;your_project_name&gt;</em> \
---target <em>&lt;target_ID&gt;</em> \
---path <em>path/to/your/project</em> \
---package <em>&lt;your_library_package_namespace&gt;</em>
-</pre>
-
-<p>The <code>create lib-project</code> command creates a standard project
-structure that includes preset property that indicates to the build system that
-the project is a library. It does this by adding this line to the project's
-<code>default.properties</code> file: </p>
-
-<pre class="no-pretty-print" style="color:black">android.library=true</pre>
-
-<p>Once the command completes, the library project is created and you can begin moving
-source code and resources into it, as described in the sections below.</p>
-
-<p>If you want to convert an existing application project to a library project,
-so that other applications can use it, you can do so by adding a the 
-<code>android.library=true</code> property to the application's 
-<code>default.properties</code> file. </p>
-
-<h4>Creating the manifest file</h4>
-
-<p>A library project's manifest file must declare all of the shared components
-that it includes, just as would a standard Android application. For more
-information, see the documentation for <a
-href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
-
-<p>For example, the <a
-href="{@docRoot}resources/samples/TicTacToeLib/AndroidManifest.html">TicTacToeLib</a>
-example library project declares the Activity <code>GameActivity</code>: </p>
-
-<pre>&lt;manifest&gt;
-  ...
-  &lt;application&gt;
-    ...
-    &lt;activity android:name="GameActivity" /&gt;
-    ...
-  &lt;/application&gt;
-&lt;/manifest&gt;</pre>
-
-<h4>Updating a library project</h4>
-
-<p>If you want to update the build properties (build target, location) of the
-library project, use this command: </p>
-
-<pre>
-android update lib-project \
---target <em>&lt;target_ID&gt;</em> \
---path <em>path/to/your/project</em>
-</pre>
-
-
-<h3 id="libraryReference">Referencing a library project from an application</h3>
-
-<p>If you are developing an application and want to include the shared code or
-resources from a library project, you can do so easily by adding a reference to
-the library project in the application project's build properties.</p>
-
-<p>To add a reference to a library project, navigate to the <code>&lt;sdk&gt;/tools/</code> directory
-and use this command:</p>
-
-<pre>
-android update lib-project \
---target <em>&lt;target_ID&gt;</em> \
---path <em>path/to/your/project</em>
---library <em>path/to/library_projectA</em>
-</pre>
-
-<p>This command updates the application project's build properties to include a
-reference to the library project. Specifically, it adds an
-<code>android.library.reference.<em>n</em></code> property to the project's
-<code>default.properties</code> file. For example: </p>
-
-<pre class="no-pretty-print" style="color:black">
-android.library.reference.1=path/to/library_projectA
-</pre>
-
-<p>If you are adding references to multiple libraries, note that you can set
-their relative priority (and merge order) by manually editing the
-<code>default.properties</code> file and adjusting the each reference's
-<code>.<em>n</em></code> index as appropriate. For example, assume these
-references: </p>
-
-<pre class="no-pretty-print" style="color:black">
-android.library.reference.1=path/to/library_projectA
-android.library.reference.2=path/to/library_projectB
-android.library.reference.3=path/to/library_projectC
-</pre>
-
-<p>You can reorder the references to give highest priority to
-<code>library_projectC</code> in this way:</p>
-
-<pre class="no-pretty-print" style="color:black">
-android.library.reference.2=path/to/library_projectA
-android.library.reference.3=path/to/library_projectB
-android.library.reference.1=path/to/library_projectC
-</pre>
-
-<p>Note that the <code>.<em>n</em></code> index in the references
-must begin at "1" and increase uniformly without "holes". References
-appearing in the index after a hole are ignored. </p>
-
-<p>At build time, the libraries are merged with the application one at a time,
-starting from the lowest priority to the highest. Note that a library cannot
-itself reference another library and that, at build time, libraries are not
-merged with each other before being merged with the application.</p>
-
-
-<h4>Declaring library components in the the manifest file</h4>
-
-<p>In the manifest file of the application project, you must add declarations
-of all components that the application will use that are imported from a library
-project. For example, you must declare any <code>&lt;activity&gt;</code>,
-<code>&lt;service&gt;</code>, <code>&lt;receiver&gt;</code>,
-<code>&lt;provider&gt;</code>, and so on, as well as
-<code>&lt;permission&gt;</code>, <code>&lt;uses-library&gt;</code>, and similar
-elements.</p>
-
-<p>Declarations should reference the library components by their fully-qualified
-package names, where appropriate. </p>
-
-<p>For example, the 
-<a href="{@docRoot}resources/samples/TicTacToeMain/AndroidManifest.html">TicTacToeMain</a>
-example application declares the library Activity <code>GameActivity</code>
-like this: </p>
-
-<pre>&lt;manifest&gt;
-  ...
-  &lt;application&gt;
-    ...
-    &lt;activity android:name="com.example.android.tictactoe.library.GameActivity" /&gt;
-    ...
-  &lt;/application&gt;
-&lt;/manifest&gt;</pre>
-
-<p>For more information about the manifest file, see the documentation for <a
-href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
-
-<h3 id="depAppBuild">Building a dependent application</h3>
-
-<p>To build an application project that depends on one or more library projects,
-you can use the standard Ant build commands and compile modes, as described in
-<a href="#Building">Building Your Application</a>, earlier in this document. The
-tools compile and merge all libraries referenced by the application as part
-of compiling the dependent application project. No additional commands or steps
-are necessary. </p>
-
-<h3 id="considerations">Development considerations</h3>
-
-<p>As you develop your library project and dependent applications, keep the 
-points listed below in mind.</p>
-
-<p><strong>Resource conflicts</strong></p>
-
-<p>Since the tools merge the resources of a library project with those of a
-dependent application project, a given resource ID might be defined in both
-projects. In this case, the tools select the resource from the application, or
-the library with highest priority, and discard the other resource. As you
-develop your applications, be aware that common resource IDs are likely to be
-defined in more than one project and will be merged, with the resource from the
-application or highest-priority library taking precedence.</p>
-
-<p><strong>Using prefixes to avoid resource conflicts</strong></p>
-
-<p>To avoid resource conflicts for common resource IDs, consider using a prefix
-or other consistent naming scheme that is unique to the project (or is  unique
-across all projects). </p>
-
-<p><strong>No export of library project to JAR</strong></p>
-
-<p>A library cannot be distributed as a binary file (such as a jar file). This
-is because the library project is compiled by the main project to use the
-correct resource IDs.</p>
-
-<p><strong>A library project can include a JAR library</strong></p>
-
-<p>You can develop a library project that itself includes a JAR library. When
-you build the dependent application project, the tools automatically locate and
-include the library in the application <code>.apk</code>. </p>
-
-<p><strong>A library project can depend on an external JAR library</strong></p>
-
-<p>You can develop a library project that depends on an external library (for
-example, the Maps external library). In this case, the dependent application
-must build against a target that includes the external library (for example, the
-Google APIs Add-On). Note also that both the library project and the dependent
-application must declare the external library their manifest files, in a <a
-href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code>&lt;uses-library&gt;</code></a>
-element. </p>
-
-<p><strong>Library project cannot include raw assets</strong></p>
-
-<p>The tools do not support the use of raw asset files in a library project.
-Any asset resources used by an application must be stored in the 
-<code>assets/</code> directory of the application project
-itself.</p>
-
-<p><strong>Targeting different Android platform versions in library project and
-application project</strong></p>
-
-<p>A library is compiled as part of the dependent application project, so the
-API used in the library project must be compatible with the version of the
-Android library used to compile the application project. In general, the library
-project should use an <a href="{@docRoot}guide/appendix/api-levels.html">API level</a>
-that is the same as &mdash; or lower than &mdash; that used by the application.
-If the library project uses an API level that is higher than that of the
-application, the application project will fail to compile. It is perfectly
-acceptable to have a library that uses the Android 1.5 API (API level 3) and
-that is used in an Android 1.6 (API level 4) or Android 2.1 (API level 7)
-project, for instance.</p>
-
-<p><strong>No restriction on library package name</strong></p>
-
-<p>There is no requirement for the package name of a library to be the same as
-that of applications that use it.</p>
-
-<p><strong>Multiple R classes in gen/ folder of application project</strong></p>
-
-<p>When you build the dependent application project, the code of any libraries
-is compiled and merged to the application project. Each library has its own
-<code>R</code> class, named according to the library's package name. The
-<code>R</code> class generated from the resources of the main project and of the
-library is created in all the packages that are needed including the main
-project’s package and the libraries’ packages.</p>
-
-<p><strong>Testing a library project</strong></p>
-
-<p>There are two recommended ways of setting up testing on code and resources in
-a library project: </p>
-
-<ul>
-<li>You can set up a <a
-href="{@docRoot}guide/developing/testing/testing_otheride.html">test project</a>
-that instruments an application project that depends on the library project. You
-can then add tests to the project for library-specific features.</li>
-<li>You can set up a set up a standard application project that depends on the
-library and put the instrumentation in that project. This lets you create a
-self-contained project that contains both the tests/instrumentations and the
-code to test.</li>
-</ul>
-
-<p><strong>Library project storage location</strong></p>
-
-<p>There are no specific requirements on where you should store a library
-project, relative to a dependent application project, as long as the application
-project can reference the library project by a relative link. You can place the
-library project What is important is that the main project can reference the
-library project through a relative link.</p>
-
-<h2 id="AttachingADebugger">Attaching a Debugger to Your Application</h2>
-
-<p>This section describes how to display debug information on the screen (such
-    as CPU usage), as well as how to hook up your IDE to debug running applications
-    on the emulator. </p>
-
-<p>Attaching a debugger is automated using the Eclipse plugin,
-    but you can configure other IDEs to listen on a debugging port to receive debugging
-    information:</p>
-<ol>
-    <li><strong>Start the <a href="{@docRoot}guide/developing/tools/ddms.html">Dalvik Debug Monitor 
-      Server (DDMS)</a> tool, </strong> which
-        acts as a port forwarding service between your IDE and the emulator.</li>
-    <li><strong>Set 
-        optional debugging configurations on
-        your emulator</strong>, such as blocking application startup for an Activity
-        until a debugger is attached. Note that many of these debugging options
-        can be used without DDMS, such as displaying CPU usage or screen refresh
-        rate on the emulator.</li>
-    <li><strong>Configure your IDE to attach to port 8700 for debugging.</strong> Read
-        about <a href="{@docRoot}guide/developing/debug-tasks.html#ide-debug-port">
-        Configuring Your IDE to Attach to the Debugging Port</a>. </li>
-</ol>
diff --git a/docs/html/guide/developing/projects/index.jd b/docs/html/guide/developing/projects/index.jd
index 1daf738..45fd5a1 100644
--- a/docs/html/guide/developing/projects/index.jd
+++ b/docs/html/guide/developing/projects/index.jd
@@ -8,7 +8,11 @@
       <ol>
         <li><a href="#ApplicationProjects">Android Projects</a></li>
 
-        <li><a href="#LibraryProjects">Library Projects</a></li>
+        <li><a href="#LibraryProjects">Library Projects</a>
+          <ol>
+            <li><a href="#libraryMigrating">Migrating library projects to ADT 0.9.8 or higher</a></li>
+          </ol>
+        </li>
 
         <li><a href="#TestProjects">Test Projects</a></li>
       </ol>
@@ -418,6 +422,81 @@
   project can reference the library project through a relative link.</p></li>
   </ul>
   
+  
+  
+  <h3 id="libraryMigrating">Migrating library projects to ADT 0.9.8 or higher</h3> 
+ 
+<p>This section provides information about how to migrate a library project
+created with ADT 0.9.7 to ADT 0.9.8 or higher. The migration is needed only if
+you are developing in Eclipse with ADT and assumes that you have also upgraded
+to SDK Tools r7 (or higher). </p> 
+ 
+<p>The way that ADT handles library projects has changed between
+ADT 0.9.7 and ADT 0.9.8. Specifically, in ADT 0.9.7, the <code>src/</code> 
+source folder of the library was linked into the dependent application project
+as a folder that had the same name as the library project. This worked because
+of two restrictions on the library projects:</p> 
+ 
+<ul> 
+<li>The library was only able to contain a single source folder (excluding the
+special <code>gen/</code> source folder), and</li> 
+<li>The source folder was required to have the name <code>src/</code> and be
+stored at the root of the project.</li> 
+</ul> 
+ 
+<p>In ADT 0.9.8, both of those restrictions were removed. A library project can
+have as many source folders as needed and each can have any name. Additionally,
+a library project can store source folders in any location of the project. For
+example, you could store sources in a <code>src/java/</code> directory. In order
+to support this, the name of the linked source folders in the main project are
+now called &lt;library-name&gt;_&lt;folder-name&gt; For
+example: <code>MyLibrary_src/</code> or <code>MyLibrary_src_java/</code>.</p> 
+ 
+<p>Additionally, the linking process now flags those folders in order for ADT to
+recognize that it created them. This will allow ADT to automatically migrate the
+project to new versions of ADT, should they contain changes to the handling of
+library projects. ADT 0.9.7 did not flag the linked source folders, so ADT 0.9.8
+cannot be sure whether the old linked folders can be removed safely. After
+upgrading ADT to 0.9.8, you will need to remove the old linked folders manually
+in a simple two-step process, as described below.</p> 
+ 
+<p>Before you begin, make sure to create a backup copy of your application or
+save the latest version to your code version control system. This ensures that
+you will be able to easily revert the migration changes in case there is a
+problem in your environment.</p> 
+ 
+<p>When you first upgrade to ADT 0.9.8, your main project will look as shown
+in figure 1, with two linked folders (in this example, <code>MyLibrary</code> and
+<code>MyLibrary_src</code> &mdash; both of which link to
+<code>MyLibrary/src</code>. Eclipse shows an error on one of them because they
+are duplicate links to a single class.</p> 
+ 
+<img src="/images/developing/lib-migration-0.png" alt=""> 
+<p class="img-caption"><strong>Figure 1.</strong> Library project migration error</p>
+<p>To fix the error, remove the linked folder that <em>does not</em> contain the
+<code>_src</code> suffix. </p> 
+ 
+<ol> 
+<li>Right click the folder that you want to remove (in this case, the
+<code>MyLibrary</code> folder) and choose <strong>Build Path</strong> &gt;
+<strong>Remove from Build Path</strong>, as shown in figure 2.</li> 
+ 
+<img src="/images/developing/lib-migration-1.png" style="height:600px"
+alt=""> 
+<p class="img-caption"><strong>Figure 2.</strong> Remove from Build Path menu item</p>
+ 
+<li>Next, when asked about unlinking the folder from the project, select
+<strong>Yes</strong>, as shown in figure 3.</li> 
+ 
+<img src="/images/developing/lib-migration-2.png" alt=""> 
+
+<p class="img-caption"><strong>Figure 3.</strong> Unlink folder confirmation window</p>
+</ol> 
+ 
+<p>This should resolve the error and migrate your library project to the new
+ADT environment. </p> 
+ 
+  
 
   <h2 id="TestProjects">Test Projects</h2>
 
diff --git a/docs/html/guide/developing/testing/testing_eclipse.jd b/docs/html/guide/developing/testing/testing_eclipse.jd
index 370c142..1b9c6b1 100644
--- a/docs/html/guide/developing/testing/testing_eclipse.jd
+++ b/docs/html/guide/developing/testing/testing_eclipse.jd
@@ -12,9 +12,10 @@
 </div>
 <p>
     This topic explains how create and run tests of Android applications in Eclipse with ADT.
-    Before you read this topic, you should read about how to create a Android application with the
+    Before you read this topic, you should read about how to create an Android application with the
     basic processes for creating and running applications with ADT, as described in
-    <a href="{@docRoot}guide/developing/eclipse-adt.html">Developing In Eclipse, with ADT</a>.
+    <a href="{@docRoot}guide/developing/projects/projects-eclipse.html">Creating and Managing Projects in Eclipse</a>
+    and <a href="guide/developing/building/building-eclipse.html">Building and Running Apps in Eclipse</a>.
     You may also want to read
     <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Fundamentals</a>,
     which provides an overview of the Android testing framework.
diff --git a/docs/html/guide/developing/testing/testing_otheride.jd b/docs/html/guide/developing/testing/testing_otheride.jd
index adb0efa..48fa032 100644
--- a/docs/html/guide/developing/testing/testing_otheride.jd
+++ b/docs/html/guide/developing/testing/testing_otheride.jd
@@ -133,7 +133,7 @@
     This creates a new test project with the appropriate directories and build files. The directory
     structure and build file contents are identical to those in a regular Android application
     project. They are described in detail in the topic
-    <a href="{@docRoot}guide/developing/other-ide.html">Developing In Other IDEs</a>.
+    <a href="{@docRoot}guide/developing/projects/index.html">Creating and Managing Projects</a>.
 </p>
 <p>
     The operation also creates an <code>AndroidManifest.xml</code> file with instrumentation
diff --git a/docs/html/guide/developing/tools/aapt.html b/docs/html/guide/developing/tools/aapt.html
new file mode 100644
index 0000000..e66a201
--- /dev/null
+++ b/docs/html/guide/developing/tools/aapt.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/building/index.html#detailed-build">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/guide/developing/building/index.html#detailed-build">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/aapt.jd b/docs/html/guide/developing/tools/aapt.jd
deleted file mode 100644
index 40a209d..0000000
--- a/docs/html/guide/developing/tools/aapt.jd
+++ /dev/null
@@ -1,20 +0,0 @@
-page.title=Using aapt
-@jd:body
-
-<p><strong>aapt</strong> stands for Android Asset Packaging Tool and is included in the <code>tools/</code> directory of the SDK. This tool allows you to view, create, and update Zip-compatible archives (zip, jar, apk). It can also compile resources into binary assets.
-</p>
-<p>
-Though you probably won't often use <strong>aapt</strong> directly, build scripts and IDE plugins can utilize this tool to package the apk file that constitutes an Android application.
-</p>
-<p>
-For more usage details, open a terminal, go to the <code>tools/</code> directory, and run the command:
-</p>
-<ul>
-  <li><p>Linux or Mac OS X:</p>
-	<pre>./aapt</pre>
-  </li>
-  <li><p>Windows:</p>
-	<pre>aapt.exe</pre>
-  </li>
-</ul>
-
diff --git a/docs/html/guide/developing/tools/adb.jd b/docs/html/guide/developing/tools/adb.jd
index 3c6351e..bcdc2e6 100644
--- a/docs/html/guide/developing/tools/adb.jd
+++ b/docs/html/guide/developing/tools/adb.jd
@@ -171,7 +171,7 @@
 
 <pre>adb install &lt;path_to_apk&gt;</pre>
 
-<p>For more information about how to create an .apk file that you can install on an emulator/device instance, see <a href="{@docRoot}guide/developing/tools/aapt.html">Android Asset Packaging Tool</a> (aapt). </p>
+<p>For more information about how to create an .apk file that you can install on an emulator/device instance, see <a href="{@docRoot}guide/developing/building/index.html">Building and Running Apps</a></p>
 
 <p>Note that, if you are using the Eclipse IDE and have the ADT plugin installed, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, the ADT plugin handles the packaging and installation of the application for you. </p>
 
@@ -465,7 +465,8 @@
 <tr>
 <td><code>dumpsys</code></td>
 <td>Dumps system data to the screen.</td>
-<td rowspan=4">The <a href="{@docRoot}guide/developing/tools/ddms.html">Dalvik Debug Monitor Service</a> (DDMS) tool offers integrated debug environment that you may find easier to use.</td>
+<td rowspan=4">The <a href="{@docRoot}guide/developing/debugging/ddms.html">Dalvik Debug Monitor Server</a> 
+(DDMS) tool offers integrated debug environment that you may find easier to use.</td>
 </tr>
 
 <tr>
diff --git a/docs/html/guide/developing/tools/avd.html b/docs/html/guide/developing/tools/avd.html
new file mode 100644
index 0000000..c8455db
--- /dev/null
+++ b/docs/html/guide/developing/tools/avd.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/devices/index.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/guide/developing/devices/index.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/avd.jd b/docs/html/guide/developing/tools/avd.jd
deleted file mode 100644
index ca197cf..0000000
--- a/docs/html/guide/developing/tools/avd.jd
+++ /dev/null
@@ -1,447 +0,0 @@
-page.title=Android Virtual Devices
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-  <h2>AVD quickview</h2>
-  <ul>
-    <li>You need to create an AVD to run any app in the Android emulator</li>
-    <li>Each AVD is a completely independent virtual device, with its own
-        hardware options, system image, and data storage.
-    <li>You create AVD configurations to model different device environments 
-        in the Android emulator.</li>
-    <li>You can launch a graphical Android AVD Manager either through Eclipse or
-through the <code>android</code> tool. The <code>android</code> tool also offers
-a command-line interface for creating and managing AVDs.</li> </ul>
-  <h2>In this document</h2>
-  <ol>
-    <li><a href="#creating">Creating an AVD</a>
-      <ol>
-        <li><a href="#hardwareopts">Setting hardware emulation options</a></li>
-        <li><a href="#location">Default location of the AVD files</a></li>
-      </ol>
-    </li>
-    <li><a href="#managing">Managing AVDs</a>
-      <ol>
-        <li><a href="#moving">Moving an AVD</a></li>
-        <li><a href="#updating">Updating an AVD</a></li>
-        <li><a href="#deleting">Deleting an AVD</a></li>
-      </ol>
-    </li>
-    <li><a href="#options">Command-line options</a></li>
-  </ol>
-  <h2>See Also</h2>
-  <ol>
-    <li><a href="{@docRoot}guide/developing/tools/emulator.html">Android 
-        Emulator</a></li>
-  </ol>
-</div>
-</div>
-
-<p>Android Virtual Devices (AVDs) are configurations of emulator options that let
-you better model an actual device.</p>
-
-<p>Each AVD is made up of: </p>
-
-<ul>
-<li>A hardware profile.&nbsp;&nbsp;You can set options to define the hardware
-features of the virtual device. For example, you can define whether the device
-has a camera, whether it uses a physical QWERTY keyboard or a dialing pad, how
-much memory it has, and so on. </li>
-<li>A mapping to a system image.&nbsp;&nbsp;You can define what version of the
-Android platform will run on the virtual device. You can choose a version of the
-standard Android platform or the system image packaged with an SDK add-on.</li>
-<li>Other options.&nbsp;&nbsp;You can specify the emulator skin you want to use
-with the AVD, which lets you control the screen dimensions, appearance, and so
-on. You can also specify the emulated SD card to use with the AVD.</li>
-<li>A dedicated storage area on your development machine, in which is stored the
-device's user data (installed applications, settings, and so on) and emulated SD
-card.</li>
-</ul>
-
-<p>You can create as many AVDs as you need, based on the types of devices you
-want to model and the Android platforms and external libraries you want to run
-your application on. </p>
-
-<p>In addition to the options in an AVD configuration, you can also
-specify emulator command-line options at launch or by using the emulator
-console to change behaviors or characteristics at run time. For a complete
-reference of emulator options, please see the <a
-href="{@docRoot}guide/developing/tools/emulator.html">Emulator</a>
-documentation. </p>
-
-<p>The easiest way to create an AVD is to use the graphical AVD Manager, which
-you can launch from Eclipse or from the command line using the
-<code>android</code> tool. The <code>android</code> tool is provided in the
-<code>tools/</code> directory of the Android SDK. When you run the
-<code>android</code> tool without options, it launches the graphical AVD
-Manager.</p>
-
-<p>For more information about how to work with AVDs from inside your development
-environment, see <a
-href="{@docRoot}guide/developing/eclipse-adt.html">Developing in Eclipse with
-ADT</a> or <a href="{@docRoot}guide/developing/other-ide.html">Developing in
-Other IDEs</a>, as appropriate for your environment.</p>
-
-<h2 id="creating">Creating an AVD</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<p>The Android SDK does not include any preconfigured AVDs, so
-you need to create an AVD before you can run any application in the emulator
-(even the Hello World application).</p>
-</div>
-</div>
-<p>The easiest way to create an AVD is to use the graphical AVD Manager, but the
-<code>android</code> tool also offers a <a href="#options">command line option</a>.</p>
-<p>To create an AVD:</p>
-<ol>
-  <li>In Eclipse, choose <strong>Window &gt; Android SDK and AVD Manager</strong>. </li>
-  <p>Alternatively, you can launch the graphical AVD Manager by running the
-<code>android</code> tool with no options.</p>
-  <li>Select <strong>Virtual Devices</strong> in the left panel.</li>
-
-  <li>Click <strong>New</strong>. </li>
-
-<p>The <strong>Create New AVD</strong> dialog appears.</p> <a
-href="{@docRoot}images/developing/avd-dialog.png"><img
-src="{@docRoot}images/developing/avd-dialog.png" alt="AVD
-Dialog" /></a>
-
-  <li>Type the name of the AVD, such as "my_avd".</li>
-  <li>Choose a target. </li>
-<p>The target is the system image that you want to run on the emulator,
-from the set of platforms that are installed in your SDK environment. You can
-choose a version of the standard Android platform or an SDK add-on. For more
-information about how to add platforms to your SDK, see <a
-href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>. </p>
-  <li>Optionally specify any additional settings: </li>
-  <dl>
-  <dt><em>SD Card</em></dt> <dd>The path to the SD card image to use with this
-AVD, or the size of a new SD card image to create for this AVD.</dd> </dl>
-<dt><em>Skin</em></dt>
-    <dd>The skin to use for this AVD, identified by name or dimensions.</dd>
-<dt><em>Hardware</em></dt>
-    <dd>The hardware emulation options for the device. For a list of the options, see 
-<a href="#hardwareopts">Setting hardware emulation options</a>.</dd>
-  </dl>
-  <li>Click <strong>Create AVD</strong>.</li>
-</ol>
-
-<h3 id="hardwareopts">Setting hardware emulation options</h3>
-
-<p>When you create a new AVD that uses a standard Android system image ("Type:
-platform"), the AVD Manager
- lets you set hardware emulation
-options for your virtual device. 
-The table below lists the options available and the
-default values, as well as the names of properties that store the emulated
-hardware options in the AVD's configuration file (the <code>config.ini</code> file in the
-AVD's local directory). </p>
-
-<table>
-<tr>
-<th>Characteristic</th>
-<th>Description</th>
-<th>Property</th>
-</tr>
-
-<tr>
-<td>Device ram size</td>
-<td>The amount of physical RAM on the device, in megabytes. Default value is "96".
-<td>hw.ramSize</td>
-</tr>
-
-<tr>
-<td>Touch-screen support</td>
-<td>Whether there is a touch screen or not on the device. Default value is "yes".</td>
-<td>hw.touchScreen
-
-<tr>
-<td>Trackball support </td>
-<td>Whether there is a trackball on the device. Default value is "yes".</td>
-<td>hw.trackBall</td>
-</tr>
-
-<tr>
-
-<td>Keyboard support</td>
-<td>Whether the device has a QWERTY keyboard. Default value is "yes".</td>
-<td>hw.keyboard</td>
-</tr>
-
-<tr>
-<td>DPad support</td>
-<td>Whether the device has DPad keys. Default value is "yes".</td>
-<td>hw.dPad</td>
-</tr>
-
-<tr>
-<td>GSM modem support</td>
-<td>Whether there is a GSM modem in the device. Default value is "yes".</td>
-<td>hw.gsmModem</td>
-</tr>
-
-<tr>
-<td>Camera support</td>
-<td>Whether the device has a camera. Default value is "no".</td>
-<td>hw.camera</td>
-</tr>
-
-<tr>
-<td>Maximum horizontal camera pixels</td>
-<td>Default value is "640".</td>
-<td>hw.camera.maxHorizontalPixels</td>
-</tr>
-
-<tr>
-<td>Maximum vertical camera pixels</td>
-<td>Default value is "480".</td>
-<td>hw.camera.maxVerticalPixels</td>
-
-</tr>
-
-<tr>
-<td>GPS support</td>
-<td>Whether there is a GPS in the device. Default value is "yes".</td>
-<td>hw.gps</td>
-</tr>
-
-<tr>
-<td>Battery support</td>
-<td>Whether the device can run on a battery. Default value is "yes".</td>
-<td>hw.battery</td>
-
-</tr>
-
-<tr>
-<td>Accelerometer</td>
-<td>Whether there is an accelerometer in the device. Default value is "yes".</td>
-<td>hw.accelerometer</td>
-</tr>
-
-<tr>
-<td>Audio recording support</td>
-<td>Whether the device can record audio. Default value is "yes".</td>
-<td>hw.audioInput</td>
-
-</tr>
-
-<tr>
-<td>Audio playback support</td>
-<td>Whether the device can play audio. Default value is "yes".</td>
-<td>hw.audioOutput</td>
-</tr>
-
-<tr>
-<td>SD Card support</td>
-<td>Whether the device supports insertion/removal of virtual SD Cards. Default value is "yes".</td>
-<td>hw.sdCard</td>
-
-</tr>
-
-<tr>
-<td>Cache partition support</td>
-<td>Whether we use a /cache partition on the device. Default value is "yes".</td>
-<td>disk.cachePartition</td>
-</tr>
-
-<tr>
-<td>Cache partition size</td>
-<td>Default value is "66MB".</td>
-<td>disk.cachePartition.size </td>
-
-</tr>
-
-<tr>
-<td>Abstracted LCD density</td>
-<td>Sets the generalized density characteristic used by the AVD's screen. Most
-skins come with a value (which you can modify), but if a skin doesn't provide
-its own value, the default is 160. </td>
-<td>hw.lcd.density </td>
-</tr>
-
-<tr>
-<td>Max VM application heap size</td>
-<td>The maximum heap size a Dalvik application might allocate before being
-killed by the system. Value is in megabytes. Most skins come with a value (which
-you can modify), but if a skin doesn't provide its own value, the default is
-16.</td> 
-<td>vm.heapSize</td>
-</tr>
-
-</table>
-
-<h3 id="location">Default location of the AVD files</h3>
-
-<p>When you create an AVD, the AVD Manager creates a dedicated directory for it
-on your development computer. The directory contains the AVD configuration file,
-the user data image and SD card image (if available), and any other files
-associated with the device. Note that the directory does not contain a system
-image &mdash; instead, the AVD configuration file contains a mapping to the
-system image, which it loads when the AVD is launched. </p>
-
-<p>The AVD Manager also creates a <code>&lt;AVD name&gt;.ini</code> file for the
-AVD at the root of the <code>.android/avd</code> directory on your computer. The file
-specifies the location of the AVD directory and always remains at the root the
-.android directory.</p>
-
-<p>By default, the AVD Manager creates the AVD directory inside
-<code>~/.android/avd/</code> (on Linux/Mac), <code>C:\Documents and
-Settings\&lt;user&gt;\.android\</code> on Windows XP, and 
-<code>C:\Users\&lt;user&gt;\.android\</code> on Windows Vista. 
-If you want to use a custom location for the AVD directory, you 
-can do so by using the <code>-p &lt;path&gt;</code> option when 
-you create the AVD (command line tool only): </p>
-
-<pre>android create avd -n my_android1.5 -t 2 -p path/to/my/avd</pre>
-
-<p>If the <code>.android</code> directory is hosted on a network drive, we recommend using
-the <code>-p</code> option to place the AVD directory in another location. 
-The  AVD's <code>.ini</code> file remains in the <code>.android</code> directory on the network
-drive, regardless of the location of the AVD directory. </p>
-
-<h2 id="managing">Managing AVDs</h2>
-
-<p>The sections below provide more information about how to manage AVDs once you've created them. </p>
-
-<h3 id="moving">Moving an AVD</h3>
-
-<p>If you want to move or rename an AVD, you can do so using this command:</p>
-
-<pre>android move avd -n &lt;name&gt; [-&lt;option&gt; &lt;value&gt;] ...</pre>
-
-<p>The options for this command are listed in <a href="#options">Command-line
-options for AVDs</a> at the bottom of this page. </p>
-
-<h3 id="updating">Updating an AVD</h3>
-
-<p>
-If you rename or move the root directory of a platform (or add-on), an AVD configured to use that platform will no longer be able to load the system image properly. To fix the AVD, use the <strong>Repair...</strong> button in the AVD Manager. From the command line, you can also use the <code>android update avd</code> command to recompute the path to the system images.</p>
-
-<h3 id="deleting">Deleting an AVD</h3>
-
-<p>You can  delete an AVD in the AVD Manager by selecting the 
-AVD and clicking <strong>Delete</strong>.</p>
-
-<p>Alternatively, you can use the <code>android</code> tool to delete an AVD. Here is the command usage:</p>
-
-<pre>android delete avd -n &lt;name&gt; </pre>
-
-<p>When you issue the command, the <code>android</code> tool looks for an AVD matching the 
-specified name deletes the AVD's directory and files. </p>
-
-
-<h2 id="options">Command-line options</h2>
-
-<p>You can use the <code>android</code> tool to create and manage AVDs.</p>
-
-<p>The command line for creating an AVD has the following syntax:</p>
-
-<pre>
-android create avd -n &lt;name&gt; -t &lt;targetID&gt; [-&lt;option&gt; &lt;value&gt;] ... 
-</pre>
-
-<p>Here's an example that creates an AVD with the name "my_android2.2" and target ID "3":</p>
-
-<pre>
-android create avd -n my_android2.2 -t 3
-</pre>
-
-<p>The table below lists the command-line options you can use with the 
-<code>android</code> tool. </p>
-
-
-<table>
-<tr>
-  <th width="15%">Action</th>
-  <th width="20%">Option</th>
-  <th width="30%">Description</th>
-  <th>Comments</th>
-</tr>
-
-
-<tr>
-  <td><code>list&nbsp;avds</code></td>
-  <td>&nbsp;</td>
-  <td>List all known AVDs, with name, path, target, and skin. </td>
-  <td>&nbsp;</td>
-</tr>
-<tr>
-  <td rowspan="6"><code>create&nbsp;avd</code></td>
-  <td><code>-n &lt;name&gt; or <br></code></td>
-  <td>The name for the AVD.</td>
-  <td>Required</td>
-</tr>
-<tr>
-  <td><code>-t &lt;targetID&gt;</code></td>
-  <td>Target ID of the system image to use with the new AVD.</td>
-  <td>Required. To obtain a list of available targets, use <code>android list
-      targets</code>.</td>
-</tr>
-<tr>
-  <td><code>-c &lt;path&gt;</code> or <br>
-      <code>-c &lt;size&gt;[K|M]</code></td>
-  <td>The path to the SD card image to use with this AVD or the size of a new SD
-      card image to create for this AVD.</td>
-  <td>Examples: <code>-c path/to/sdcard</code> or <code>-c 1000M</code></td>
-</tr>
-<tr>
-  <td><code>-f</code></td>
-  <td>Force creation of the AVD</td>
-  <td>By default, if the name of the AVD being created matches that of an 
-      existing AVD, the <code>android</code> tool will not create the new AVD or overwrite 
-      the existing AVD. If you specify the <code>-f</code> option, however, the 
-      <code>android</code> tool will automatically overwrite any existing AVD that has the 
-      same name as the new AVD. The files and data of the existing AVD are 
-      deleted. </td>
-</tr>
-
-<tr>
-  <td><code>-p &lt;path&gt;</code></td>
-  <td>Path to the location at which to create the directory for this AVD's
-files.</td>
-  <td>&nbsp;</td>
-</tr>
-<tr>
-  <td><code>-s &lt;name&gt;</code> or <br>
-      <code>-s &lt;width&gt;-&lt;height&gt;</code> </td>
-  <td>The skin to use for this AVD, identified by name or dimensions.</td>
-  <td>The <code>android</code> tool scans for a matching skin by name or dimension in the
-<code>skins/</code> directory of the target referenced in the <code>-t
-&lt;targetID&gt;</code> argument. Example: <code>-s HVGA-L</code></td>
-</tr>
-<tr>
-  <td><code>delete&nbsp;avd</code></td>
-  <td><code>-n &lt;name&gt;</code></td>
-  <td>Delete the specified AVD.</td>
-  <td>Required</td>
-</tr>
-<tr>
-  <td rowspan="3"><code>move&nbsp;avd</code></td>
-  <td><code>-n &lt;name&gt;</code></td>
-  <td>The name of the AVD to move.</td>
-  <td>Required</td>
-</tr>
-<tr>
-  <td><code>-p &lt;path&gt;</code></td>
-  <td>The path to the new location for the AVD.</td>
-  <td>&nbsp;</td>
-</tr>
-<tr>
-  <td><code>-r &lt;new-name&gt;</code></td>
-  <td>Rename the AVD.</td>
-  <td>&nbsp;</td>
-</tr>
-<tr>
-  <td><code>update&nbsp;avds</code></td>
-  <td>&nbsp;</td>
-  <td>Recompute the paths to all system images.</td>
-  <td>&nbsp;</td>
-</tr>
-
-
-
-</table>
-
diff --git a/docs/html/guide/developing/tools/ddms.html b/docs/html/guide/developing/tools/ddms.html
new file mode 100644
index 0000000..052ccc9
--- /dev/null
+++ b/docs/html/guide/developing/tools/ddms.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/debugging/ddms.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/guide/developing/debugging/ddms.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/ddms.jd b/docs/html/guide/developing/tools/ddms.jd
deleted file mode 100644
index f55940d..0000000
--- a/docs/html/guide/developing/tools/ddms.jd
+++ /dev/null
@@ -1,251 +0,0 @@
-page.title=Using the Dalvik Debug Monitor
-@jd:body
-
-<p>Android ships with a debugging tool called the Dalvik Debug Monitor Server (DDMS),
-    which provides port-forwarding services, screen capture on the device, thread
-    and heap information on the device, logcat, process, and radio state information,
-    incoming call and SMS spoofing, location data spoofing, and more. This page
-    provides a modest discussion of DDMS features; it is not an exhaustive exploration of
-    all the features and capabilities.</p>
-
-<p>DDMS ships in the <code>tools/</code> directory of the SDK.
-    Enter this directory from a terminal/console and type <code>ddms</code> (or <code>./ddms</code> 
-    on Mac/Linux) to run it. DDMS will work with both the emulator and a connected device. If both are
-    connected and running simultaneously, DDMS defaults to the emulator.</p>
-
-<h2 id="how-ddms-works">How DDMS works</h2>
-<p>DDMS acts as a middleman to connect the IDE to the applications running on
-the device. On Android, every application runs in its own process, 
-each of which hosts its own virtual machine (VM). And each process
-listens for a debugger on a different port.</p>
-
-<p>When it starts, DDMS connects to <a href="{@docRoot}guide/developing/tools/adb.html">adb</a> and 
-starts a device monitoring service between the two, which will notify DDMS when a device is
-connected or disconnected. When a device is connected, a VM monitoring service is created
-between adb and DDMS, which will notify DDMS when a VM on the device is started 
-or terminated. Once a VM is running, DDMS retrieves the the VM's process ID (pid), via adb,
-and opens a connection to the VM's debugger, through the adb daemon (adbd) on the device. 
-DDMS can now talk to the VM using a custom wire protocol.</p>
-
-<p>For each VM on the device, DDMS opens a port upon which it will listen for a debugger. For the first VM, DDMS listens for a debugger on port 8600, the next on 8601, and so on. When a debugger connects to one of these ports, all traffic is forwarded between the debugger and the associated VM. Debugging can then process like any remote debugging session.</p>
-
-<p>DDMS also opens another local port, the DDMS "base port" (8700, by default), upon which it also listens for a debugger. When a debugger connects to this base port, all traffic is forwarded to the VM currently selected in DDMS, so this is typically where you debugger should connect.</p>
-
-<p>For more information on port-forwarding with DDMS,
-read <a href="{@docRoot}guide/developing/debug-tasks.html#ide-debug-port">Configuring your IDE to attach
-to port 8700 for debugging</a>.</p>
-
-<p class="note"><strong>Tip:</strong>
-You can set a number of DDMS preferences in <strong>File</strong> > <strong>Preferences</strong>.
-Preferences are saved to &quot;$HOME/.ddmsrc&quot;. </p>
-
-<p class="warning"><strong>Known debugging issues with Dalvik</strong><br/>
-Debugging an application in the Dalvik VM should work the same as it does
-in other VMs. However, when single-stepping out of synchronized code, the "current line"
-cursor may jump to the last line in the method for one step.</p>
-
-
-<h2 id="left-pane">Left Pane</h2>
-<p>The left side of the Debug Monitor shows each emulator/device currently found, with a list of 
-    all the VMs currently running within each. 
-    VMs are identified by the package name of the application it hosts.</p>
-<p>Use this list to find and attach to the VM
-    running the activity(ies) that you want to debug. Next to each VM in the
-    list is a &quot;debugger pass-through&quot; port (in the right-most column). 
-    If you connect your debugger to one of the the ports listed, you
-    will be connected to the corresponding VM on the device. However, when using 
-    DDMS, you need only connect to port 8700, as DDMS forwards all traffic here to the 
-    currently selected VM. (Notice, as you select a VM in the list, the listed port includes 8700.)
-    This way, there's no need to reconfigure the debugger's port each time you switch between VMs.</p>
-<p>When an application running on the device calls {@link android.os.Debug#waitForDebugger()}
-    (or you select this option in the <a href="{@docRoot}guide/developing/debug-tasks.html#additionaldebugging">developer
-    options</a>), a red icon will be shown next to the client name, while it waits for the 
-    debugger to attach to the VM. When a debugger is connected, the icon will turn green. </p>
-<p>If you see a crossed-out bug icon, this means that the DDMS was unable to complete a 
-connection between the debugger and the VM because it was unable to open the VM's local port.
-If you see this for all VMs on the device, it is likely because you have another instance of
-DDMS running (this includes the Eclipse plugin).</p>
-<p>If you see a question mark in place of an application package, this means that, 
-once DDMS received the application pid from adb, it
-somehow failed to make a successful handshake with the VM process. Try restarting DDMS.</p>
-
-
-<h2 id="right-pane">Right pane</h2>
-<p>On the right side, the Debug Monitor provides tabs that display useful information 
-and some pretty cool tools.</p>
-
-<h3 id="info">Info</h3>
-<p>This view shows some general information about the selected VM, including the process
-    ID, package name, and VM version.</p>
-
-<h3 id="threads">Threads</h3>
-<p> The threads view has a list of threads running in the process of the target VM.
-     To reduce the amount
-    of data sent over the wire, the thread updates are only sent when explicitly
-    enabled by toggling the &quot;threads&quot; button
-    in the toolbar. This toggle is maintained per VM. This tab includes the following
-    information: </p>
-<ul>
-    <li> <strong>ID</strong> - a VM-assigned unique thread ID. In Dalvik, these are
-        odd numbers starting from 3. </li>
-    <li> <strong>Tid</strong> - the Linux thread ID. For the main thread in a process,
-        this will match the process ID. </li>
-    <li> <strong>Status</strong> - the VM thread status. Daemon threads are
-        shown with an asterisk (*). This will be one of the following:
-        <ul>
-                <li> <em>running</em> - executing application code </li>
-            <li> <em>sleeping</em> - called Thread.sleep() </li>
-            <li> <em>monitor</em> - waiting to acquire a monitor lock </li>
-            <li> <em>wait</em> - in Object.wait() </li>
-            <li> <em>native</em> - executing native code </li>
-            <li> <em>vmwait</em> - waiting on a VM resource </li>
-            <li> <em>zombie</em> - thread is in the process of dying </li>
-            <li> <em>init</em> - thread is initializing (you shouldn't see this) </li>
-            <li> <em>starting</em> - thread is about to start (you shouldn't see
-                this either) </li>
-        </ul>
-    </li>
-    <li> <strong>utime</strong> - cumulative time spent executing user code, in &quot;jiffies&quot; (usually
-        10ms). </li>
-    <li> <strong>stime</strong> - cumulative time spent executing system code, in &quot;jiffies&quot;  (usually
-        10ms). </li>
-    <li> <strong>Name</strong> - the name of the thread</li>
-</ul>
-<p> &quot;ID&quot; and &quot;Name&quot; are set when the thread is started. The remaining
-    fields are updated periodically (default is every 4 seconds). </p>
-
-<h3 id="vm-heap">VM Heap</h3>
-<p> Displays some heap stats, updated during garbage collection. If, when a VM is selected,
-the VM Heap view says that heap updates are not enabled, click the "Show heap updates" button, 
-located in the top-left toolbar. Back in the VM Heap view, click <strong>Cause GC</strong> 
-to perform garbage collection and update the heap stats.</p>
-
-
-<h3 id="allocation-tracker">Allocation Tracker</h3>
-<p>In this view, you can track the memory allocation of each virtual machine.
-With a VM selected in the left pane, click <strong>Start Tracking</strong>, then 
-<strong>Get Allocations</strong> to view all allocations since tracking started. 
-The table below will be filled with all the relevant
-data. Click it again to refresh the list.</p>
-
-
-<h3 id="emulator-control">Emulator Control</h3>
-<p>With these controls, you can simulate special device states and activities.
-Features include:</p>
-<ul>
-<li><strong>Telephony Status</strong> - change the state of the phone's Voice and Data plans
-    (home, roaming, searching, etc.), and simulate different kinds of network Speed and Latency
-    (GPRS, EDGE, UTMS, etc.).</li>
-<li><strong>Telephony Actions</strong> - perform simulated phone calls and SMS messages to the emulator.</li>
-<li><strong>Location Controls</strong> - send mock location data to the emulator so that you can perform
-  location-aware operations like GPS mapping.
-
-<p>To use the Location Controls, launch your application in the Android emulator and open DDMS. 
-Click the Emulator Controls tab and scroll down to Location Controls.
-From here, you can:</p>
-<ul class="listhead">
-    <li>Manually send individual longitude/latitude coordinates to the device.
-	<p>Click <strong>Manual</strong>, 
-	select the coordinate format, fill in the fields and click <strong>Send</strong>.
-	</p>
-    </li>
-    <li>Use a GPX file describing a route for playback to the device.
-	<p>Click <strong>GPX</strong> and load the file. Once loaded,
-	click the play button to playback the route for your location-aware application.</p>	
-	<p>When performing playback from GPX, you can adjust the speed of 
-	playback from the DDMS panel and control playback with the pause and skip buttons.
-	DDMS will parse both the waypoints (<code>&lt;wpt></code>, in the first table), 
-        and the tracks (<code>&lt;trk></code>,
-	in the second table, with support for multiple segments, <code>&lt;trkseg></code>, 
-        although they are simply
-	concatenated). Only the tracks can be played. Clicking a waypoint in the first list simply
-	sends its coordinate to the device, while selecting a track lets you play it.</p>
-    </li>
-    <li>Use a KML file describing individual placemarks for sequenced playback to the device.
-	<p>Click <strong>KML</strong> and load the file. Once loaded,
-	click the play button to send the coordinates to your location-aware application.</p>
-	<p>When using a KML file, it is parsed for a <code>&lt;coordinates&gt;</code>
-    	element. The value of which should be a single 
-    	set of longitude, latitude and altitude figures. For example:</p>
-	<pre>&lt;coordinates>-122.084143,37.421972,4&lt;/coordinates></pre>
-	<p>In your file, you may include multiple <code>&lt;Placemark></code> elements, each containing
-	a <code>&lt;coordinates></code> element. When you do so, the collection of placemarks will 
-	be added as tracks. DDMS will send one placemark per second to the device.</p>
-	<p>One way to generate a suitable KML file is to find a location in Google Earth.
-	Right-click the location entry that appears on the left and select "Save place as..." 
-	with the save format set to Kml.</p>
-<p class="note"><strong>Note:</strong> DDMS does not support routes created with the 
-<code>&lt;MultiGeometry>&lt;LineString>lat1, long1, lat2, long2, ....&lt;/LineString>&lt;/MultiGeometry></code> methods.
-	There is also currently no support for the <code>&lt;TimeStamp></code> node inside
-	the <code>&lt;Placemark></code>.
-	Future releases may support timed placement and routes within a single coordinate element.</p>
-    </li>
-  </ul>
-  <p>For <em>additional</em> methods of setting up mocks of location-based data, see the 
-  <a href="{@docRoot}guide/topics/location/index.html">Location</a> topic.</p>
-  </li>
-</ul>
-
-
-<!-- <h4>Event Log</h4> -->
-
-
-<h2 id="file-explorer">File Explorer</h2>
-<p>With the File Explorer, you can view the device file system and perform basic management, 
-like pushing and pulling files. This circumvents using the <a href="{@docRoot}guide/developing/tools/adb.html">adb</a>
-<code>push</code> and <code>pull</code> commands, with a GUI experience.</p>
-<p>With DDMS open, select <strong>Device</strong> > <strong>File Explorer...</strong> to open the
-File Explorer window. You can drag-and-drop into the device directories, but cannot drag <em>out</em> of them.
-To copy files from the device, select the file and click the <strong>Pull File from Device</strong>
-button in the toolbar. To delete files, use the <strong>Delete</strong> button in the toolbar.</p>
-<p>If you're interested in using an SD card image on the emulator, you're still required to use
-the <code>mksdcard</code> command to create an image, and then mount it during emulator bootup. 
-For example, from the <code>/tools</code> directory, execute:</p>
-<pre>
-<b>$</b> mksdcard 1024M ./img
-<b>$</b> emulator -sdcard ./img
-</pre>
-<p>Now, when the emulator is running, the DDMS File Explorer will be able to read and write to the 
-sdcard directory. However, your files may not appear automatically. For example, if you add an
-MP3 file to the sdcard, the media player won't see them until you restart the emulator. (When restarting
-the emulator from command line, be sure to mount the sdcard again.)</p>
-<p>For more information on creating an SD card image, see the 
-<a href="{@docRoot}guide/developing/tools/othertools.html#mksdcard">Other Tools</a> document.</p>
-
-<h2 id="screen-capture">Screen Capture</h2>
-<p>You can capture screen images on the device or emulator by selecting <strong>Device</strong>
-    &gt; <strong>Screen capture...</strong> in the menu bar, or press CTRL-S.
-	Be sure to select a device first.</p>
-
-<h2 id="exploring-processes">Exploring Processes</h2>
-<p>You can see the output of <code>ps -x</code> for a specific VM by selecting <strong>Device</strong>
-    &gt; <strong>Show process status</strong>... in the menu bar.</p>
-
-<h2 id="cause-a-gc-to-occur">Cause a GC to Occur</h2>
-<p>Cause garbage collection to occur in the selected application by pressing the trash can button on the toolbar. </p>
-
-<h2 id="running-dumpsys-and-dumpstate">Running Dumpsys and Dumpstate on the Device (logcat)<a name="logcat" id="logcat"></a> </h2>
-<ul>
-        <li>To run <strong>dumpsys</strong> (logcat) from Dalvik, select <strong>Device</strong> &gt; 
-            <strong>Run logcat...</strong> in the menu bar.</li>
-    <li>To run <strong>dumpstate</strong> from Dalvik, select <strong>Device</strong> &gt; <strong>Dump device
-        state...</strong> in the menu bar. </li>
-</ul>
-
-<h2 id="examine-radio-state">Examine Radio State</h2>
-<p>By default, radio state is not output during a standard logcat (it is a lot of
-    information). To see radio information, either click <strong>Device</strong> &gt; <strong>Dump radio
-    state...</strong> or run logcat as described in <a href="{@docRoot}guide/developing/debug-tasks.html#logradio">Logging
-    Radio Information</a>. </p>
-
-<h2 id="stop-a-vitrual-machine">Stop a Virtual Machine </h2>
-<p>You can stop a virtual machine by selecting <strong>Actions</strong> &gt; <strong>Halt
-VM</strong>. Pressing this button causes the VM to call <code>Runtime.halt(1)</code>.</p>
-
-<h2 id="known-issues" style="color:#FF0000">Known issues with DDMS </h2>
-<p>DDMS has the following known limitations:</p>
-<ul>
-    <li>If you connect and disconnect a debugger, ddms drops and reconnects the
-        client so the VM realizes that the debugger has gone away. This will be fixed
-        eventually. </li>
-</ul>
diff --git a/docs/html/guide/developing/tools/emulator.jd b/docs/html/guide/developing/tools/emulator.jd
index e255087..9baf1a1 100644
--- a/docs/html/guide/developing/tools/emulator.jd
+++ b/docs/html/guide/developing/tools/emulator.jd
@@ -12,7 +12,7 @@
 
 <p>This document is a reference to the available command line options and the keyboard mapping to device keys. 
 For a complete guide to using the Android Emulator, see 
-<a href="${@docRoot}guide/developing/devices/emulator.html">Using the Android Emulator</a>.
+<a href="{@docRoot}guide/developing/devices/emulator.html">Using the Android Emulator</a>.
 
 
 <h2 id="startup-options">Emulator Startup Options</h2>
@@ -85,8 +85,8 @@
   <td><strong>Required</strong>. Specifies the AVD to load for this emulator
       instance.</td>
   <td>You must create an AVD configuration before launching the emulator. For
-      information, see <a href="{@docRoot}guide/developing/tools/avd.html">Android
-      Virtual Devices</a>.</td>
+      information, see <a href="{@docRoot}guide/developing/devices/managing-avds.html#createavd">
+      Creating and Managing AVDs with AVD Manager</a>.</td>
 <tr>
   <td rowspan="7">Disk Images</td>
   <td><code>-cache&nbsp;&lt;filepath&gt;</code></td>
@@ -439,7 +439,8 @@
 results, since the density with which to render the skin may not be defined.
 AVDs let you associate each skin with a default density and override the default
 as needed. For more information, see <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>.
+href="{@docRoot}guide/developing/devices/managing-avds.html#createavd">
+Creating and Managing Virtual Devices with AVD Manager</a>.
 </td>
 </tr>
 <tr>
diff --git a/docs/html/guide/developing/tools/hierarchy-viewer.jd b/docs/html/guide/developing/tools/hierarchy-viewer.jd
index 431008c..ce660fc 100644
--- a/docs/html/guide/developing/tools/hierarchy-viewer.jd
+++ b/docs/html/guide/developing/tools/hierarchy-viewer.jd
@@ -1,98 +1,16 @@
 page.title=Hierarchy Viewer
 @jd:body
 
-<p>The Hierarchy Viewer application allows you to debug and optimize your user 
+<p>Hierarchy Viewer allows you to debug and optimize your user 
 interface. It provides a visual representation of the layout's View hierarchy 
 (the Layout View) and a magnified inspector of the display (the Pixel Perfect View). 
 </p>
 
-<p>To get the Hierarchy Viewer started:</p>
-<ol>
-  <li>Connect your device or launch an emulator.</li>
-  <li>From a terminal, launch <code>hierarchyviewer</code> from your SDK 
-    <code>/tools</code> directory.
-    </li>
-  <li>In the window that opens, you'll see a list of <strong>Devices</strong>. When a device is
-    selected, a list of currently active <strong>Windows</strong> is displayed 
-    on the right. The <em>&lt;Focused Window></em> is the window currently in 
-    the foreground, and also the default window loaded if you do not select another.
-    </li> 
-  <li>Select the window that you'd like to inspect and click 
-    <strong>Load View Hierarchy</strong>. The Layout View will be loaded. 
-    You can then load the Pixel Perfect View by clicking the second 
-    icon at the bottom-left of the window.
-    </li>
+<p>To start Hierarchy Viewer, enter the following command from the SDK <code>tools/</code> directory:</p>
+  <pre>hierarchyviewer</pre>
 </ol>
 
-<p>If you've navigated to a different window on the device, press <strong>Refresh Windows</strong>
-to refresh the list of available windows on the right.</p>
-
-<h2>Layout View</h2>
-<p>The Layout View offers a look at the View layout and properties. It has three views:</p>
-<ul>
-  <li>Tree View: a hierarchy diagram of the Views, on the left.</li>
-  <li>Properties View: a list of the selected View's properties, on the top-right.</li>
-  <li>Wire-frame View: a wire-frame drawing of the layout, on the bottom-right.</li>
-</ul>
-<br/>
-<img src="{@docRoot}images/hierarchyviewer-layout.png" alt="" height="509" width="700" />
-
-<p>Select a node in the Tree View to display the properties of that element in 
-the Properties View. When a node is selected, the Wire-frame View 
-also indicates the bounds of the element with a red rectangle.
-Double click a node in the tree (or select it, and click <strong>Display 
-View</strong>) to open a new window with a rendering of that element.</p>
-
-<p>The Layout View includes a couple other helpful features for debugging your layout: 
-<strong>Invalidate</strong> and <strong>Request Layout</strong>. These buttons execute the
-respective View calls, {@link android.view.View#invalidate()} and {@link android.view.View#requestLayout()},
-on the View element currently selected in the tree. Calling these methods on any View can
-be very useful when simultaneously running a debugger on your application.</p>
-
-<p>The Tree View can be resized by adjusting the zoom slider, below
-the diagram. The number of View elements in the window is also given here. You 
-should look for ways to minimize the number of Views. The fewer View elements there
-are in a window, the faster it will perform.</p>
-
-<p>If you interact with the device and change the focused View, the diagram will not automatically refresh.
-You must reload the Layout View by clicking <strong>Load View Hierarchy</strong>.
-
-
-<h2>Pixel Perfect View</h2>
-<p>The Pixel Perfect View provides a magnified look at the current device window. It has three views:</p>
-<ul>
-  <li>Explorer View: shows the View hierarchy as a list, on the left.</li>
-  <li>Normal View: a normal view of the device window, in the middle.</li>
-  <li>Loupe View: a magnified, pixel-grid view of the device window, on the right.</li>
-</ul>
-<br/>
-<img src="{@docRoot}images/hierarchyviewer-pixelperfect.png" alt="" height="509" width="700" />
-
-<p>Click on an element in the Explorer View and a "layout box" will be drawn in the
-Normal View to indicate the layout position of that element. The layout box uses multiple rectangles, to indicate the normal bounds, the padding and the margin (as needed). The purple or green rectangle indicates 
-the normal bounds of the element (the height and width). The inner white or black rectangle indicates 
-the content bounds, when padding is present. A  black or white rectangle outside the normal purple/green
-rectangle indicates any present margins. 
-(There are two colors for each rectangle, in order to provide the best contrast
-based on the colors currently in the background.)</p> 
-
-<p>A very handy feature for designing your UI is the ability to overlay an image in the Normal and Loupe
-Views. For example, you might have a mock-up image of how you'd like to layout your interface. 
-By selecting <strong>Load...</strong> from the controls in the Normal View, you can choose the
-image from your computer and it will be placed atop the preview. Your chosen image will anchor at the bottom left corner of the screen. You can then adjust the opacity of the overlay and begin fine-tuning your layout to match the mock-up.</p>
-
-<p>The Normal View and Loupe View refresh at regular intervals (5 seconds by default), but the 
-Explorer View does not. If you navigate away and focus on a different View, then you should refresh the 
-Explorer's hierarchy by clicking <strong>Load View Hierarchy</strong>. This is even true 
-when you're working in a window that holds multiple Views that are not always visible. If you do not,
-although the previews will refresh, clicking a View in the Explorer will not provide the proper layout box
-in the Normal View, because the hierarchy believes you are still focused on the prior View.</p>
-
-<p>Optional controls include:</p>
-<ul>
-  <li><strong>Overlay</strong>: Load an overlay image onto the view and adjust its opacity.</li>
-  <li><strong>Refresh Rate</strong>: Adjust how often the Normal and Loupe View refresh their display.</li>
-  <li><strong>Zoom</strong>: Adjust the zoom level of the Loupe View.</li>
-</ul>
-
+<p>For more information on how to use Hierarchy Viewer, see 
+<a href="{@docRoot}guide/developing/debugging/debugging-ui.html">Debugging and Profiling UIs</a>
+</p>
 
diff --git a/docs/html/guide/developing/tools/index.jd b/docs/html/guide/developing/tools/index.jd
index f20e016b..c603780 100644
--- a/docs/html/guide/developing/tools/index.jd
+++ b/docs/html/guide/developing/tools/index.jd
@@ -10,75 +10,76 @@
 applications on the emulator. </p>
 
  <dl>
-  <dt><a href="{@docRoot}sdk/eclipse-adt.html">Android Development Tools Plugin</a> (for the Eclipse IDE)</dt>
-          <dd>The ADT plugin adds powerful extensions to the Eclipse integrated environment, 
-          making creating and debugging your Android applications easier and faster.</dd>          
+  <dt><a href="adb.html">Android Debug Bridge</a></dt>
+    <dd>A versatile tool lets you manage the state of an emulator instance
+    or Android-powered device.</dd>    
+
+   <dt><a href="android.html">android</a></dt>
+     <dd>Lets you manage AVDs, projects, and the installed components of the SDK.
+     </dd>
+
+  <dt><a href="bmgr.html">bmgr</a></dt>
+
+    <dd>Lets you interact with the Backup Manager on Android devices
+    supporting API Level 8 or greater. It provides commands to invoke backup and restore operations
+    so that you don't need to repeatedly wipe data or take similar intrusive steps in order to test
+    your application's backup agent. These commands are accessed via the adb shell.
+    </dd>
+
+  <dt><a href="dmtracedump.html">dmtracedump</a></dt>
+
+    <dd>Generates graphical call-stack diagrams from trace log files.
+    The tool uses the Graphviz Dot utility to create the graphical output, so you need to install
+    Graphviz before running <code>dmtracedump</code>. For more information on using <code>dmtracedump</code>, see
+    <a href="{@docRoot}guide/developing/debugging/debugging-tracing.html#dmtracedump">Profiling with
+    Traceview and dmtracedump</a>
+    </dd>
+
+    <dt><a href="draw9patch.html">Draw 9-patch</a></dt>
+	    <dd>Allows you to easily create a {@link android.graphics.NinePatch} graphic using a WYSIWYG editor.
+	    It also previews stretched versions of the image, and highlights the area in which content is allowed.
+	    </dd>
+
   <dt><a href="emulator.html">Android Emulator</a></dt>
     <dd>A QEMU-based device-emulation tool that you can use to design,
     debug, and test your applications in an actual Android run-time environment. </dd>
 
+  <dt><a href="hprof-conv.html">hprof-conv</a></dt>
 
-  <dt><a href="bmgr.html">bmgr</a></dt>
+    <dd>Converts the HPROF file that is generated by the Android SDK tools to a
+    standard format so you can view the file in a profiling tool of your choice.</dd>
 
-    <dd>A shell tool you can use to interact with the Backup Manager on Android devices
-    supporting API Level 8 or greater. It provides commands to invoke backup and restore operations
-    so that you don't need to repeatedly wipe data or take similar intrusive steps in order to test
-    your application's backup agent. These commands are accessed via the adb shell.
-    </dd>  
-    
- <dt><a href="layoutopt.html">layoutopt</a></dt>
-    <dd>This tool lets you quickly analyze your application's layouts in order to
+  <dt><a href="layoutopt.html">layoutopt</a></dt>
+    <dd>Lets you quickly analyze your application's layouts in order to
     optimize them for efficiency.
     </dd>
 
-
-	  <dt><a href="draw9patch.html">Draw 9-patch</a></dt>
-	    <dd>The Draw 9-patch tool allows you to easily create a 
-	    {@link android.graphics.NinePatch} graphic using a WYSIWYG editor. It also previews stretched 
-	     versions of the image, and highlights the area in which content is allowed.
-	    </dd>
-			
-
-  <dt><a href="adb.html" >Android Debug Bridge</a> (adb)</dt>
-                  <dd>The adb tool lets you install your application's .apk files on an
-                  emulator or device and access the emulator or device from a command line.
-                  You can also use it to link a standard debugger to application code running
-                  on an Android emulator or device.
-                <p>This is located in {@code &lt;sdk&gt;/platform-tools/}.</p></dd>
-
-  <dt><a href="hprof-conv.html">hprof-conv</a></dt>
-
-    <dd>A tool that converts the HPROF file that is generated by the Android SDK tools to a
-    standard format so you can view the file in a profiling tool of your choice.</dd>
-    
-  <dt><a href="sqlite3.html">sqlite3</a></dt>
-      <dd>Included as a convenience, this tool lets you access the SQLite data 
-      files created and used by Android applications.</dd>
+  <dt><a href="mksdcard.html">logcat</a></dt>
+      <dd>Lets you read system log messages that are output on an Android device or emulator.</dd>
 
   <dt><a href="mksdcard.html">mksdcard</a></dt>
-            <dd>Helps you create a disk image that you can use with the emulator, 
-                      to simulate the presence of an external storage card (such as an SD card).</dd>
-                      
-  <dt><a href="monkey.html">UI/Application 
+      <dd>Helps you create a disk image that you can use with the emulator, 
+      to simulate the presence of an external storage card (such as an SD card).</dd>
 
-  Exerciser Monkey</a></dt>
-      <dd>A program that runs on your emulator or device and generates pseudo-random
+  <dt><a href="monkey.html">Monkey</a></dt>
+      <dd>Runs on your emulator or device and generates pseudo-random
       streams of user events such as clicks, touches, or gestures, as well as a number of system-level events.
       You can use the Monkey to stress-test applications that you are developing, in a random yet repeatable manner.</dd>
 
+  <dt><a href="monkeyrunner_concepts.html">monkeyrunner</a></dt>
+      <dd>Provides an API for writing programs that control an Android device
+      or emulator from outside of Android code.</dd>
 
-  <dt><a  href="android.html">android</a></dt>
-            <dd>A script that lets you manage AVDs and generate <a
-                        href="http://ant.apache.org/" title="Ant">Ant</a> build files that
-                        you can use to compile your Android applications. </dd>
+  <dt><a href="proguard.html">ProGuard</a></dt>
+      <dd>Shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes,
+      fields, and methods with semantically obscure names.</dd>
 
-  <dt><a  href="zipalign.html">zipalign</a></dt>
-            <dd>An important .apk optimization tool. This tool ensures that all uncompressed data starts
+  <dt><a href="sqlite3.html">sqlite3</a></dt>
+      <dd>Lets you access the SQLite data files created and used by Android applications.</dd>
+
+  <dt><a href="zipalign.html">zipalign</a></dt>
+            <dd>Optimizes <code>.apk</code> files by ensuring that all uncompressed data starts
             with a particular alignment relative to the start of the file. This should always be used
             to align .apk files after they have been signed.</dd>
-            
-
-    
-
 </dl>
 
diff --git a/docs/html/guide/developing/tools/monkey.jd b/docs/html/guide/developing/tools/monkey.jd
index 9a2ab6f..6c05934 100644
--- a/docs/html/guide/developing/tools/monkey.jd
+++ b/docs/html/guide/developing/tools/monkey.jd
@@ -185,7 +185,7 @@
 <td>If set, this option will generate profiling reports immediately before and after
 the Monkey event sequence.
 This will generate large (~5Mb) files in data/misc, so use with care.  See 
-<a href="{@docRoot}guide/developing/tools/traceview.html" title="traceview">Traceview</a> for more information
+<a href="{@docRoot}guide/developing/debugging/debugging-tracing.html" title="traceview">Traceview</a> for more information
 on trace files.</td>
 </tr>
 
diff --git a/docs/html/guide/developing/tools/othertools.html b/docs/html/guide/developing/tools/othertools.html
new file mode 100644
index 0000000..a074f33
--- /dev/null
+++ b/docs/html/guide/developing/tools/othertools.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/tools/index.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/guide/developing/tools/index.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/othertools.jd b/docs/html/guide/developing/tools/othertools.jd
deleted file mode 100644
index 00f0b8d6..0000000
--- a/docs/html/guide/developing/tools/othertools.jd
+++ /dev/null
@@ -1,95 +0,0 @@
-page.title=Other Tools
-@jd:body
-
-<p>The sections below describe other tools that you can use when building 
-Android applications. </p>
-
-<p>All of the tools are included in the Android SDK and are accessible from the 
-<code>&lt;sdk&gt;/tools/</code> directory.</p>
-
-<h2>Contents</h2>
-
-<dl>
-    <dt><a href="#android">android</a></dd>
-    <dt><a href="#mksdcard">mksdcard</a></dt>
-    <dt><a href="#dx">dx</a></dt>
-</dl>
-
-<a name="activitycreator"></a>
-<h2 id="android">android</h2>
-
-<p>{@code android} is an important development tool that lets you:</p>
-
-<ul>
-  <li>Create, delete, and view Android Virtual Devices (AVDs). See 
-  <a href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>.</li>
-  <li>Create and update Android projects. See
-  <a href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>.</li>
-  <li>Update your Android SDK with new platforms, add-ons, and documentation. See
-  <a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</li>
-</ul>
-
-<p>If you develop in Eclipse with the ADT plugin, you can perform
-these tasks directly from the IDE. To create
-Android projects and AVDs from Eclipse, see <a href="{@docRoot}guide/developing/eclipse-adt.html">Developing
-In Eclipse</a>. To update your SDK from Eclipse, see
-<a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>. 
-</p>
-
-
-<a name="mksdcard"></a>
-
-<h2>mksdcard</h2>
-
-<p>The mksdcard tool lets you quickly create a FAT32 disk image that you can 
-load in the emulator, to simulate the presence of an SD card in the device. 
-Here is the usage for mksdcard:</p>
-
-<pre>mksdcard [-l label] &lt;size&gt;[K|M] &lt;file&gt;</pre>
-
-<p>The table below lists the available options/arguments</p>
-
-<table>
-<tr>
-	<th>Argument</th>
-	<th>Description</th>
-</tr>
-
-<tr>
-	<td><code>-l</code></td>
-	<td>A volume label for the disk image to create. </td>
-</tr>
-
-<tr>
-	<td><code>size</code></td>
-	<td>An integer that specifies the size (in bytes) of disk image to create. 
-You can also specify size in kilobytes or megabytes, by appending a "K" or "M" to 
-&lt;size&gt;. For example, <code>1048576K</code>, <code>1024M</code>.</td>
-</tr>
-
-<tr>
-	<td><code>file</code></td>
-	<td>The path/filename of the disk image to create. </td>
-</tr>
-
-</table>
-
-<p>Once you have created the disk image file, you can load it in the emulator at 
-startup using the emulator's -sdcard option. For more information, see 
-<a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a>.</p>
-
-<pre>emulator -sdcard &lt;file&gt;</pre>
-
-<a name="dx"></a>
-
-<h2>dx</h2>
-
-<p>The dx tool lets you generate Android bytecode from .class files. The tool 
-converts target files and/or directories to Dalvik executable format (.dex) files, 
-so that they can run in the Android environment. It can also dump the class files 
-in a human-readable format and run a target unit test. You can get the usage and 
-options for this tool by using <code>dx --help</code>.</p>
-
-
-
-
diff --git a/docs/html/guide/developing/tools/traceview.jd b/docs/html/guide/developing/tools/traceview.jd
index 95ae823..422fe00 100644
--- a/docs/html/guide/developing/tools/traceview.jd
+++ b/docs/html/guide/developing/tools/traceview.jd
@@ -1,319 +1,14 @@
-page.title=Traceview: A Graphical Log Viewer
+page.title=Traceview
 @jd:body
 
-<div id="qv-wrapper">
-<div id="qv">
+<p>Traceview is a graphical viewer for execution logs saved by your application. 
+Traceview can help you debug your application and profile its performance.</p>
 
-  <h2>In this document</h2>
-<ol>
-    <li><a href="#creatingtracefiles">Creating Trace Files</a></li>
-    <li><a href="#copyingfiles">Copying Trace Files to a Host Machine</a></li>
-    <li><a href="#runningtraceview">Viewing Trace Files in Traceview</a>
-            <ol>
-		<li><a href="#timelinepanel">Timeline Panel</a></li>
-        	<li><a href="#profilepanel">Profile Panel</a></li>
-	    </ol></li>
-    <li><a href="#format">Traceview File Format</a>
-            <ol>
-		<li><a href="#datafileformat">Data File Format</a></li>
-        	<li><a href="#keyfileformat">Key File Format</a></li>
-	    </ol></li>
-    <li><a href="#knownissues">Traceview Known Issues</a></li>
-    <li><a href="#dmtracedump">Using dmtracedump</a></li>
+<p>To start Traceview, enter the following command from the SDK <code>tools/</code> directory:</p>
+  <pre>traceview</pre>
 </ol>
-</div>
-</div>
 
-<p>Traceview is a graphical viewer for execution logs
-saved by your application. Traceview can help you debug your application and 
-profile its performance. The sections below describe how to use the program. </p>
-
-<a name="creatingtracefiles"></a>
-
-<h2>Creating Trace Files</h2>
-
-<p>To use Traceview, you need to generate log files containing the trace information you want to analyze. To do that, you  include the {@link android.os.Debug}
-  class in your code and call its methods to start and stop logging of trace information
-  to disk. When your application quits, you can then use Traceview to examine the log files
-  for useful run-time information such
-  as method calls and run times. </p>
-<p>To create the trace files, include the {@link android.os.Debug} class and call one
-  of the {@link android.os.Debug#startMethodTracing() startMethodTracing()} methods. 
-  In the call, you specify a base name for the trace files that the system generates. 
-  To stop tracing, call {@link android.os.Debug#stopMethodTracing() stopMethodTracing()}.
-  These methods start and stop method tracing across the entire virtual machine. For 
-  example, you could call startMethodTracing() in your activity's onCreate()
-  method, and call stopMethodTracing() in that activity's onDestroy() method.</p>
-
-<pre>
-    // start tracing to "/sdcard/calc.trace"
-    Debug.startMethodTracing("calc");
-    // ...
-    // stop tracing
-    Debug.stopMethodTracing();
-</pre>
-
-<p>When your application calls startMethodTracing(), the system creates a
-file called <code>&lt;trace-base-name>.trace</code>.  This contains the
-binary method trace data and a mapping table with thread and method names.</p>
-
-<p>The system then begins buffering the generated trace data, until your application calls 
-	stopMethodTracing(), at which time it writes the buffered data to the
-	output file.
-	If the system reaches the maximum buffer size before stopMethodTracing() 
-	is called, the system stops tracing and sends a notification
-	to the console. </p>
-
-<p>Interpreted code will run more slowly when profiling is enabled.  Don't
-try to generate absolute timings from the profiler results (i.e. "function
-X takes 2.5 seconds to run").  The times are only
-useful in relation to other profile output, so you can see if changes
-have made the code faster or slower. </p>
-
-<p>When using the Android emulator, you must create an SD card image upon which
-the trace files will be written. For example, from the <code>/tools</code> directory, you 
-can create an SD card image named "imgcd" and mount it when launching the emulator like so:</p>
-<pre>
-<b>$</b> mksdcard 1024M ./imgcd
-<b>$</b> emulator -sdcard ./imgcd
-</pre>
-<p>For more information, read about the 
-<a href="{@docRoot}guide/developing/tools/othertools.html#mksdcard">mksdcard tool</a>.</p>
-	
-<p>The format of the trace files is described <a href="#format">later 
-   in this document</a>. </p>
-
-<a name="copyingfiles"></a>
-
-<h2>Copying Trace Files to a Host Machine</h2>
-<p>After your application has run and the system has created your trace files <code>&lt;trace-base-name>.trace</code>
-    on a device or emulator, you must copy those files to your development computer.   You can use <code>adb pull</code> to copy
-    the files. Here's an example that shows how to copy an example file,
-    calc.trace, from the default location on the emulator to the /tmp directory on
-the emulator host machine:</p>
-<pre>adb pull /sdcard/calc.trace /tmp</pre>
-
-
-<a name="runningtraceview"></a>
-
-<h2>Viewing Trace Files in Traceview</h2>
-<p>To run traceview and view the trace files, enter <code>traceview &lt;trace-base-name></code>.
-    For example, to run Traceview on the example files copied in the previous section,
-    you would use: </p>
-    <pre>traceview /tmp/calc</pre>
-
-	<p>Traceview loads the log files and displays their data in a window that has two panels:</p>
-	<ul>
-		<li>A <a href="#timelinepanel">timeline panel</a> -- describes when each thread
-	    and method started and stopped</li>
-    	<li>A <a href="#timelinepanel">profile panel</a> -- provides a summary of what happened inside a method</li>
-	</ul>
-	<p>The sections below provide addition information about the traceview output panes. </p>
-
-<a name="timelinepanel"></a>
-
-<h3>Timeline Panel  </h3>
-<p>The image below shows a close up of the timeline panel. Each thread&rsquo;s
-    execution is shown in its own row, with time increasing to the right. Each method
-    is shown in another color (colors are reused in a round-robin fashion starting
-    with the methods that have the most inclusive time). The thin lines underneath
-    the first row show the extent (entry to exit) of all the calls to the selected
-    method. The method in this case is LoadListener.nativeFinished() and it was
-    selected in the profile view. </p>
-<p><img src="/images/traceview_timeline.png" alt="Traceview timeline panel" width="893" height="284"></p>
-<a name="profilepanel"></a>
-<h3>Profile Panel</h3>
-<p>The image below shows the profile pane. The profile pane shows a
-    summary of all the time spent in a method. The table shows
-    both the inclusive and exclusive times (as well as the percentage of the total
-    time). Exclusive time is the time spent in the method. Inclusive time is the
-    time spent in the method plus the time spent in any called functions. We refer
-    to  calling methods as &quot;parents&quot; and called methods as &quot;children.&quot;
-    When a method is selected (by clicking on it), it expands to show the parents
-    and children. Parents are shown with a purple background and children
-    with a yellow background. The last column in the table shows the number of calls
-    to this method plus the number of recursive calls. The last column shows the
-    number of calls out of the total number of calls made to that method. In this
-    view, we can see that there were 14 calls to LoadListener.nativeFinished(); looking
-    at the timeline panel shows that one of those calls took an unusually
-    long time.</p>
-<p><img src="/images/traceview_profile.png" alt="Traceview profile panel." width="892" height="630"></p>
-
-<a name="format"></a>
-<h2>Traceview File Format</h2>
-<p>Tracing creates two distinct pieces of output: a <em>data</em> file,
-    which holds the trace data, and a <em>key</em> file, which
-    provides a mapping from binary identifiers to thread and method names.
-	The files are concatenated when tracing completes, into a
-	single <em>.trace</em> file. </p>
-
-<p class="note"><strong>Note:</strong> The previous version of Traceview did not concatenate 
-these files for you. If you have old key and data files that you'd still like to trace, you 
-can concatenate them yourself with <code>cat mytrace.key mytrace.data > mytrace.trace</code>.</p>
-
-<a name="datafileformat"></a>
-
-<h3>Data File Format</h3>
-<p>The data file is binary, structured as
-    follows (all values are stored in little-endian order):</p>
-<pre>* File format:
-* header
-* record 0
-* record 1
-* ...
-*
-* Header format:
-* u4 magic 0x574f4c53 ('SLOW')
-* u2 version
-* u2 offset to data
-* u8 start date/time in usec
-*
-* Record format:
-* u1 thread ID
-* u4 method ID | method action
-* u4 time delta since start, in usec
-</pre>
-<p>The application is expected to parse all of the header fields, then seek
-    to &quot;offset to data&quot; from the start of the file. From there it just
-    reads
-    9-byte records until EOF is reached.</p>
-<p><em>u8 start date/time in usec</em> is the output from gettimeofday().
-    It's mainly there so that you can tell if the output was generated yesterday
-    or three months ago.</p>
-<p><em>method action</em> sits in the two least-significant bits of the
-    <em>method</em> word. The currently defined meanings are:    </p>
-<ul>
-    <li>0 - method entry </li>
-    <li>1 - method exit </li>
-    <li>2 - method &quot;exited&quot; when unrolled by exception handling </li>
-    <li>3 - (reserved)</li>
-</ul>
-<p>An unsigned 32-bit integer can hold about 70 minutes of time in microseconds.
+<p>For more information on how to use Traceview, see 
+<a href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Profiling with Traceview and dmtracedump</a>
 </p>
 
-<a name="keyfileformat"></a>
-	
-<h3>Key File Format</h3>
-<p>The key file is a plain text file divided into three sections. Each
-    section starts with a keyword that begins with '*'. If you see a '*' at the start
-    of a line, you have found the start of a new section.</p>
-<p>An example file might look like this:</p>
-<pre>*version
-1
-clock=global
-*threads
-1 main
-6 JDWP Handler
-5 Async GC
-4 Reference Handler
-3 Finalizer
-2 Signal Handler
-*methods
-0x080f23f8 java/io/PrintStream write ([BII)V
-0x080f25d4 java/io/PrintStream print (Ljava/lang/String;)V
-0x080f27f4 java/io/PrintStream println (Ljava/lang/String;)V
-0x080da620 java/lang/RuntimeException	&lt;init&gt;	()V
-[...]
-0x080f630c android/os/Debug startMethodTracing ()V
-0x080f6350 android/os/Debug startMethodTracing (Ljava/lang/String;Ljava/lang/String;I)V
-*end</pre>
-<dl>
-    <dt><em>version section</em></dt>
-    <dd>The first line is the file version number, currently
-        1.
-        The second line, <code>clock=global</code>, indicates that we use a common
-        clock across all threads. A future version may use per-thread CPU time counters
-        that are independent for every thread.</dd>
-    <dt><em>threads section</em></dt>
-    <dd>One line per thread. Each line consists of two parts: the thread ID, followed
-        by a tab, followed by the thread name. There are few restrictions on what
-        a valid thread name is, so include everything to the end of the line.</dd>
-    <dt><em>methods section </em></dt>
-    <dd>One line per method entry or exit. A line consists of four pieces,
-        separated by tab marks: <em>method-ID</em> [TAB] <em>class-name</em> [TAB] 
-        <em>method-name</em> [TAB] 
-        <em>signature</em> . Only
-        the methods that were actually entered or exited are included in the list.
-        Note that all three identifiers are required to uniquely identify a
-        method.</dd>
-</dl>
-<p>Neither the threads nor methods sections are sorted.</p>
-
-<a name="knownissues"></a>
-<h2>Traceview Known Issues</h2>
-<dl>
-	<dt>Threads</dt>
-	<dd>Traceview logging does not handle threads well, resulting in these two problems:
-<ol>
-  <li> If a thread exits during profiling, the thread name is not emitted; </li>
-    <li>The VM reuses thread IDs. If a thread stops and another starts, they
-        may get the same ID. </li>
-</ol>
-</dd>
-
-<a name="dmtracedump"></a>
-
-<h2>Using dmtracedump</h2>
-
-<p>The Android SDK includes dmtracedump, a tool that gives you an alternate way 
-	of generating graphical call-stack diagrams from trace log files. The tool 
-	uses the Graphviz Dot utility to create the graphical output, so you need to 
-	install Graphviz before running dmtracedump.</p>
-	
-<p>The dmtracedump tool generates the call stack data as a tree diagram, with each call 
-	represented as a node. It shows call flow (from parent node to child nodes) using 
-	arrows. The diagram below shows an example of dmtracedump output.</p>
-	
-<img src="{@docRoot}images/tracedump.png" width="485" height="401" style="margin-top:1em;"/>
-
-<p style="margin-top:1em;">For each node, dmtracedump shows <code>&lt;ref> <em>callname</em> (&lt;inc-ms>,
-	&lt;exc-ms>,&lt;numcalls>)</code>, where</p>
-
-<ul>
-		<li><code>&lt;ref></code> -- Call reference number, as used in trace logs</li>
-		<li><code>&lt;inc-ms></code> -- Inclusive elapsed time (milliseconds spent in method, including all child methods)</li>
-		<li><code>&lt;exc-ms></code> -- Exclusive elapsed time (milliseconds spent in method, not including any child methods)</li>
-		<li><code>&lt;numcalls></code> -- Number of calls</li>
-</ul>
-
-<p>The usage for dmtracedump is: </p>
-
-<pre>dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] &lt;trace-base-name></pre>
-
-<p>The tool then loads trace log data from &lt;trace-base-name>.data and &lt;trace-base-name>.key. 
-	The table below lists the options for dmtracedump.</p>
-
-<table>
-<tr>
-  <th>Option</td>
-  <th>Description</th>
-</tr>
-  
-  <tr>
-	<td><code>-d&nbsp;&lt;trace-base-name> </code></td>
-	<td>Diff with this trace name</td>
-  </tr>
-  <tr>
-	<td><code>-g&nbsp;&lt;outfile> </code></td>
-	<td>Generate output to &lt;outfile></td>
-  </tr>
-  <tr>
-	<td><code>-h </code></td>
-	<td>Turn on HTML output</td>
-  </tr>
-  <tr>
-	<td><code>-o </code></td>
-	<td>Dump the trace file instead of profiling</td>
-  </tr>
-  <tr>
-	<td><code>-d&nbsp;&lt;trace-base-name> </code></td>
-	<td>URL base to the location of the sortable javascript file</td>
-  </tr>
-  <tr>
-	<td><code>-t&nbsp;&lt;percent> </code></td>
-	<td>Minimum threshold for including child nodes in the graph (child's inclusive 
-		time as a percentage of parent inclusive time). If this option is not used, 
-		the default threshold is 20%. </td>
-  </tr>
-
-</table>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 4842589..a984acd 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -262,7 +262,7 @@
       </li>
       <li><a href="<?cs var:toroot?>guide/topics/admin/device-admin.html">
             <span class="en">Device Administration</span>
-         </a> <span class="new">new!</span>
+         </a>
       </li>
       <li class="toggle-list">
            <div>
@@ -274,27 +274,22 @@
               <li>
                 <a href="<?cs var:toroot?>guide/topics/testing/testing_android.html">
                 <span class="en">Testing Fundamentals</span></a>
-                <span class="new">new!</span>
               </li>
               <li>
                 <a href="<?cs var:toroot?>guide/topics/testing/activity_testing.html">
                 <span class="en">Activity Testing</span></a>
-                <span class="new">new!</span>
               </li>
               <li>
                 <a href="<?cs var:toroot?>guide/topics/testing/contentprovider_testing.html">
                 <span class="en">Content Provider Testing</span></a>
-                <span class="new">new!</span>
               </li>
               <li>
                 <a href="<?cs var:toroot?>guide/topics/testing/service_testing.html">
                 <span class="en">Service Testing</span></a>
-                <span class="new">new!</span>
               </li>
               <li>
                 <a href="<?cs var:toroot ?>guide/topics/testing/what_to_test.html">
                 <span class="en">What To Test</span></a>
-                <span class="new">new!</span>
               </li>
 
            </ul>
@@ -316,7 +311,7 @@
   <!--<li><a href="">Developing for Android</a></li>
       signing, upgrading, selecting a package name, select device profile, touch, trackball, dpad available, etc. -->
       <li>
-        <a href="<?cs var:toroot ?>guide/developing/overview.html">
+        <a href="<?cs var:toroot ?>guide/developing/index.html">
         <span class="en">Overview</span></a>
       </li>
 
@@ -359,7 +354,7 @@
         <ul>
           <li>
             <a href="<?cs var:toroot ?>guide/developing/projects/projects-eclipse.html">
-              <span class="en">In Eclipse</span>
+              <span class="en">In Eclipse with ADT</span>
             </a>
           </li>
           <li>
@@ -378,9 +373,9 @@
         </div>
         <ul>
           <li><a href="<?cs var:toroot ?>guide/developing/building/building-eclipse.html">
-          <span class="en">In Eclipse</span>
+          <span class="en">In Eclipse with ADT</span>
           </a></li>
-          <li><a href="<?cs var:toroot ?>guide/developing/building/building-cmdline.html"><span class="en">In Other IDEs</span></a></li>
+          <li><a href="<?cs var:toroot ?>guide/developing/building/building-cmdline.html"><span class="en">On the Command Line</span></a></li>
         </ul>
       </li>
 
@@ -393,7 +388,7 @@
         <ul>
           <li>
             <a href="<?cs var:toroot ?>guide/developing/debugging/debugging-projects.html">
-         	    <span class="en">In Eclipse</span>
+         	    <span class="en">In Eclipse with ADT</span>
             </a>
           </li>
           <li>
@@ -438,13 +433,13 @@
            <ul>
               <li>
                 <a href="<?cs var:toroot ?>guide/developing/testing/testing_eclipse.html">
-                  <span class="en">Testing in Eclipse, with ADT</span>
+                  <span class="en">In Eclipse with ADT</span>
                 </a>
               </li>
 
               <li>
                 <a href="<?cs var:toroot ?>guide/developing/testing/testing_otheride.html">
-                  <span class="en">Testing in Other IDEs</span>
+                  <span class="en">In Other IDEs</span>
                 </a>
               </li>
            </ul>
@@ -462,41 +457,40 @@
           <li><a href="<?cs var:toroot ?>guide/developing/tools/dmtracedump.html">dmtracedump</a></li>
           <li><a href="<?cs var:toroot ?>guide/developing/tools/draw9patch.html" >Draw 9-Patch</a></li>
           <li><a href="<?cs var:toroot ?>guide/developing/tools/emulator.html">Emulator</a></li>
+          <li><a href="<?cs var:toroot ?>guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a></li>
           <li><a href="<?cs var:toroot ?>guide/developing/tools/hprof-conv.html">hprof-conv</a></li>
           <li><a href="<?cs var:toroot ?>guide/developing/tools/layoutopt.html">layoutopt</a></li>
           <li><a href="<?cs var:toroot ?>guide/developing/tools/logcat.html">logcat</a></li>
           <li><a href="<?cs var:toroot ?>guide/developing/tools/mksdcard.html">mksdcard</a></li>
-          <li><a href="/guide/developing/tools/monkey.html">Monkey</a></li> 
-              <li class="toggle-list"> 
-                 <div> 
-                     <a href="/guide/developing/tools/monkeyrunner_concepts.html"> 
-                     <span class="en">monkeyrunner</span> 
-                  </a> 
-                      <span class="new">new!</span> 
-                  </div> 
-                  <ul> 
-                      <li> 
-                          <a href="/guide/developing/tools/MonkeyDevice.html"> 
-                                <span class="en">MonkeyDevice</span> 
-                        </a> 
-                        <span class="new">new!</span> 
-                    </li> 
-                    <li> 
-                        <a href="/guide/developing/tools/MonkeyImage.html"> 
-                            <span class="en">MonkeyImage</span> 
-                        </a> 
-                        <span class="new">new!</span> 
-                    </li> 
-                    <li> 
-                        <a href="/guide/developing/tools/MonkeyRunner.html"> 
-                            <span class="en">MonkeyRunner</span> 
-                        </a> 
-                        <span class="new">new!</span> 
-                    </li> 
-                  </ul> 
-              </li> 
-              <li><a href="/guide/developing/tools/proguard.html">ProGuard</a> <span class="new">new!</span></li> 
-              <li><a href="/guide/developing/tools/adb.html#sqlite">sqlite3</a></li> 
+
+          <li><a href="/guide/developing/tools/monkey.html">Monkey</a></li>
+              <li class="toggle-list">
+                 <div>
+                     <a href="/guide/developing/tools/monkeyrunner_concepts.html">
+                     <span class="en">monkeyrunner</span>
+                  </a>
+                  </div>
+                  <ul>
+                      <li>
+                          <a href="/guide/developing/tools/MonkeyDevice.html">
+                                <span class="en">MonkeyDevice</span>
+                        </a>
+                    </li>
+                    <li>
+                        <a href="/guide/developing/tools/MonkeyImage.html">
+                            <span class="en">MonkeyImage</span>
+                        </a>
+                    </li>
+                    <li>
+                        <a href="/guide/developing/tools/MonkeyRunner.html">
+                            <span class="en">MonkeyRunner</span>
+                        </a>
+                    </li>
+                  </ul>
+              </li>
+              <li><a href="/guide/developing/tools/proguard.html">ProGuard</a></li>
+              <li><a href="/guide/developing/tools/adb.html#sqlite">sqlite3</a></li>
+              <li><a href="/guide/developing/tools/traceview.html">Traceview</a></li>
           <li><a href="<?cs var:toroot ?>guide/developing/tools/zipalign.html">zipalign</a></li>
         </ul>
       </li>
@@ -536,7 +530,7 @@
           </a></li>
       <li><a href="<?cs var:toroot ?>guide/publishing/licensing.html">
             <span class="en">Licensing Your Applications</span>
-          </a> <span class="new">new!</span></li>
+          </a></li>
       <li><a href="<?cs var:toroot ?>guide/publishing/preparing.html">
             <span class="en">Preparing to Publish</span>
             <span class="de" style="display:none">Vorbereitung auf die Veröffentlichung</span>
@@ -631,19 +625,19 @@
     <ul>
       <li><a href="<?cs var:toroot ?>guide/webapps/index.html">
             <span class="en">Web Apps Overview</span>
-          </a> <span class="new">new!</span><!-- 11/1/10 --></li>
+          </a></li>
       <li><a href="<?cs var:toroot ?>guide/webapps/targeting.html">
             <span class="en">Targeting Screens from Web Apps</span>
-          </a> <span class="new">new!</span><!-- 11/1/10 --></li>
+          </a></li>
       <li><a href="<?cs var:toroot ?>guide/webapps/webview.html">
             <span class="en">Building Web Apps in WebView</span>
-          </a> <span class="new">new!</span><!-- 11/1/10 --></li>
+          </a></li>
       <li><a href="<?cs var:toroot ?>guide/webapps/debugging.html">
             <span class="en">Debugging Web Apps</span>
-          </a> <span class="new">new!</span><!-- 11/1/10 --></li>
+          </a></li>
       <li><a href="<?cs var:toroot ?>guide/webapps/best-practices.html">
             <span class="en">Best Practices for Web Apps</span>
-          </a> <span class="new">new!</span><!-- 11/1/10 --></li>
+          </a></li>
     </ul>
   </li>
 
diff --git a/docs/html/guide/practices/design/performance.jd b/docs/html/guide/practices/design/performance.jd
index f5588ac..97b31cf 100644
--- a/docs/html/guide/practices/design/performance.jd
+++ b/docs/html/guide/practices/design/performance.jd
@@ -425,7 +425,7 @@
 to run your own microbenchmarks.</p>
 
 <p>You may also find
-<a href="{@docRoot}guide/developing/tools/traceview.html">Traceview</a> useful
+<a href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Traceview</a> useful
 for profiling, but it's important to realize that it currently disables the JIT,
 which may cause it to misattribute time to code that the JIT may be able to win
 back. It's especially important after making changes suggested by Traceview
diff --git a/docs/html/guide/practices/screens_support.jd b/docs/html/guide/practices/screens_support.jd
index 5738bd6..520bd28 100644
--- a/docs/html/guide/practices/screens_support.jd
+++ b/docs/html/guide/practices/screens_support.jd
@@ -38,7 +38,7 @@
     <li><a
 href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">
 Providing Alternative Resources</a></li>
-    <li><a href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a></li>
+    <li><a href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a></li>
   </ol>
 
 </div>
@@ -1205,7 +1205,7 @@
 Manager or the <code>android</code> tool to create AVDs that use the various
 emulator skins and you can also set up custom AVDs to test densities other than
 the defaults. For general information about working with AVDs, see
-<a href="{@docRoot}guide/developing/tools/avd.html">Android Virtual
+<a href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual
 Devices</a>.</p>
 
 <p>The Android SDK provides a set of default emulator skins that you can use for
diff --git a/docs/html/guide/publishing/app-signing.jd b/docs/html/guide/publishing/app-signing.jd
index 101646e..93077a0 100644
--- a/docs/html/guide/publishing/app-signing.jd
+++ b/docs/html/guide/publishing/app-signing.jd
@@ -240,8 +240,8 @@
 compile your app, the build script generates a keystore/key and signs the .apk for you. 
 The script then also aligns the .apk with the <code>zipalign</code> tool.
 No other action on your part is needed. Read 
-<a href="{@docRoot}guide/developing/other-ide.html#DebugMode">Developing In Other IDEs: Building
-in debug mode</a> for more information.</p>
+<a href="{@docRoot}guide/developing/building/building-cmdline.html#DebugMode">Building and Running Apps
+on the Command Line</a> for more information.</p>
 
 
 <h3 id="debugexpiry">Expiry of the Debug Certificate</h3>
@@ -441,8 +441,8 @@
 <code><em>&lt;your_project_name></em>-release.apk</code>. With these steps
 automated for you, you're able to skip the manual procedures below (steps 3 and 4).
 To learn how to specify your keystore and alias in the {@code build.properties} file,
-see <a href="{@docRoot}guide/developing/other-ide.html#ReleaseMode">Developing In Other
-IDEs: Building in release mode</a>.</p>
+see <a href="{@docRoot}guide/developing/building/building-cmdline.html#ReleaseMode">
+Building and Running Apps on the Command Line</a>.</p>
 
 
 
diff --git a/docs/html/guide/publishing/licensing.jd b/docs/html/guide/publishing/licensing.jd
index 40439f0..e099413 100644
--- a/docs/html/guide/publishing/licensing.jd
+++ b/docs/html/guide/publishing/licensing.jd
@@ -518,7 +518,7 @@
 </ol>
 
 <p>If you are not familiar with AVDs or how to use them, see <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>.</p>
+href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a>.</p>
 
 <h4 id="project-update">Updating your project configuration</h4>
 
@@ -628,12 +628,9 @@
 share its code and resources across multiple applications. </p>
 
 <p style="margin-top:.5em;">If you aren't familiar with library projects or how
-to use them, read more in <a
-href="{@docRoot}guide/developing/eclipse-adt.html#libraryProject">Developing in
-Eclipse with ADT</a> or <a
-href="{@docRoot}guide/developing/other-ide.html#libraryProject">Developing in
-Other IDEs</a>, as appropriate for your environment.</p>
-
+to use them, see <a href="{@docRoot}guide/developing/projects/index.html#LibraryProjects">
+Creating and Managing Projects</a>.
+</p>
 </div>
 </div>
 
@@ -669,9 +666,8 @@
 no further configuration is needed. </p>
 
 <p>For more information about how to create an application project or work with
-library projects in Eclipse, see <a
-href="{@docRoot}guide/developing/eclipse-adt.html#CreatingAProject">Developing
-in Eclipse with ADT</a>.</p>
+library projects in Eclipse, see <a href="{@docRoot}guide/developing/projects/projects-eclipse.html">
+Creating and Managing Projects in Eclipse</a></p>.
 
 <h4>Copying the LVL sources to your application</h4>
 
@@ -701,9 +697,9 @@
 <p>Next, open the application's project properties window, as shown below.
 Select the "Android" properties group and click <strong>Add</strong>, then
 choose the LVL library project (com_android_vending_licensing) and click
-<strong>OK</strong>. For more information, see
-<a href="{@docRoot}guide/developing/eclipse-adt.html#libraryProject">Developing
-in Eclipse with ADT</a></p>
+<strong>OK</strong>. For more information, see 
+<a href="{@docRoot}developing/projects/projects-eclipse.html#SettingUpLibraryProject">
+Creating and Managing Projects in Eclipse</a></p>.
 
 <div style="margin-bottom:2em;">
 
@@ -730,11 +726,9 @@
 --library <em>path/to/my/library_project</em>
 </pre>
 
-<p>For more information about working with library projects, see <a
-href="{@docRoot}guide/developing/eclipse-adt.html#libraryProject">Developing
-in Eclipse with ADT</a> or <a
-href="{@docRoot}guide/developing/other-ide.html#libraryProject">Developing in
-Other IDEs</a>, as appropriate for your environment.</p>
+<p>For more information about working with library projects, 
+see <a href="{@docRoot}developing/projects/projects-cmdline.html#SettingUpLibraryProject">
+Creating and Managing Projects on the Command Line</a></p>.
 
 
 <h2 id="app-integration">Integrating the LVL with Your Application</h2>
diff --git a/docs/html/guide/topics/fragments/index.jd b/docs/html/guide/topics/fragments/index.jd
index 766146e..d07daf4 100644
--- a/docs/html/guide/topics/fragments/index.jd
+++ b/docs/html/guide/topics/fragments/index.jd
@@ -277,13 +277,13 @@
 which to place the fragment.</p>
   <p>To make any fragment transactions in your activity (such as add, remove, or replace a
 fragment), you must use APIs from {@link android.app.FragmentTransaction}. You can get an instance
-of {@link android.app.FragmentTransaction} from your {@link android.app.Activity} using {@link
-android.app.Activity#openFragmentTransaction()}. You can then add a fragment using the {@link
+of {@link android.app.FragmentTransaction} from your {@link android.app.FragmentManager} using {@link
+android.app.FragmentManager#openTransaction()}. You can then add a fragment using the {@link
 android.app.FragmentTransaction#add add()} method, specifying the fragment to add and the view in
 which to insert it. For example:</p>
 <pre>
 MyFragment fragment = new MyFragment();
-openFragmentTransaction().add(R.id.fragment_container, fragment).commit();
+getFragmentManager().openTransaction().add(R.id.fragment_container, fragment).commit();
 </pre>
   <p>The first argument passed to {@link android.app.FragmentTransaction#add add()}
 is the {@link android.view.ViewGroup} in which the fragment should be placed, specified by
@@ -372,8 +372,8 @@
 operations on a fragment as the user interacts with the activity, alowing for more rich user
 experiences without changing activities. In order to perform these operations, you must use {@link
 android.app.FragmentTransaction} to perform fragment "transactions." You can acquire {@link
-android.app.FragmentTransaction} from your activity with {@link
-android.app.Activity#openFragmentTransaction}.</p>
+android.app.FragmentTransaction} from your FragmentManager with {@link
+android.app.FragmentManager#openTransaction}.</p>
 
 <p>Common transactions you can perform with fragments include:</p>
 
@@ -397,7 +397,7 @@
 <pre>
 // Create new fragment
 Fragment newFragment = new MyFragment();
-FragmentTransaction ft = openFragmentTransaction();
+FragmentTransaction ft = getFragmentManager().openTransaction();
 // Replace and add to back stack
 ft.replace(R.id.myfragment, newFragment);
 ft.addToBackStack(null);
@@ -519,7 +519,7 @@
 
 <p>Likewise, your activity can call public methods in the fragment when you have a reference to the
 {@link android.app.Fragment}. You can acquire a reference to the fragment with {@link
-android.app.Activity#findFragmentById findFragmentById()} and cast it to your implementation of
+android.app.FragmentManager#findFragmentById findFragmentById()} and cast it to your implementation of
 {@link android.app.Fragment}. For example:</p>
 
 <pre>
diff --git a/docs/html/guide/topics/fundamentals.jd b/docs/html/guide/topics/fundamentals.jd
index fffc1cd..1658fa6 100644
--- a/docs/html/guide/topics/fundamentals.jd
+++ b/docs/html/guide/topics/fundamentals.jd
@@ -52,10 +52,9 @@
 <p>
 Android applications are written in the Java programming language. 
 The compiled Java code &mdash; along with any data and resource 
-files required by the application &mdash; is bundled by the 
-<a href="{@docRoot}guide/developing/tools/aapt.html"><code>aapt</code> 
-tool</a> into an <i>Android package</i>, an archive file 
-marked by an {@code .apk} suffix.  This file is the vehicle 
+files required by the application &mdash; is bundled into an 
+<i>Android package</i>, an archive file 
+marked by an {@code .apk} suffix. This file is the vehicle 
 for distributing the application and installing it on mobile devices; 
 it's the file users download to their devices.  All the code in a 
 single {@code .apk} file is considered to be one <i>application</i>.
@@ -425,7 +424,7 @@
 <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></code>
 elements for content providers.  Activities, services, and content providers 
 that are not declared in the manifest are not visible to the system and are 
-consequently never run.  However, broadcast receivers can either be 
+consequently never run. However, broadcast receivers can either be 
 declared in the manifest, or they can be created dynamically in code 
 (as {@link android.content.BroadcastReceiver} objects) 
 and registered with the system by calling 
diff --git a/docs/html/guide/topics/graphics/2d-graphics.jd b/docs/html/guide/topics/graphics/2d-graphics.jd
index 5759be5..05f4023 100644
--- a/docs/html/guide/topics/graphics/2d-graphics.jd
+++ b/docs/html/guide/topics/graphics/2d-graphics.jd
@@ -61,7 +61,7 @@
 
 <p class="note"><strong>Note:</strong> Image resources placed in <code>res/drawable/</code> may be 
 automatically optimized with lossless image compression by the 
-<a href="{@docRoot}guide/developing/tools/aapt.html">aapt</a> tool. For example, a true-color PNG that does
+<code>aapt</code> tool during the build process. For example, a true-color PNG that does
 not require more than 256 colors may be converted to an 8-bit PNG with a color palette. This 
 will result in an image of equal quality but which requires less memory. So be aware that the
 image binaries placed in this directory can change during the build. If you plan on reading
diff --git a/docs/html/guide/topics/location/obtaining-user-location.jd b/docs/html/guide/topics/location/obtaining-user-location.jd
index bc782d2..3b450f0 100644
--- a/docs/html/guide/topics/location/obtaining-user-location.jd
+++ b/docs/html/guide/topics/location/obtaining-user-location.jd
@@ -421,8 +421,8 @@
     <li>Use a KML file describing individual place marks for sequenced playback to the device.</li>
 </ul>
 
-<p>For more information on using DDMS to spoof location data, see the
-<a href="{@docRoot}guide/developing/tools/ddms.html#emulator-control">Using DDMS guide</a>.
+<p>For more information on using DDMS to spoof location data, see
+<a href="{@docRoot}guide/developing/debugging/ddms.html">Using DDMS</a>.
 
 
 <h3 id="MockGeo">Using the "geo" command in the emulator console</h3>
@@ -451,4 +451,4 @@
 </ol>
 
 <p>For information about how to connect to the emulator console, see
-<a href="{@docRoot}guide/developing/tools/emulator.html#console">Using the Emulator Console</a>.</p>
+<a href="{@docRoot}guide/developing/devices/emulator.html#console">Using the Emulator Console</a>.</p>
diff --git a/docs/html/guide/topics/resources/drawable-resource.jd b/docs/html/guide/topics/resources/drawable-resource.jd
index d9f619f..cee8fc3 100644
--- a/docs/html/guide/topics/resources/drawable-resource.jd
+++ b/docs/html/guide/topics/resources/drawable-resource.jd
@@ -74,7 +74,7 @@
 alias resource ID in XML.</p>
 
 <p class="note"><strong>Note:</strong> Bitmap files may be automatically optimized with lossless
-image compression by the <a href="{@docRoot}guide/developing/tools/aapt.html">aapt</a> tool. For
+image compression by the <code>aapt</code> tool during the build process. For
 example, a true-color PNG that does not require more than 256 colors may be converted to an 8-bit
 PNG with a color palette. This will result in an image of equal quality but which requires less
 memory. So be aware that the image binaries placed in this directory can change during the build. If
diff --git a/docs/html/guide/topics/testing/testing_android.jd b/docs/html/guide/topics/testing/testing_android.jd
index d4b0dcc..6f3048c 100755
--- a/docs/html/guide/topics/testing/testing_android.jd
+++ b/docs/html/guide/topics/testing/testing_android.jd
@@ -625,9 +625,8 @@
 </p>
 <p>
     When possible, you should run these tests on an actual device. If this is not possible, you can
-    use the <a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a> with
-    <a href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a> configured for
-    the hardware, screens, and versions you want to test.
+    use the <a href="{@docRoot}guide/developing/devices/emulator.html">Android Emulator</a> with
+    Android Virtual Devices configured for the hardware, screens, and versions you want to test.
 </p>
 <h2 id="NextSteps">Next Steps</h2>
 <p>
diff --git a/docs/html/guide/topics/ui/declaring-layout.jd b/docs/html/guide/topics/ui/declaring-layout.jd
index 843414a..c348767 100644
--- a/docs/html/guide/topics/ui/declaring-layout.jd
+++ b/docs/html/guide/topics/ui/declaring-layout.jd
@@ -47,11 +47,11 @@
   Plugin for Eclipse</a> offers a layout preview of your XML &mdash; 
   with the XML file opened, select the <strong>Layout</strong> tab.</li>
   <li>You should also try the 
-  <a href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a> tool, 
+  <a href="{@docRoot}guide/developing/debugging/debugging-ui.html#hierarchyViewer">Hierarchy Viewer</a> tool, 
   for debugging layouts &mdash; it reveals layout property values, 
   draws wireframes with padding/margin indicators, and full rendered views while 
   you debug on the emulator or device.</li>
-  <li>The <a href="{@docRoot}guide/developing/tools/layoutopt.html">layoutopt</a> tool lets
+  <li>The <a href="{@docRoot}guide/developing/debugging/debugging-ui.html#layoutopt">layoutopt</a> tool lets
   you quickly analyze your layouts and hierarchies for inefficiencies or other problems.</li>
 </div>
 </div>
diff --git a/docs/html/guide/tutorials/hello-world.jd b/docs/html/guide/tutorials/hello-world.jd
index 6e315b2..11e6497 100644
--- a/docs/html/guide/tutorials/hello-world.jd
+++ b/docs/html/guide/tutorials/hello-world.jd
@@ -23,9 +23,11 @@
 great plugin that handles your project creation and management to greatly speed-up your
 development cycles.</p>
 
-<p>If you're not using Eclipse, that's okay. Familiarize yourself with 
-<a href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>.
-You can then return to this tutorial and ignore anything about Eclipse.</p>
+<p>If you are not using Eclipse, the tools provided by the Android SDK are accessible
+on the command line, so you can choose your IDE or text editor.
+For more information about developing with the Android SDK tools, see
+the <a href="{@docRoot}guide/developing/index.html">Overview</a>
+section for developing on Android.</p>
 
 <p>Before you start, you should already have the very latest SDK installed, and if you're using
 Eclipse, you should have installed the ADT plugin as well. If you have not installed these, see 
@@ -562,5 +564,6 @@
   <p>This creates the required folders and files for the project at the location 
   defined by the <em>path</em>.</p>
   
-  <p>For more information on how to use the SDK tools to create and build projects, please read 
-<a href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>.</p>
+  <p>For more information on how to use the SDK tools to create and build projects on the command line, read
+<a href="{@docRoot}guide/developing/projects/index.html">Creating and Managing Projects on the Command Line</a> and
+<a href="{@docRoot}guide/developing/building/building-cmdline.html">Building and Running Apps on the Command Line</a>.</p>
diff --git a/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd b/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd
index 0d59b56..34f7063 100644
--- a/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd
+++ b/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd
@@ -65,6 +65,6 @@
 
 <p>The Android Eclipse plugin not only offers excellent debugging support for
 your application development, but also superb profiling support. You can also
-try using <a href="{@docRoot}guide/developing/tools/traceview.html">Traceview</a> to profile your application. If your application is running too slow, this can help you 
+try using <a href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Traceview</a> to profile your application. If your application is running too slow, this can help you 
 find the bottlenecks and fix them.</p>
 
diff --git a/docs/html/guide/webapps/debugging.jd b/docs/html/guide/webapps/debugging.jd
index ee4b723..c0dce48 100644
--- a/docs/html/guide/webapps/debugging.jd
+++ b/docs/html/guide/webapps/debugging.jd
@@ -18,7 +18,7 @@
 
 <h2>See also</h2>
 <ol>
-  <li><a href="{@docRoot}guide/developing/debug-tasks.html">Debugging Tasks</a></li>
+  <li><a href="{@docRoot}guide/developing/debugging/index.html">Debugging</a></li>
 </ol>
 
 </div>
@@ -46,8 +46,8 @@
 <strong>Device > Run logcat</strong>. When using the <a href="{@docRoot}sdk/eclipse-adt.html">ADT
 plugin for Eclipse</a>, you can also view logcat messages by opening the Logcat view, available from
 <strong>Window > Show View > Other > Android > Logcat</strong>.</p>
-  <p>See <a href="{@docRoot}guide/developing/debug-tasks.html">Debugging
-Tasks</a> for more information about logcat.</p>
+  <p>See <a href="{@docRoot}guide/developing/debugging/debugging-log.html">Debugging</a>
+  for more information about <codelogcat</code>.</p>
 </div>
 </div>
 
diff --git a/docs/html/resources/articles/backward-compatibility.jd b/docs/html/resources/articles/backward-compatibility.jd
index 4b1a34c..ad64dfc 100644
--- a/docs/html/resources/articles/backward-compatibility.jd
+++ b/docs/html/resources/articles/backward-compatibility.jd
@@ -245,6 +245,6 @@
 to do this easily by creating "Android Virtual Devices" with different API
 levels. Once you create the AVDs, you can test your application with old and new
 versions of the system, perhaps running them side-by-side to see the
-differences. More information about emulator AVDs can be found <a
-href="{@docRoot}guide/developing/tools/avd.html">in the AVD documentation</a> and
+differences. More information about emulator AVDs can be found in <a
+href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a> and
 from <code>emulator -help-virtual-device</code>.</p>
\ No newline at end of file
diff --git a/docs/html/resources/articles/layout-tricks-merge.jd b/docs/html/resources/articles/layout-tricks-merge.jd
index 00e0479..95409e4 100644
--- a/docs/html/resources/articles/layout-tricks-merge.jd
+++ b/docs/html/resources/articles/layout-tricks-merge.jd
@@ -44,7 +44,7 @@
 <div style="text-align: center;"><img src="images/merge1.jpg" alt="A FrameLayout is used to overlay a title on top of an image"></div>
 
 <p>Things get more interesting when you inspect the result with <a
-href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">HierarchyViewer</a>. 
+href="{@docRoot}guide/developing/debugging/debugging-ui.html#hierarchyViewer">HierarchyViewer</a>. 
 If you look closely at the resulting tree, you will notice that the
 <code>FrameLayout</code> defined in our XML file (highlighted in blue below) is
 the sole child of another <code>FrameLayout</code>:</p>
diff --git a/docs/html/resources/faq/commontasks.jd b/docs/html/resources/faq/commontasks.jd
index 1173725..807df08 100644
--- a/docs/html/resources/faq/commontasks.jd
+++ b/docs/html/resources/faq/commontasks.jd
@@ -97,7 +97,7 @@
         the device, are described below.
         The list of files you'll need for your application are described in <a href="#filelist">List
         of Files for an Android Application</a>. </li>
-    <li><strong><a href="{@docRoot}guide/developing/other-ide.html#buildingwithant">Build and install your
+    <li><strong><a href="{@docRoot}guide/developing/building/building-cmdline.html">Build and install your
                 package</a>.</strong> The Android SDK has some nice tools for generating
                 projects and debugging code. </li>
 </ol>
diff --git a/docs/html/resources/faq/troubleshooting.jd b/docs/html/resources/faq/troubleshooting.jd
index f3252b0..05a7ddab 100644
--- a/docs/html/resources/faq/troubleshooting.jd
+++ b/docs/html/resources/faq/troubleshooting.jd
@@ -5,7 +5,8 @@
 
 
 <p>Here are some tips and tricks for common Android errors. Don't forget to use the
-    ddms logcat capability to get a deeper view when errors occur. See <a href="{@docRoot}guide/developing/debug-tasks.html">Debugging</a> for more debugging tips. </p>
+    ddms logcat capability to get a deeper view when errors occur. 
+    See the <a href="{@docRoot}guide/developing/debugging/index.html">Debugging</a> documentation for more information.</p>
 <ul>
     <li><a href="#installeclipsecomponents">ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui".</a></li>
     <li><a href="#nodevice">ADB reports &quot;no device&quot; when an emulator is running</a></li>
@@ -282,9 +283,10 @@
 
 <p>If you get an error message such as "Could not load /sdcard/gestures. 
 Make sure you have a mounted SD card," be sure that your target AVD has an 
-SD card. To create an AVD that has an SD card, use the
-<a href="{@docRoot}guide/developing/tools/avd.html#options"><code>-c</code> 
-option</a> in the <code>android create avd</code> command.</p> 
+SD card. To create an AVD that has an SD card, specify one when creating
+an AVD with the AVD manager. See 
+<a href="{@docRoot}guide/developing/devices/managing-avds.html#createavd">
+Creating and Managing AVDs with AVD Manager</a> for more information.</p>
 
 <h2 id="signingcalendar">I can't compile my app because the build tools generated an expired debug certificate</h2>
 
diff --git a/docs/html/resources/resources_toc.cs b/docs/html/resources/resources_toc.cs
index 1c1ece9..a2580a6 100644
--- a/docs/html/resources/resources_toc.cs
+++ b/docs/html/resources/resources_toc.cs
@@ -87,8 +87,7 @@
 ?>
 
   <li>
-   <h2><span class="en">More</span>
-    </h2>
+   <h2><span class="en">More</span></h2>
     <ul>
       <li><a href="<?cs var:toroot ?>resources/faq/commontasks.html">
             <span class="en">Common Tasks </span>
diff --git a/docs/html/resources/samples/index.jd b/docs/html/resources/samples/index.jd
index cbe6ca3..beecd67 100644
--- a/docs/html/resources/samples/index.jd
+++ b/docs/html/resources/samples/index.jd
@@ -18,6 +18,13 @@
 -->
 <dl>
 
+ <dt><a href="AccelerometerPlay/index.html">Accelerometer Play</a></dt>
+  <dd>An example that demonstrates how to use accelerometer readings
+  in an application.</dd>
+  
+ <dt><a href="AccessibilityService/index.html">Accessibility Service</a></dt>
+  <dd>An example that demonstrates the use of accessibility APIs.</dd>
+
  <dt><a href="ApiDemos/index.html">API Demos</a></dt>
   <dd>A variety of small applications that demonstrate an extensive collection of
   framework topics.</dd>
diff --git a/docs/html/resources/tutorials/testing/activity_test.jd b/docs/html/resources/tutorials/testing/activity_test.jd
index ec878d2..afb9e3c 100644
--- a/docs/html/resources/tutorials/testing/activity_test.jd
+++ b/docs/html/resources/tutorials/testing/activity_test.jd
@@ -239,7 +239,8 @@
 <p>
   In this tutorial, you will use the Android emulator to run applications. The emulator needs
   an Android Virtual Device (AVD) with an API level equal to or higher than the one you set for the projects in the previous step.
-  To find out how to check this and create the right AVD if necessary, see <a href="{@docRoot}guide/developing/eclipse-adt.html#AVD">Creating an AVD</a>.
+  To find out how to check this and create the right AVD if necessary, 
+  see <a href="{@docRoot}guide/developing/devices/managing-avds.html">Creating an AVD</a>.
 </p>
 <p>
     As a test of the AVD and emulator, run the SpinnerActivity application in Eclipse with ADT. When it starts,
@@ -1237,7 +1238,7 @@
    also use this tool to run the test application from the command line.
   </li>
   <li>
-    <a href="{@docRoot}guide/developing/tools/othertools.html#android">android</a> - Manages projects and test projects. This tool also manages AVDs and Android platforms.
+    <a href="{@docRoot}guide/developing/tools/android.html">android</a> - Manages projects and test projects. This tool also manages AVDs and Android platforms.
   </li>
 </ul>
   <p>
diff --git a/docs/html/resources/tutorials/views/hello-mapview.jd b/docs/html/resources/tutorials/views/hello-mapview.jd
index a3fa548..836d22c 100644
--- a/docs/html/resources/tutorials/views/hello-mapview.jd
+++ b/docs/html/resources/tutorials/views/hello-mapview.jd
@@ -17,13 +17,13 @@
 
 <p>After installing the Google APIs add-on in your SDK, set your project properties to use the build
 target called "Google APIs by Google Inc.". See the instructions for setting a build
-target in <a href="{@docRoot}guide/developing/eclipse-adt.html">Developing in
-Eclipse with ADT</a> or <a
-href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>,
-as appropriate for your environment. </p>
+target in <a href="{@docRoot}guide/developing/projects/projects-eclipse.html#CreatingAProject">
+Creating and Managing Projects in Eclipse</a> or <a
+href="{@docRoot}guide/developing/projects/projects-cmdline.html#CreatingAProject">
+Creating and Managing Projects on the Command Line</a>, as appropriate for your environment.</p>
 
 <p>You will also need to set up a new AVD that uses the same Google APIs deployment target. See <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a> for
+href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a> for
 more information.</p>
 
 <p>For reference material, see the <a
@@ -127,7 +127,7 @@
 </pre>
 </li>
 <li>That's all there is to it. Run the application. (Remember, you must have an <a
-href="{@docRoot}guide/developing/tools/avd.html">AVD</a> configured to use the Google APIs
+href="{@docRoot}guide/developing/devices/index.html">AVD</a> configured to use the Google APIs
 target, or be using a development device that includes the Maps library.)</li>
 </ol>
 
@@ -223,7 +223,7 @@
   OverlayItem item = mOverlays.get(index);
   AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);
   dialog.setTitle(item.getTitle());
-  dialog.setMessage(item.getSnippet())
+  dialog.setMessage(item.getSnippet());
   dialog.show();
   return true;
 }
diff --git a/docs/html/sdk/RELEASENOTES.jd b/docs/html/sdk/RELEASENOTES.jd
index a94eba7..bf091e9 100644
--- a/docs/html/sdk/RELEASENOTES.jd
+++ b/docs/html/sdk/RELEASENOTES.jd
@@ -64,7 +64,7 @@
 skins. </li>
     <li>Android SDK and AVD Manager, a graphical UI to let you manage your
 SDK and AVD environments more easily. The tool lets you create and manage 
-your <a href="{@docRoot}guide/developing/tools/avd.html">Android Virtual
+your <a href="{@docRoot}guide/developing/devices/managing-avds.html">Android Virtual
 Devices</a> and download new SDK packages (such as platform versions and 
 add-ons) into your environment.</li>
     <li>Improved support for test packages in New Project Wizard</li>
@@ -222,7 +222,7 @@
 density for each skin, to create any combination of resolution/density (WVGA
 with medium density, for instance).  To do so, use the <code>android</code> tool
 command line to create a new AVD that uses a custom hardware configuration. See
-<a href="{@docRoot}guide/developing/tools/avd.html#createavd">Creating an
+<a href="{@docRoot}guide/developing/devices/managing-avds.html#createavd">Creating an
 AVD</a> for more information.</p>
 
 <h3>Other Notes and Resolved Issues</h3>
@@ -330,7 +330,7 @@
 Android 1.5). The tools are updated to let you deploy your application
 on any platform in the SDK, which helps you ensure forward-compatibility and, 
 if applicable, backward-compatibility.</li>
-    <li>Introduces <a href="{@docRoot}guide/developing/tools/avd.html">Android
+    <li>Introduces <a href="{@docRoot}guide/developing/devices/managing-avds.html">Android
 Virtual Devices</a> &mdash; (AVD) configurations of options that you
 run in the emulator to better model actual devices. Each AVD gets its
 own dedicated storage area, making it much easier to work with multiple emulators 
@@ -407,7 +407,7 @@
 available to use.</p>
 
 <p>For more information about AVDs, see <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>
+href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a>
 
 <h3>Other Notes</h3>
 
@@ -585,8 +585,7 @@
 <p>The USB driver files are located in the
 <code>&lt;SDK&gt;/usb_driver</code> directory. For details and
 installation instructions, see <a
-href="{@docRoot}guide/developing/device.html#setting-up">Setting Up a
-Device for Development</a>.</p>
+href="{@docRoot}guide/developing/device.html#setting-up">Connecting Hardware Devices</a>.</p>
 </p>
 
 <h3>Resolved Issues, Changes</h3>
diff --git a/docs/html/sdk/android-2.3-highlights.jd b/docs/html/sdk/android-2.3-highlights.jd
index 1a603af..d8614d3 100644
--- a/docs/html/sdk/android-2.3-highlights.jd
+++ b/docs/html/sdk/android-2.3-highlights.jd
@@ -40,18 +40,18 @@
 
 <div class="video">
 <object width="278" height="180">
-<param name="movie" value="http://www.youtube.com/v/yAZYSVr2Bhc&hl=en&fs=1&"></param>
+<param name="movie" value="http://www.youtube.com/v/Jx3pdWBlZ34?hl=en&fs=1"></param>
 <param name="allowFullScreen" value="true"></param><param name="allowscriptaccess"
 value="always"></param>
-<embed src="http://www.youtube.com/v/yAZYSVr2Bhc&hl=en&fs=1&" type="application/x-shockwave-flash"
+<embed src="http://www.youtube.com/v/Jx3pdWBlZ34?hl=en&fs=1" type="application/x-shockwave-flash"
 allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
 </object>
 </div>
 
 <p>The Android 2.3 platform introduces many new and exciting features for
-users and developers. This document provides a glimpse at some of the new user features
+users and developers. This document provides a glimpse at some of the new features
 and technologies in Android 2.3. For detailed information about the new developer APIs, see the <a
-href="android-2.3.html#api">Android 2.3 version notes</a>.</p>
+href="android-2.3.html">Android 2.3 version notes</a>.</p>
 
 <ul>
   <li><a href="#UserFeatures">New User Features</a></li>
@@ -251,7 +251,8 @@
 to recognize complex user gestures and motions, such as tilt, spin, thrust, and
 slice.  </p>
 
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Low-latency native
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Open API for native
 audio</strong></p>
 
 <p>The platform provides a software implementation of <a
@@ -405,7 +406,7 @@
 <ul>
 <li>Dalvik VM:
 <ul>
-<li>Concurrent Garbage Collector (target sub-3ms pauses)</li>
+<li>Concurrent garbage collector (target sub-3ms pauses)</li>
 <li>Adds further JIT (code-generation) optimizations</li>
 <li>Improved code verification</li>
 <li>StrictMode debugging, for identifying performance and memory issues</li>
@@ -438,5 +439,5 @@
 </ul>
 
 <p>For more information about the new developer APIs, see the <a
-href="android-2.3.html#api">Android 2.3 version notes</a> and the <a
+href="android-2.3.html">Android 2.3 version notes</a> and the <a
 href="{@docRoot}sdk/api_diff/9/changes.html">API Differences Report</a>.</p>
diff --git a/docs/html/sdk/android-2.3.jd b/docs/html/sdk/android-2.3.jd
index e00674f..734d97b 100644
--- a/docs/html/sdk/android-2.3.jd
+++ b/docs/html/sdk/android-2.3.jd
@@ -225,7 +225,7 @@
 android:name="android.hardware.sensor.gyroscope"
 android:required="true"&gt;</code> to the application manifest.</p>
 
-<p>For API details, see {@link android.hardware.Sensor}</p>
+<p>For API details, see {@link android.hardware.Sensor}.</p>
 
 
 <h3 id="cameras">Multiple cameras support</h3>
@@ -242,9 +242,9 @@
 android.hardware.Camera#getCameraInfo(int,CameraInfo) getCameraInfo()} methods in the {@link
 android.hardware.Camera} class let applications query for the cameras available
 and open the camera that they need.</li>
-<li>New {@link android.media.CamcorderProfile get(int,int) method lets
-applications retrieve a CamcorderProfile for a specific camera. </li>
-<li>New {@link android media.CameraProfile#getJpegEncodingQualityParameter(int, int)
+<li>New {@link android.media.CamcorderProfile#get get()} method lets
+applications retrieve a {@link android.media.CamcorderProfile} for a specific camera. </li>
+<li>New {@link android.media.CameraProfile#getJpegEncodingQualityParameter(int, int)
 getJpegEncodingQualityParameter()} lets applications obtain the still-image
 capture quality level for a specific camera.</li>
 </ul>
@@ -389,19 +389,19 @@
 touch filtering is appropriate to ensure the security of user actions such as
 granting a permission request, making a purchase, or clicking on an
 advertisement. For details, see the <a
-href="{@docRoot}reference/android/view/View.html#security">View class
+href="{@docRoot}reference/android/view/View.html#Security">View class
 documentation</a>.</li>
 <li>New <code>filterTouchesWhenObscured</code> attribute for view elements,
 which declares whether to filter touches when the view's window is obscured by
 another visible window. When set to <code>"true"</code>, the view will not
 receive touches whenever a toast, dialog or other window appears above the
 view's window. Refer to <a
-href="{@docRoot}reference/android/view/View.html#security">View security
+href="{@docRoot}reference/android/view/View.html#Security">View security
 documentation</a> for details.</li>
 </ul>
 
 <p class="note">To look at sample code for touch filtering, see
-<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SecureView.html">SurfaceView.java</a>
+<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SecureView.html">SecureView.java</a>
 in the ApiDemos sample application.</p>
 </li>
 
diff --git a/docs/html/sdk/eclipse-adt.jd b/docs/html/sdk/eclipse-adt.jd
index 0144eb4..d0fa727 100644
--- a/docs/html/sdk/eclipse-adt.jd
+++ b/docs/html/sdk/eclipse-adt.jd
@@ -152,9 +152,9 @@
   "export signed/unsigned application package", ADT does <em>not</em> insert it.
   If you manually set <code>debuggable="true"</code> in the manifest file, then release builds will
   actually create a debug build (it does not remove it if you placed it there).</p></li>
-  <li>Automatic <a href="{@docRoot}guide/developing/tools/proguard.html">Proguard</a> support in
-release builds. For it to work, you need to have a <code>proguard.config</code>
-  property in the <code>default.properties</code> file that points to a proguard config file.</li>
+  <li>Automatic <a href="{@docRoot}guide/developing/tools/proguard.html">ProGuard</a> support in
+  release builds. For it to work, you need to have a <code>proguard.config</code>
+  property in the <code>default.properties</code> file that points to a ProGuard config file.</li>
   <li>Completely rewritten Visual Layout Editor. (This is still a work in progress.) Now includes:
     <ul>
       <li>Full drag and drop from palette to layout for all Layout classes.</li>
@@ -225,7 +225,7 @@
 with no name restriction. They can even be in subfolder such as
 <code>src/java</code>. If you are already working with library projects created
 in ADT 0.9.7, see <a
-href="{@docRoot}guide/developing/eclipse-adt.html#libraryMigrating">Migrating
+href="{@docRoot}guide/developing/projects/index.html#libraryMigrating">Migrating
 library projects to ADT 0.9.8</a> for important information about moving
 to the new ADT environment.</li>
 <li>Adds support for library projects that depend on other library
@@ -263,8 +263,7 @@
 library project from other Android projects and, at build time, the tools
 compile the shared code and resources as part of the dependent applications.
 More information about this feature is available in the <a
-href="{@docRoot}guide/developing/eclipse-adt.html#libraryProject">Developing
-in Eclipse with ADT</a> document. </p>
+href="{@docRoot}guide/developing/projects/index.html#LibraryProjects">Creating and Managing Projects</a> document. </p>
 <p>If you are not developing in Eclipse, <a
 href="tools-notes.html">SDK Tools r6</a> provides the equivalent library
 project support through the Ant build system.</p>
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 4153951..4113463 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -2,20 +2,20 @@
 sdk.redirect=0
 
 sdk.win_installer=installer_r08-windows.exe
-sdk.win_installer_bytes=TODO
-sdk.win_installer_checksum=TODO
+sdk.win_installer_bytes=32746192
+sdk.win_installer_checksum=04ce87b10a8361a1f63cf2238bbc1ee3
 
 sdk.win_download=android-sdk_r08-windows.zip
-sdk.win_bytes=TODO
-sdk.win_checksum=TODO
+sdk.win_bytes=32696391
+sdk.win_checksum=3e0b08ade5bfa9624bce9ddc164a48cb
 
-sdk.mac_download=android-sdk_r08-mac_x86.zip
-sdk.mac_bytes=TODO
-sdk.mac_checksum=TODO
+sdk.mac_download=android-sdk_r08-mac_86.zip
+sdk.mac_bytes=28797617
+sdk.mac_checksum=d2e392c4e4680cbf2dfd6dbf82b662c7
 
-sdk.linux_download=android-sdk_r08-linux_x86.tgz
-sdk.linux_bytes=TODO
-sdk.linux_checksum=TODO
+sdk.linux_download=android-sdk_r08-linux_86.tgz
+sdk.linux_bytes=26817291
+sdk.linux_checksum=3b626645b223d137d27beefbda0c94bc
 
 @jd:body
 
diff --git a/docs/html/sdk/installing.jd b/docs/html/sdk/installing.jd
index 9de247a..e8d97e7 100644
--- a/docs/html/sdk/installing.jd
+++ b/docs/html/sdk/installing.jd
@@ -148,8 +148,9 @@
 
 <p>If you prefer to work in a different IDE, you do not need to
 install Eclipse or ADT, instead, you can directly use the SDK tools to build and
-debug your application. The developer guide has more information about <a
-href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>.</p>
+debug your application. The <a href="{@docRoot}guide/developing/index.html">Overview</a>
+section of the developer guide outlines the major steps that you need to complete 
+when developing in Eclipse or other IDEs.</p>
 
 
 
@@ -547,9 +548,9 @@
   <li>Get an overview of the <a
   href="{@docRoot}guide/developing/tools/index.html">development
   tools</a> that are available to you</li>
-  <li>Read how to develop <a
-  href="{@docRoot}guide/developing/eclipse-adt.html">in Eclipse/ADT</a> or
-  <a href="{@docRoot}guide/developing/other-ide.html">in other IDEs</a>
+  <li>Read the <a
+  href="{@docRoot}guide/developing/index.html">Overview</a> 
+  for how to develop an Android application.
   </li>
   <li>Read <a href="{@docRoot}guide/developing/device.html">Developing on a Device</a> to set up an
 Android-powered device to run and test your application.</li>
diff --git a/docs/html/sdk/ndk/index.jd b/docs/html/sdk/ndk/index.jd
index 19f4d02..8b27f37 100644
--- a/docs/html/sdk/ndk/index.jd
+++ b/docs/html/sdk/ndk/index.jd
@@ -1,16 +1,16 @@
 ndk=true
 
-ndk.win_download=android-ndk-r4b-windows.zip
-ndk.win_bytes=45792835
-ndk.win_checksum=e397145e155a639be53ee4b6db8ad511
+ndk.win_download=android-ndk-r5-windows.zip
+ndk.win_bytes=62217450
+ndk.win_checksum=59cbb02d91d74e9c5c7278d94c989e80
 
-ndk.mac_download=android-ndk-r4b-darwin-x86.zip
-ndk.mac_bytes=50586041
-ndk.mac_checksum=41dbd54335fb828ee408eab17103a1b0
+ndk.mac_download=android-ndk-r5-darwin-x86.tar.bz2
+ndk.mac_bytes=50210863
+ndk.mac_checksum=9dee8e4cb529a5619e9b8d1707478c32
 
-ndk.linux_download=android-ndk-r4b-linux-x86.zip
-ndk.linux_bytes=49464776
-ndk.linux_checksum=2deabcb125c219b34140975b710f00ec
+ndk.linux_download=android-ndk-r5-linux-x86.tar.bz2
+ndk.linux_bytes=44362746
+ndk.linux_checksum=49d5c35ec02bafc074842542c58b7eb3
 
 page.title=Android NDK
 @jd:body
@@ -64,7 +64,7 @@
          onclick="return toggleDiv(this)"><img src="{@docRoot}assets/images/triangle-opened.png"
          class="toggle-img"
          height="9px"
-         width="9px" /> Android NDK, Revision 5</a> <em>(November 2010)</em>
+         width="9px" /> Android NDK, Revision 5</a> <em>(December 2010)</em>
 
     <div class="toggleme">
       <p>This release of the NDK includes many new APIs, most of which are introduced to
diff --git a/docs/html/sdk/ndk/overview.jd b/docs/html/sdk/ndk/overview.jd
index 56b9201..2562a25 100644
--- a/docs/html/sdk/ndk/overview.jd
+++ b/docs/html/sdk/ndk/overview.jd
@@ -275,16 +275,19 @@
     <li>If you are developing in Eclipse with ADT, use the New Project Wizard to create a new
     Android project for each sample, using the "Import from Existing Source" option and importing
     the source from <code>&lt;ndk&gt;/apps/&lt;app_name&gt;/project/</code>. Then, set up an AVD,
-    if necessary, and build/run the application in the emulator. For more information about
-    creating a new Android project in Eclipse, see <a href=
-    "{@docRoot}guide/developing/eclipse-adt.html">Developing in Eclipse</a>.</li>
+    if necessary, and build/run the application in the emulator.</li>
 
     <li>If you are developing with Ant, use the <code>android</code> tool to create the build file
     for each of the sample projects at <code>&lt;ndk&gt;/apps/&lt;app_name&gt;/project/</code>.
     Then set up an AVD, if necessary, build your project in the usual way, and run it in the
-    emulator. For more information, see <a href=
-    "{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>.</li>
+    emulator.</li>    
+    
   </ul>
+  
+  <p>For more information about developing with the Android SDK tools and what
+  you need to do to create, build, and run your applications, see
+  the <a href="{@docRoot}guide/developing/index.html">Overview</a>
+  section for developing on Android.</p>
 
   <h4 id="hello-jni">Exploring the hello-jni Sample</h4>
 
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index 9c7ad89..9e1ff9c 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -98,7 +98,7 @@
     <ul>
       <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r8</a> <span class="new">new!</span></li>
       <li><a href="<?cs var:toroot ?>sdk/win-usb.html">USB Driver for
-      Windows, r3</a>
+      Windows, r4</a> <span class="new">new!</span>
       </li>
     </ul>
   </li>
diff --git a/docs/html/sdk/tools-notes.jd b/docs/html/sdk/tools-notes.jd
index f8d7071..fb8636e 100644
--- a/docs/html/sdk/tools-notes.jd
+++ b/docs/html/sdk/tools-notes.jd
@@ -183,9 +183,8 @@
 library project from other Android projects and, at build time, the tools
 compile the shared code and resources as part of the dependent applications.
 More information about this feature is available in the <a
-href="{@docRoot}guide/developing/other-ide.html#libraryProject">Developing 
-in Other IDEs</a> document.</p>
-<p>If you are developing in Eclipse, <a href="eclipse-adt.html">ADT 0.9.7</a>
+href="{@docRoot}guide/developing/projects/index.html#LibraryProjects">Creating and Managing Projects</a> document.</p>
+<p>If you are developing in Eclipse, <a href="eclipse-adt.html">ADT</a>
 provides the equivalent library project support.</p>
 </dd>
 </dl>
diff --git a/docs/html/sdk/win-usb.jd b/docs/html/sdk/win-usb.jd
index bb0dde6..1f74ffe 100644
--- a/docs/html/sdk/win-usb.jd
+++ b/docs/html/sdk/win-usb.jd
@@ -82,7 +82,21 @@
 
 <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" />
+        <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">
 
@@ -126,10 +140,11 @@
 Android-powered
 devices:</p>
   <ul>
-    <li>T-Mobile G1* / ADP1</li>
-    <li>T-Mobile myTouch 3G* / Google Ion</li>
+    <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>
   </ul>
   <p>* <em>Or similar hardware on other carriers</em></p>
   <p>Any additional devices will require Windows drivers provided by
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index a4ce947..53962e1 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -126,7 +126,7 @@
         for (int ct=0; ct < d.length; ct++) {
             i[ct] = d[ct].getID();
         }
-        subData1D(0, mType.getCount(), i);
+        copy1DRangeFrom(0, mType.getCount(), i);
     }
 
     private void validateBitmap(Bitmap b) {
@@ -139,32 +139,35 @@
 
     public void copyFrom(int[] d) {
         mRS.validate();
-        subData1D(0, mType.getCount(), d);
+        copy1DRangeFrom(0, mType.getCount(), d);
     }
     public void copyFrom(short[] d) {
         mRS.validate();
-        subData1D(0, mType.getCount(), d);
+        copy1DRangeFrom(0, mType.getCount(), d);
     }
     public void copyFrom(byte[] d) {
         mRS.validate();
-        subData1D(0, mType.getCount(), d);
+        copy1DRangeFrom(0, mType.getCount(), d);
     }
     public void copyFrom(float[] d) {
         mRS.validate();
-        subData1D(0, mType.getCount(), d);
+        copy1DRangeFrom(0, mType.getCount(), d);
     }
     public void copyFrom(Bitmap b) {
         validateBitmap(b);
         mRS.nAllocationCopyFromBitmap(getID(), b);
     }
 
-    public void copyTo(Bitmap b) {
-        validateBitmap(b);
-        mRS.nAllocationCopyToBitmap(getID(), b);
-    }
-
-
-    public void subData(int xoff, FieldPacker fp) {
+    /**
+     * @hide
+     *
+     * This is only intended to be used by auto-generate code reflected from the
+     * renderscript script files.
+     *
+     * @param xoff
+     * @param fp
+     */
+    public void setOneElement(int xoff, FieldPacker fp) {
         int eSize = mType.mElement.getSizeBytes();
         final byte[] data = fp.getData();
 
@@ -178,7 +181,17 @@
     }
 
 
-    public void subElementData(int xoff, int component_number, FieldPacker fp) {
+    /**
+     * @hide
+     *
+     * This is only intended to be used by auto-generate code reflected from the
+     * renderscript script files.
+     *
+     * @param xoff
+     * @param component_number
+     * @param fp
+     */
+    public void setOneComponent(int xoff, int component_number, FieldPacker fp) {
         if (component_number >= mType.mElement.mElements.length) {
             throw new RSIllegalArgumentException("Component_number " + component_number + " out of range.");
         }
@@ -214,44 +227,75 @@
         }
     }
 
-    public void subData1D(int off, int count, int[] d) {
+    public void copy1DRangeFrom(int off, int count, int[] d) {
         int dataSize = mType.mElement.getSizeBytes() * count;
         data1DChecks(off, count, d.length * 4, dataSize);
         mRS.nAllocationData1D(getID(), off, 0, count, d, dataSize);
     }
-    public void subData1D(int off, int count, short[] d) {
+    public void copy1DRangeFrom(int off, int count, short[] d) {
         int dataSize = mType.mElement.getSizeBytes() * count;
         data1DChecks(off, count, d.length * 2, dataSize);
         mRS.nAllocationData1D(getID(), off, 0, count, d, dataSize);
     }
-    public void subData1D(int off, int count, byte[] d) {
+    public void copy1DRangeFrom(int off, int count, byte[] d) {
         int dataSize = mType.mElement.getSizeBytes() * count;
         data1DChecks(off, count, d.length, dataSize);
         mRS.nAllocationData1D(getID(), off, 0, count, d, dataSize);
     }
-    public void subData1D(int off, int count, float[] d) {
+    public void copy1DRangeFrom(int off, int count, float[] d) {
         int dataSize = mType.mElement.getSizeBytes() * count;
         data1DChecks(off, count, d.length * 4, dataSize);
         mRS.nAllocationData1D(getID(), off, 0, count, d, dataSize);
     }
 
 
-    public void subData2D(int xoff, int yoff, int w, int h, int[] d) {
+    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, byte[] d) {
+        mRS.validate();
+        mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, d, d.length);
+    }
+
+    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, short[] d) {
+        mRS.validate();
+        mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, d, d.length * 2);
+    }
+
+    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, int[] d) {
         mRS.validate();
         mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, d, d.length * 4);
     }
 
-    public void subData2D(int xoff, int yoff, int w, int h, float[] d) {
+    public void copy2DRangeFrom(int xoff, int yoff, int w, int h, float[] d) {
         mRS.validate();
         mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, d, d.length * 4);
     }
 
-    public void readData(int[] d) {
+    public void copy2DRangeFrom(int xoff, int yoff, Bitmap b) {
+        mRS.validate();
+        mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, b);
+    }
+
+
+    public void copyTo(Bitmap b) {
+        validateBitmap(b);
+        mRS.nAllocationCopyToBitmap(getID(), b);
+    }
+
+    public void copyTo(byte[] d) {
         mRS.validate();
         mRS.nAllocationRead(getID(), d);
     }
 
-    public void readData(float[] d) {
+    public void copyTo(short[] d) {
+        mRS.validate();
+        mRS.nAllocationRead(getID(), d);
+    }
+
+    public void copyTo(int[] d) {
+        mRS.validate();
+        mRS.nAllocationRead(getID(), d);
+    }
+
+    public void copyTo(float[] d) {
         mRS.validate();
         mRS.nAllocationRead(getID(), d);
     }
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 665a893..4c9ad56 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -60,7 +60,8 @@
             _nInit();
             sInitialized = true;
         } catch (UnsatisfiedLinkError e) {
-            Log.d(LOG_TAG, "RenderScript JNI library not found!");
+            Log.e(LOG_TAG, "Error loading RS jni library: " + e);
+            throw new RSRuntimeException("Error loading RS jni library: " + e);
         }
     }
 
@@ -250,6 +251,14 @@
         rsnAllocationElementData1D(mContext, id, xoff, mip, compIdx, d, sizeBytes);
     }
 
+    native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, int w, int h, byte[] d, int sizeBytes);
+    synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, int w, int h, byte[] d, int sizeBytes) {
+        rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes);
+    }
+    native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, int w, int h, short[] d, int sizeBytes);
+    synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, int w, int h, short[] d, int sizeBytes) {
+        rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes);
+    }
     native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, int w, int h, int[] d, int sizeBytes);
     synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, int w, int h, int[] d, int sizeBytes) {
         rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes);
@@ -258,7 +267,19 @@
     synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, int w, int h, float[] d, int sizeBytes) {
         rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes);
     }
+    native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, Bitmap b);
+    synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, Bitmap b) {
+        rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, b);
+    }
 
+    native void rsnAllocationRead(int con, int id, byte[] d);
+    synchronized void nAllocationRead(int id, byte[] d) {
+        rsnAllocationRead(mContext, id, d);
+    }
+    native void rsnAllocationRead(int con, int id, short[] d);
+    synchronized void nAllocationRead(int id, short[] d) {
+        rsnAllocationRead(mContext, id, d);
+    }
     native void rsnAllocationRead(int con, int id, int[] d);
     synchronized void nAllocationRead(int id, int[] d) {
         rsnAllocationRead(mContext, id, d);
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index ef06033..5dd976a 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -410,40 +410,38 @@
 
 void ScriptCState::runCompiler(Context *rsc,
                                ScriptC *s,
-                               long modWhen,
-                               long crc32,
                                const char *resName,
                                const char *cacheDir) {
     {
         s->mBccScript = bccCreateScript();
+
         s->mEnviroment.mIsThreadable = true;
+
         bccRegisterSymbolCallback(s->mBccScript, symbolLookup, s);
-        // bccReadBC() reads in the BitCode, if no cache file corresponding to
-        // the resName is found. Otherwise, bccReadBC() returns a negative value
-        // and the "else" branch will be taken.
+
         if (bccReadBC(s->mBccScript,
                       s->mEnviroment.mScriptText,
                       s->mEnviroment.mScriptTextLength,
-                      modWhen,
-                      crc32,
-                      resName,
-                      cacheDir) >= 0) {
-          //bccLinkBC(s->mBccScript, rs_runtime_lib_bc, rs_runtime_lib_bc_size);
-          bccCompileBC(s->mBccScript);
-        } else {
-          // bccReadBC returns a neagative value: Didn't read any script,
-          // So, use cached binary instead
-          if (bccLoadBinary(s->mBccScript)) {  // LoadBinary fails ==> Recompile
-            bccReadBC(s->mBccScript,
-                      s->mEnviroment.mScriptText,
-                      s->mEnviroment.mScriptTextLength,
-                      modWhen,
-                      crc32,
-                      resName,
-                      cacheDir);
-            bccCompileBC(s->mBccScript);
-          }
+                      /*deprecated*/ 0, /*deprecated*/ 0,
+                      resName, cacheDir) != 0) {
+            LOGE("bcc: FAILS to read bitcode");
+            // Handle Fatal Error
         }
+
+#if 0
+        if (bccLinkBC(s->mBccScript,
+                      rs_runtime_lib_bc,
+                      rs_runtime_lib_bc_size) != 0) {
+            LOGE("bcc: FAILS to link bitcode");
+            // Handle Fatal Error
+        }
+#endif
+
+        if (bccPrepareExecutable(s->mBccScript) != 0) {
+            LOGE("bcc: FAILS to prepare executable");
+            // Handle Fatal Error
+        }
+
         bccGetScriptLabel(s->mBccScript, "root", (BCCvoid**) &s->mProgram.mRoot);
         bccGetScriptLabel(s->mBccScript, "init", (BCCvoid**) &s->mProgram.mInit);
     }
@@ -535,7 +533,8 @@
 
 
     } else {
-        // Deal with an error.
+        LOGE("bcc: FAILS to prepare executable");
+        // Handle Fatal Error
     }
 }
 
@@ -559,7 +558,7 @@
 
 
 RsScript rsi_ScriptCCreate(Context *rsc,
-                           const char *packageName,
+                           const char *packageName /* deprecated */,
                            const char *resName,
                            const char *cacheDir)
 {
@@ -569,34 +568,7 @@
     ss->mScript.clear();
     s->incUserRef();
 
-    // Open the apk and return the ZipArchive:
-    //  int dexZipOpenArchive(const char* fileName, ZipArchive* pArchive)
-    ZipArchive archive;
-    long modWhen;
-    long crc32;
-    if (!dexZipOpenArchive(packageName, &archive)) {  // Success
-      ZipEntry entry = dexZipFindEntry(&archive, resName);
-
-      int method;
-      size_t uncompLen;
-      size_t compLen;
-      off_t offset;
-      if (!dexZipGetEntryInfo(&archive,
-                              entry,
-                              &method,
-                              &uncompLen,
-                              &compLen,
-                              &offset,
-                              &modWhen,
-                              &crc32)) {
-      } else {
-        LOGI("Coudn't get entry info for the bitcode in an apk");
-      }
-    } else {
-      LOGI("Couldn't open the archive and read the bitcode");
-    }
-
-    ss->runCompiler(rsc, s.get(), modWhen, crc32, resName, cacheDir);
+    ss->runCompiler(rsc, s.get(), resName, cacheDir);
     ss->clear(rsc);
     return s.get();
 }
diff --git a/libs/rs/rsScriptC.h b/libs/rs/rsScriptC.h
index ce9358e..cd68546 100644
--- a/libs/rs/rsScriptC.h
+++ b/libs/rs/rsScriptC.h
@@ -83,7 +83,7 @@
     void init(Context *rsc);
 
     void clear(Context *rsc);
-    void runCompiler(Context *rsc, ScriptC *s, long modWhen, long crc32, const char *resName, const char *cacheDir);
+    void runCompiler(Context *rsc, ScriptC *s, const char *resName, const char *cacheDir);
 
     struct SymbolTable_t {
         const char * mName;
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 97fcf27..6a79384 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -275,6 +275,15 @@
     // in call audio)
     private static final int SCO_STATE_ACTIVE_EXTERNAL = 2;
 
+    // true if boot sequence has been completed
+    private boolean mBootCompleted;
+    // listener for SoundPool sample load completion indication
+    private SoundPoolCallback mSoundPoolCallBack;
+    // thread for SoundPool listener
+    private SoundPoolListenerThread mSoundPoolListenerThread;
+    // message looper for SoundPool listener
+    private Looper mSoundPoolLooper = null;
+
     ///////////////////////////////////////////////////////////////////////////
     // Construction
     ///////////////////////////////////////////////////////////////////////////
@@ -308,7 +317,6 @@
         setRingerModeInt(getRingerMode(), false);
 
         AudioSystem.setErrorCallback(mAudioSystemCallback);
-        loadSoundEffects();
 
         mBluetoothHeadsetDevice = null;
         BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
@@ -868,12 +876,42 @@
      * This method must be called at when sound effects are enabled
      */
     public boolean loadSoundEffects() {
+        int status;
+
         synchronized (mSoundEffectsLock) {
+            if (!mBootCompleted) {
+                Log.w(TAG, "loadSoundEffects() called before boot complete");
+                return false;
+            }
+
             if (mSoundPool != null) {
                 return true;
             }
             mSoundPool = new SoundPool(NUM_SOUNDPOOL_CHANNELS, AudioSystem.STREAM_SYSTEM, 0);
             if (mSoundPool == null) {
+                Log.w(TAG, "loadSoundEffects() could not allocate sound pool");
+                return false;
+            }
+
+            try {
+                mSoundPoolCallBack = null;
+                mSoundPoolListenerThread = new SoundPoolListenerThread();
+                mSoundPoolListenerThread.start();
+                // Wait for mSoundPoolCallBack to be set by the other thread
+                mSoundEffectsLock.wait();
+            } catch (InterruptedException e) {
+                Log.w(TAG, "Interrupted while waiting sound pool listener thread.");
+            }
+
+            if (mSoundPoolCallBack == null) {
+                Log.w(TAG, "loadSoundEffects() could not create SoundPool listener or thread");
+                if (mSoundPoolLooper != null) {
+                    mSoundPoolLooper.quit();
+                    mSoundPoolLooper = null;
+                }
+                mSoundPoolListenerThread = null;
+                mSoundPool.release();
+                mSoundPool = null;
                 return false;
             }
             /*
@@ -891,26 +929,49 @@
              * If load succeeds, value in SOUND_EFFECT_FILES_MAP[effect][1] is > 0:
              * this indicates we have a valid sample loaded for this effect.
              */
+
             for (int effect = 0; effect < AudioManager.NUM_SOUND_EFFECTS; effect++) {
                 // Do not load sample if this effect uses the MediaPlayer
                 if (SOUND_EFFECT_FILES_MAP[effect][1] == 0) {
                     continue;
                 }
                 if (poolId[SOUND_EFFECT_FILES_MAP[effect][0]] == -1) {
-                    String filePath = Environment.getRootDirectory() + SOUND_EFFECTS_PATH + SOUND_EFFECT_FILES[SOUND_EFFECT_FILES_MAP[effect][0]];
+                    String filePath = Environment.getRootDirectory()
+                            + SOUND_EFFECTS_PATH
+                            + SOUND_EFFECT_FILES[SOUND_EFFECT_FILES_MAP[effect][0]];
                     int sampleId = mSoundPool.load(filePath, 0);
                     SOUND_EFFECT_FILES_MAP[effect][1] = sampleId;
                     poolId[SOUND_EFFECT_FILES_MAP[effect][0]] = sampleId;
                     if (sampleId <= 0) {
                         Log.w(TAG, "Soundpool could not load file: "+filePath);
                     }
+                    mSoundPoolCallBack.setLastSample(sampleId);
                 } else {
                     SOUND_EFFECT_FILES_MAP[effect][1] = poolId[SOUND_EFFECT_FILES_MAP[effect][0]];
                 }
             }
+            // wait for all samples to be loaded
+            try {
+                mSoundEffectsLock.wait();
+                status = mSoundPoolCallBack.status();
+            } catch (java.lang.InterruptedException e) {
+                status = -1;
+            }
+            if (mSoundPoolLooper != null) {
+                mSoundPoolLooper.quit();
+                mSoundPoolLooper = null;
+            }
+            mSoundPoolListenerThread = null;
+            if (status != 0) {
+                Log.w(TAG,
+                        "loadSoundEffects(), Error "
+                                + mSoundPoolCallBack.status()
+                                + " while loading samples");
+                mSoundPool.release();
+                mSoundPool = null;
+            }
         }
-
-        return true;
+        return (status == 0);
     }
 
     /**
@@ -923,6 +984,9 @@
             if (mSoundPool == null) {
                 return;
             }
+
+            mAudioHandler.removeMessages(MSG_PLAY_SOUND_EFFECT);
+
             int[] poolId = new int[SOUND_EFFECT_FILES.length];
             for (int fileIdx = 0; fileIdx < SOUND_EFFECT_FILES.length; fileIdx++) {
                 poolId[fileIdx] = 0;
@@ -938,10 +1002,60 @@
                     poolId[SOUND_EFFECT_FILES_MAP[effect][0]] = -1;
                 }
             }
+            mSoundPool.release();
             mSoundPool = null;
         }
     }
 
+    class SoundPoolListenerThread extends Thread {
+        public SoundPoolListenerThread() {
+            super("SoundPoolListenerThread");
+        }
+
+        @Override
+        public void run() {
+
+            Looper.prepare();
+            mSoundPoolLooper = Looper.myLooper();
+
+            synchronized (mSoundEffectsLock) {
+                if (mSoundPool != null) {
+                    mSoundPoolCallBack = new SoundPoolCallback();
+                    mSoundPool.setOnLoadCompleteListener(mSoundPoolCallBack);
+                }
+                mSoundEffectsLock.notify();
+            }
+            Looper.loop();
+        }
+    }
+
+    private final class SoundPoolCallback implements
+            android.media.SoundPool.OnLoadCompleteListener {
+
+        int mStatus;
+        int mLastSample;
+
+        public int status() {
+            return mStatus;
+        }
+
+        public void setLastSample(int sample) {
+            mLastSample = sample;
+        }
+
+        public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
+            synchronized (mSoundEffectsLock) {
+                if (status != 0) {
+                    mStatus = status;
+                }
+                if (sampleId == mLastSample) {
+                    Log.e(TAG, "onLoadComplete last sample loaded");
+                    mSoundEffectsLock.notify();
+                }
+            }
+        }
+    }
+
     /** @see AudioManager#reloadAudioSettings() */
     public void reloadAudioSettings() {
         // restore ringer mode, ringer mode affected streams, mute affected streams and vibrate settings
@@ -2130,6 +2244,8 @@
                     mContext.sendStickyBroadcast(newIntent);
                 }
             } else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
+                mBootCompleted = true;
+                loadSoundEffects();
                 Intent newIntent = new Intent(AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED);
                 newIntent.putExtra(AudioManager.EXTRA_SCO_AUDIO_STATE,
                         AudioManager.SCO_AUDIO_STATE_DISCONNECTED);
diff --git a/media/java/android/media/SoundPool.java b/media/java/android/media/SoundPool.java
index 18ce5c1..5e9c018 100644
--- a/media/java/android/media/SoundPool.java
+++ b/media/java/android/media/SoundPool.java
@@ -141,17 +141,6 @@
             throw new RuntimeException("Native setup failed");
         }
         mLock = new Object();
-
-        // setup message handler
-        Looper looper;
-        if ((looper = Looper.myLooper()) != null) {
-            mEventHandler = new EventHandler(this, looper);
-        } else if ((looper = Looper.getMainLooper()) != null) {
-            mEventHandler = new EventHandler(this, looper);
-        } else {
-            mEventHandler = null;
-        }
-
     }
 
     /**
@@ -427,6 +416,19 @@
     public void setOnLoadCompleteListener(OnLoadCompleteListener listener)
     {
         synchronized(mLock) {
+            if (listener != null) {
+                // setup message handler
+                Looper looper;
+                if ((looper = Looper.myLooper()) != null) {
+                    mEventHandler = new EventHandler(this, looper);
+                } else if ((looper = Looper.getMainLooper()) != null) {
+                    mEventHandler = new EventHandler(this, looper);
+                } else {
+                    mEventHandler = null;
+                }
+            } else {
+                mEventHandler = null;
+            }
             mOnLoadCompleteListener = listener;
         }
     }
diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp
index fef880b..1e2d6ce 100644
--- a/media/jni/soundpool/SoundPool.cpp
+++ b/media/jni/soundpool/SoundPool.cpp
@@ -81,10 +81,10 @@
     quit();
 
     Mutex::Autolock lock(&mLock);
+
     mChannels.clear();
     if (mChannelPool)
         delete [] mChannelPool;
-
     // clean up samples
     LOGV("clear samples");
     mSamples.clear();
@@ -96,8 +96,19 @@
 void SoundPool::addToRestartList(SoundChannel* channel)
 {
     Mutex::Autolock lock(&mRestartLock);
-    mRestart.push_back(channel);
-    mCondition.signal();
+    if (!mQuit) {
+        mRestart.push_back(channel);
+        mCondition.signal();
+    }
+}
+
+void SoundPool::addToStopList(SoundChannel* channel)
+{
+    Mutex::Autolock lock(&mRestartLock);
+    if (!mQuit) {
+        mStop.push_back(channel);
+        mCondition.signal();
+    }
 }
 
 int SoundPool::beginThread(void* arg)
@@ -114,17 +125,38 @@
         LOGV("awake");
         if (mQuit) break;
 
+        while (!mStop.empty()) {
+            SoundChannel* channel;
+            LOGV("Getting channel from stop list");
+            List<SoundChannel* >::iterator iter = mStop.begin();
+            channel = *iter;
+            mStop.erase(iter);
+            mRestartLock.unlock();
+            if (channel != 0) {
+                Mutex::Autolock lock(&mLock);
+                channel->stop();
+            }
+            mRestartLock.lock();
+            if (mQuit) break;
+        }
+
         while (!mRestart.empty()) {
             SoundChannel* channel;
             LOGV("Getting channel from list");
             List<SoundChannel*>::iterator iter = mRestart.begin();
             channel = *iter;
             mRestart.erase(iter);
-            if (channel) channel->nextEvent();
+            mRestartLock.unlock();
+            if (channel != 0) {
+                Mutex::Autolock lock(&mLock);
+                channel->nextEvent();
+            }
+            mRestartLock.lock();
             if (mQuit) break;
         }
     }
 
+    mStop.clear();
     mRestart.clear();
     mCondition.signal();
     mRestartLock.unlock();
@@ -208,43 +240,43 @@
 int SoundPool::play(int sampleID, float leftVolume, float rightVolume,
         int priority, int loop, float rate)
 {
-    LOGV("sampleID=%d, leftVolume=%f, rightVolume=%f, priority=%d, loop=%d, rate=%f",
+    LOGV("play sampleID=%d, leftVolume=%f, rightVolume=%f, priority=%d, loop=%d, rate=%f",
             sampleID, leftVolume, rightVolume, priority, loop, rate);
     sp<Sample> sample;
     SoundChannel* channel;
     int channelID;
 
-    // scope for lock
-    {
-        Mutex::Autolock lock(&mLock);
+    Mutex::Autolock lock(&mLock);
 
-        // is sample ready?
-        sample = findSample(sampleID);
-        if ((sample == 0) || (sample->state() != Sample::READY)) {
-            LOGW("  sample %d not READY", sampleID);
-            return 0;
-        }
-
-        dump();
-
-        // allocate a channel
-        channel = allocateChannel(priority);
-
-        // no channel allocated - return 0
-        if (!channel) {
-            LOGV("No channel allocated");
-            return 0;
-        }
-
-        channelID = ++mNextChannelID;
+    if (mQuit) {
+        return 0;
+    }
+    // is sample ready?
+    sample = findSample(sampleID);
+    if ((sample == 0) || (sample->state() != Sample::READY)) {
+        LOGW("  sample %d not READY", sampleID);
+        return 0;
     }
 
-    LOGV("channel state = %d", channel->state());
+    dump();
+
+    // allocate a channel
+    channel = allocateChannel_l(priority);
+
+    // no channel allocated - return 0
+    if (!channel) {
+        LOGV("No channel allocated");
+        return 0;
+    }
+
+    channelID = ++mNextChannelID;
+
+    LOGV("play channel %p state = %d", channel, channel->state());
     channel->play(sample, channelID, leftVolume, rightVolume, priority, loop, rate);
     return channelID;
 }
 
-SoundChannel* SoundPool::allocateChannel(int priority)
+SoundChannel* SoundPool::allocateChannel_l(int priority)
 {
     List<SoundChannel*>::iterator iter;
     SoundChannel* channel = NULL;
@@ -273,7 +305,7 @@
 }
 
 // move a channel from its current position to the front of the list
-void SoundPool::moveToFront(SoundChannel* channel)
+void SoundPool::moveToFront_l(SoundChannel* channel)
 {
     for (List<SoundChannel*>::iterator iter = mChannels.begin(); iter != mChannels.end(); ++iter) {
         if (*iter == channel) {
@@ -378,10 +410,9 @@
 }
 
 // call with lock held
-void SoundPool::done(SoundChannel* channel)
+void SoundPool::done_l(SoundChannel* channel)
 {
-    LOGV("done(%d)", channel->channelID());
-
+    LOGV("done_l(%d)", channel->channelID());
     // if "stolen", play next event
     if (channel->nextChannelID() != 0) {
         LOGV("add to restart list");
@@ -391,7 +422,7 @@
     // return to idle state
     else {
         LOGV("move to front");
-        moveToFront(channel);
+        moveToFront_l(channel);
     }
 }
 
@@ -511,81 +542,88 @@
     mSoundPool = soundPool;
 }
 
+// call with sound pool lock held
 void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftVolume,
         float rightVolume, int priority, int loop, float rate)
 {
     AudioTrack* oldTrack;
+    AudioTrack* newTrack;
+    status_t status;
 
-    LOGV("play %p: sampleID=%d, channelID=%d, leftVolume=%f, rightVolume=%f, priority=%d, loop=%d, rate=%f",
-            this, sample->sampleID(), nextChannelID, leftVolume, rightVolume, priority, loop, rate);
+    { // scope for the lock
+        Mutex::Autolock lock(&mLock);
 
-    // if not idle, this voice is being stolen
-    if (mState != IDLE) {
-        LOGV("channel %d stolen - event queued for channel %d", channelID(), nextChannelID);
-        mNextEvent.set(sample, nextChannelID, leftVolume, rightVolume, priority, loop, rate);
-        stop();
-        return;
-    }
+        LOGV("SoundChannel::play %p: sampleID=%d, channelID=%d, leftVolume=%f, rightVolume=%f,"
+                " priority=%d, loop=%d, rate=%f",
+                this, sample->sampleID(), nextChannelID, leftVolume, rightVolume,
+                priority, loop, rate);
 
-    // initialize track
-    int afFrameCount;
-    int afSampleRate;
-    int streamType = mSoundPool->streamType();
-    if (AudioSystem::getOutputFrameCount(&afFrameCount, streamType) != NO_ERROR) {
-        afFrameCount = kDefaultFrameCount;
-    }
-    if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) {
-        afSampleRate = kDefaultSampleRate;
-    }
-    int numChannels = sample->numChannels();
-    uint32_t sampleRate = uint32_t(float(sample->sampleRate()) * rate + 0.5);
-    uint32_t totalFrames = (kDefaultBufferCount * afFrameCount * sampleRate) / afSampleRate;
-    uint32_t bufferFrames = (totalFrames + (kDefaultBufferCount - 1)) / kDefaultBufferCount;
-    uint32_t frameCount = 0;
+        // if not idle, this voice is being stolen
+        if (mState != IDLE) {
+            LOGV("channel %d stolen - event queued for channel %d", channelID(), nextChannelID);
+            mNextEvent.set(sample, nextChannelID, leftVolume, rightVolume, priority, loop, rate);
+            stop_l();
+            return;
+        }
 
-    if (loop) {
-        frameCount = sample->size()/numChannels/((sample->format() == AudioSystem::PCM_16_BIT) ? sizeof(int16_t) : sizeof(uint8_t));
-    }
+        // initialize track
+        int afFrameCount;
+        int afSampleRate;
+        int streamType = mSoundPool->streamType();
+        if (AudioSystem::getOutputFrameCount(&afFrameCount, streamType) != NO_ERROR) {
+            afFrameCount = kDefaultFrameCount;
+        }
+        if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) {
+            afSampleRate = kDefaultSampleRate;
+        }
+        int numChannels = sample->numChannels();
+        uint32_t sampleRate = uint32_t(float(sample->sampleRate()) * rate + 0.5);
+        uint32_t totalFrames = (kDefaultBufferCount * afFrameCount * sampleRate) / afSampleRate;
+        uint32_t bufferFrames = (totalFrames + (kDefaultBufferCount - 1)) / kDefaultBufferCount;
+        uint32_t frameCount = 0;
+
+        if (loop) {
+            frameCount = sample->size()/numChannels/
+                ((sample->format() == AudioSystem::PCM_16_BIT) ? sizeof(int16_t) : sizeof(uint8_t));
+        }
 
 #ifndef USE_SHARED_MEM_BUFFER
-    // Ensure minimum audio buffer size in case of short looped sample
-    if(frameCount < totalFrames) {
-        frameCount = totalFrames;
-    }
+        // Ensure minimum audio buffer size in case of short looped sample
+        if(frameCount < totalFrames) {
+            frameCount = totalFrames;
+        }
 #endif
 
-    AudioTrack* newTrack;
+        // mToggle toggles each time a track is started on a given channel.
+        // The toggle is concatenated with the SoundChannel address and passed to AudioTrack
+        // as callback user data. This enables the detection of callbacks received from the old
+        // audio track while the new one is being started and avoids processing them with
+        // wrong audio audio buffer size  (mAudioBufferSize)
+        unsigned long toggle = mToggle ^ 1;
+        void *userData = (void *)((unsigned long)this | toggle);
+        uint32_t channels = (numChannels == 2) ?
+                AudioSystem::CHANNEL_OUT_STEREO : AudioSystem::CHANNEL_OUT_MONO;
 
-    // mToggle toggles each time a track is started on a given channel.
-    // The toggle is concatenated with the SoundChannel address and passed to AudioTrack
-    // as callback user data. This enables the detection of callbacks received from the old
-    // audio track while the new one is being started and avoids processing them with 
-    // wrong audio audio buffer size  (mAudioBufferSize)
-    unsigned long toggle = mToggle ^ 1;
-    void *userData = (void *)((unsigned long)this | toggle);
-    uint32_t channels = (numChannels == 2) ? AudioSystem::CHANNEL_OUT_STEREO : AudioSystem::CHANNEL_OUT_MONO;
-
+        // do not create a new audio track if current track is compatible with sample parameters
 #ifdef USE_SHARED_MEM_BUFFER
-    newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
-            channels, sample->getIMemory(), 0, callback, userData);
+        newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
+                channels, sample->getIMemory(), 0, callback, userData);
 #else
-    newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
-            channels, frameCount, 0, callback, userData, bufferFrames);
+        newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
+                channels, frameCount, 0, callback, userData, bufferFrames);
 #endif
-    if (newTrack->initCheck() != NO_ERROR) {
-        LOGE("Error creating AudioTrack");
-        delete newTrack;
-        return;
-    }
-    LOGV("setVolume %p", newTrack);
-    newTrack->setVolume(leftVolume, rightVolume);
-    newTrack->setLoop(0, frameCount, loop);
+        oldTrack = mAudioTrack;
+        status = newTrack->initCheck();
+        if (status != NO_ERROR) {
+            LOGE("Error creating AudioTrack");
+            goto exit;
+        }
+        LOGV("setVolume %p", newTrack);
+        newTrack->setVolume(leftVolume, rightVolume);
+        newTrack->setLoop(0, frameCount, loop);
 
-    {
-        Mutex::Autolock lock(&mLock);
         // From now on, AudioTrack callbacks recevieved with previous toggle value will be ignored.
         mToggle = toggle;
-        oldTrack = mAudioTrack;
         mAudioTrack = newTrack;
         mPos = 0;
         mSample = sample;
@@ -602,8 +640,13 @@
         mAudioBufferSize = newTrack->frameCount()*newTrack->frameSize();
     }
 
+exit:
     LOGV("delete oldTrack %p", oldTrack);
     delete oldTrack;
+    if (status != NO_ERROR) {
+        delete newTrack;
+        mAudioTrack = NULL;
+    }
 }
 
 void SoundChannel::nextEvent()
@@ -639,29 +682,44 @@
 
 void SoundChannel::callback(int event, void* user, void *info)
 {
-    unsigned long toggle = (unsigned long)user & 1;
     SoundChannel* channel = static_cast<SoundChannel*>((void *)((unsigned long)user & ~1));
     
-    if (channel->mToggle != toggle) {
-        LOGV("callback with wrong toggle");
-        return;
-    }
-    channel->process(event, info);
+    channel->process(event, info, (unsigned long)user & 1);
 }
 
-void SoundChannel::process(int event, void *info)
+void SoundChannel::process(int event, void *info, unsigned long toggle)
 {
     //LOGV("process(%d)", mChannelID);
+
+    Mutex::Autolock lock(&mLock);
+
+    AudioTrack::Buffer* b = NULL;
+    if (event == AudioTrack::EVENT_MORE_DATA) {
+       b = static_cast<AudioTrack::Buffer *>(info);
+    }
+
+    if (mToggle != toggle) {
+        LOGV("process wrong toggle %p channel %d", this, mChannelID);
+        if (b != NULL) {
+            b->size = 0;
+        }
+        return;
+    }
+
     sp<Sample> sample = mSample;
 
 //    LOGV("SoundChannel::process event %d", event);
 
     if (event == AudioTrack::EVENT_MORE_DATA) {
-       AudioTrack::Buffer* b = static_cast<AudioTrack::Buffer *>(info);
 
         // check for stop state
         if (b->size == 0) return;
 
+        if (mState == IDLE) {
+            b->size = 0;
+            return;
+        }
+
         if (sample != 0) {
             // fill buffer
             uint8_t* q = (uint8_t*) b->i8;
@@ -674,14 +732,14 @@
                     count = b->size;
                 }
                 memcpy(q, p, count);
-                LOGV("fill: q=%p, p=%p, mPos=%u, b->size=%u, count=%d", q, p, mPos, b->size, count);
+//              LOGV("fill: q=%p, p=%p, mPos=%u, b->size=%u, count=%d", q, p, mPos, b->size, count);
             } else if (mPos < mAudioBufferSize) {
                 count = mAudioBufferSize - mPos;
                 if (count > b->size) {
                     count = b->size;
                 }
                 memset(q, 0, count);
-                LOGV("fill extra: q=%p, mPos=%u, b->size=%u, count=%d", q, mPos, b->size, count);
+//              LOGV("fill extra: q=%p, mPos=%u, b->size=%u, count=%d", q, mPos, b->size, count);
             }
 
             mPos += count;
@@ -689,16 +747,16 @@
             //LOGV("buffer=%p, [0]=%d", b->i16, b->i16[0]);
         }
     } else if (event == AudioTrack::EVENT_UNDERRUN) {
-        LOGV("stopping track");
-        stop();
+        LOGV("process %p channel %d EVENT_UNDERRUN", this, mChannelID);
+        mSoundPool->addToStopList(this);
     } else if (event == AudioTrack::EVENT_LOOP_END) {
-        LOGV("End loop: %d", *(int *)info);
+        LOGV("End loop %p channel %d count %d", this, mChannelID, *(int *)info);
     }
 }
 
 
 // call with lock held
-void SoundChannel::stop_l()
+bool SoundChannel::doStop_l()
 {
     if (mState != IDLE) {
         setVolume_l(0, 0);
@@ -707,16 +765,31 @@
         mSample.clear();
         mState = IDLE;
         mPriority = IDLE_PRIORITY;
+        return true;
+    }
+    return false;
+}
+
+// call with lock held and sound pool lock held
+void SoundChannel::stop_l()
+{
+    if (doStop_l()) {
+        mSoundPool->done_l(this);
     }
 }
 
+// call with sound pool lock held
 void SoundChannel::stop()
 {
+    bool stopped;
     {
         Mutex::Autolock lock(&mLock);
-        stop_l();
+        stopped = doStop_l();
     }
-    mSoundPool->done(this);
+
+    if (stopped) {
+        mSoundPool->done_l(this);
+    }
 }
 
 //FIXME: Pause is a little broken right now
@@ -791,21 +864,24 @@
 {
     Mutex::Autolock lock(&mLock);
     if (mAudioTrack != 0 && mSample.get() != 0) {
-        mAudioTrack->setLoop(0, mSample->size()/mNumChannels/((mSample->format() == AudioSystem::PCM_16_BIT) ? sizeof(int16_t) : sizeof(uint8_t)), loop);
+        uint32_t loopEnd = mSample->size()/mNumChannels/
+            ((mSample->format() == AudioSystem::PCM_16_BIT) ? sizeof(int16_t) : sizeof(uint8_t));
+        mAudioTrack->setLoop(0, loopEnd, loop);
         mLoop = loop;
     }
 }
 
 SoundChannel::~SoundChannel()
 {
-    LOGV("SoundChannel destructor");
-    if (mAudioTrack) {
-        LOGV("stop track");
-        mAudioTrack->stop();
-        delete mAudioTrack;
+    LOGV("SoundChannel destructor %p", this);
+    {
+        Mutex::Autolock lock(&mLock);
+        clearNextEvent();
+        doStop_l();
     }
-    clearNextEvent();
-    mSample.clear();
+    // do not call AudioTrack destructor with mLock held as it will wait for the AudioTrack
+    // callback thread to exit which may need to execute process() and acquire the mLock.
+    delete mAudioTrack;
 }
 
 void SoundChannel::dump()
@@ -817,7 +893,7 @@
 void SoundEvent::set(const sp<Sample>& sample, int channelID, float leftVolume,
             float rightVolume, int priority, int loop, float rate)
 {
-    mSample =sample;
+    mSample = sample;
     mChannelID = channelID;
     mLeftVolume = leftVolume;
     mRightVolume = rightVolume;
diff --git a/media/jni/soundpool/SoundPool.h b/media/jni/soundpool/SoundPool.h
index 1b0fd38..6010aac 100644
--- a/media/jni/soundpool/SoundPool.h
+++ b/media/jni/soundpool/SoundPool.h
@@ -142,7 +142,8 @@
 
 private:
     static void callback(int event, void* user, void *info);
-    void process(int event, void *info);
+    void process(int event, void *info, unsigned long toggle);
+    bool doStop_l();
 
     SoundPool*          mSoundPool;
     AudioTrack*         mAudioTrack;
@@ -184,7 +185,7 @@
     void sampleLoaded(int sampleID);
 
     // called from AudioTrack thread
-    void done(SoundChannel* channel);
+    void done_l(SoundChannel* channel);
 
     // callback function
     void setCallback(SoundPoolCallback* callback, void* user);
@@ -197,13 +198,14 @@
     sp<Sample> findSample(int sampleID) { return mSamples.valueFor(sampleID); }
     SoundChannel* findChannel (int channelID);
     SoundChannel* findNextChannel (int channelID);
-    SoundChannel* allocateChannel(int priority);
-    void moveToFront(SoundChannel* channel);
+    SoundChannel* allocateChannel_l(int priority);
+    void moveToFront_l(SoundChannel* channel);
     void notify(SoundPoolEvent event);
     void dump();
 
     // restart thread
     void addToRestartList(SoundChannel* channel);
+    void addToStopList(SoundChannel* channel);
     static int beginThread(void* arg);
     int run();
     void quit();
@@ -215,6 +217,7 @@
     SoundChannel*           mChannelPool;
     List<SoundChannel*>     mChannels;
     List<SoundChannel*>     mRestart;
+    List<SoundChannel*>     mStop;
     DefaultKeyedVector< int, sp<Sample> >   mSamples;
     int                     mMaxChannels;
     int                     mStreamType;
diff --git a/media/jni/soundpool/SoundPoolThread.h b/media/jni/soundpool/SoundPoolThread.h
index bbd35e0..d388388 100644
--- a/media/jni/soundpool/SoundPoolThread.h
+++ b/media/jni/soundpool/SoundPoolThread.h
@@ -31,10 +31,8 @@
     SoundPoolMsg() : mMessageType(INVALID), mData(0) {}
     SoundPoolMsg(MessageType MessageType, int data) :
         mMessageType(MessageType), mData(data) {}
-    uint8_t         mMessageType;
-    uint8_t         mData;
-    uint8_t         mData2;
-    uint8_t         mData3;
+    uint16_t         mMessageType;
+    uint16_t         mData;
 };
 
 /*
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index b350daf..914e409 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -52,6 +52,7 @@
 #include "include/LiveSession.h"
 
 #define USE_SURFACE_ALLOC 1
+#define FRAME_DROP_FREQ 7
 
 namespace android {
 
@@ -1255,7 +1256,7 @@
 
     if (mFlags & FIRST_FRAME) {
         mFlags &= ~FIRST_FRAME;
-
+        mSinceLastDropped = 0;
         mTimeSourceDeltaUs = ts->getRealTimeUs() - timeUs;
     }
 
@@ -1283,12 +1284,16 @@
     if (latenessUs > 40000) {
         // We're more than 40ms late.
         LOGV("we're late by %lld us (%.2f secs)", latenessUs, latenessUs / 1E6);
+        if ( mSinceLastDropped > FRAME_DROP_FREQ)
+        {
+            LOGV("we're late by %lld us (%.2f secs) dropping one after %d frames", latenessUs, latenessUs / 1E6, mSinceLastDropped);
+            mSinceLastDropped = 0;
+            mVideoBuffer->release();
+            mVideoBuffer = NULL;
 
-        mVideoBuffer->release();
-        mVideoBuffer = NULL;
-
-        postVideoEvent_l();
-        return;
+            postVideoEvent_l();
+            return;
+        }
     }
 
     if (latenessUs < -10000) {
@@ -1305,6 +1310,7 @@
     }
 
     if (mVideoRenderer != NULL) {
+        mSinceLastDropped++;
         mVideoRenderer->render(mVideoBuffer);
     }
 
diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h
index 0c67432..17b83c1 100644
--- a/media/libstagefright/include/AwesomePlayer.h
+++ b/media/libstagefright/include/AwesomePlayer.h
@@ -151,6 +151,7 @@
 
     uint32_t mFlags;
     uint32_t mExtractorFlags;
+    uint32_t mSinceLastDropped;
 
     int64_t mTimeSourceDeltaUs;
     int64_t mVideoTimeUs;
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
index 9dfc9c3..a81484c 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
@@ -186,7 +186,7 @@
                 b.setCancelable(true);
                 b.setTitle(R.string.battery_low_title);
                 b.setView(v);
-                b.setIcon(android.R.drawable.ic_dialog_alert);
+                b.setIconAttribute(android.R.attr.alertDialogIcon);
                 b.setPositiveButton(android.R.string.ok, null);
 
             final Intent intent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
@@ -249,7 +249,7 @@
         AlertDialog.Builder b = new AlertDialog.Builder(mContext);
             b.setCancelable(true);
             b.setMessage(R.string.invalid_charger);
-            b.setIcon(android.R.drawable.ic_dialog_alert);
+            b.setIconAttribute(android.R.attr.alertDialogIcon);
             b.setPositiveButton(android.R.string.ok, null);
 
         AlertDialog d = b.create();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java
index 14f2587..b9206ea 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java
@@ -147,23 +147,23 @@
                 final ClipData clip = mClipping;
                 if (clip != null) {
                     final Bitmap icon = clip.getIcon();
-                    DragThumbnailBuilder thumb;
+                    DragShadowBuilder shadow;
                     if (icon != null) {
-                        thumb = new DragThumbnailBuilder(v) {
-                            public void onProvideThumbnailMetrics(Point thumbnailSize, Point thumbnailTouchPoint) {
-                                thumbnailSize.set(icon.getWidth(), icon.getHeight());
-                                thumbnailTouchPoint.set(thumbnailSize.x / 2, thumbnailSize.y / 2);
+                        shadow = new DragShadowBuilder(v) {
+                            public void onProvideShadowMetrics(Point shadowSize, Point shadowTouchPoint) {
+                                shadowSize.set(icon.getWidth(), icon.getHeight());
+                                shadowTouchPoint.set(shadowSize.x / 2, shadowSize.y / 2);
                             }
-                            public void onDrawThumbnail(Canvas canvas) {
+                            public void onDrawShadow(Canvas canvas) {
                                 canvas.drawBitmap(icon, 0, 0, new Paint());
                             }
                         };
                     } else {
                         // uhhh, what now?
-                        thumb = new DragThumbnailBuilder(mWindow.findViewById(R.id.preview));
+                        shadow = new DragShadowBuilder(mWindow.findViewById(R.id.preview));
                     }
 
-                    v.startDrag(clip, thumb, false, null);
+                    v.startDrag(clip, shadow, false, null);
 
                     // TODO: only discard the clipping if it was accepted
                     stash(null);
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 3b2aeaf..2fcd04e 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -21,7 +21,6 @@
 import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
 import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
 import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
-import static android.view.WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY;
 import static android.view.WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
 
 import com.android.internal.view.BaseSurfaceHolder;
@@ -57,7 +56,6 @@
 import android.util.TypedValue;
 import android.view.ActionMode;
 import android.view.Gravity;
-import android.view.HardwareRenderer;
 import android.view.InputQueue;
 import android.view.KeyCharacterMap;
 import android.view.KeyEvent;
@@ -430,6 +428,21 @@
             return;
         }
 
+        // Don't open an options panel for honeycomb apps on xlarge devices.
+        // (The app should be using an action bar for menu items.)
+        if (st.featureId == FEATURE_OPTIONS_PANEL) {
+            Context context = getContext();
+            Configuration config = context.getResources().getConfiguration();
+            boolean isXLarge = (config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) ==
+                    Configuration.SCREENLAYOUT_SIZE_XLARGE;
+            boolean isHoneycombApp = context.getApplicationInfo().targetSdkVersion >=
+                    android.os.Build.VERSION_CODES.HONEYCOMB;
+
+            if (isXLarge && isHoneycombApp) {
+                return;
+            }
+        }
+
         Callback cb = getCallback();
         if ((cb != null) && (!cb.onMenuOpened(st.featureId, st.menu))) {
             // Callback doesn't want the menu to open, reset any state
@@ -3007,10 +3020,11 @@
 
         @Override
         public void run() {
-            show();
-            Callback cb = getCallback();
-            if (cb != null) {
-                cb.onMenuOpened(FEATURE_ACTION_BAR, mSubMenu);
+            if (tryShow()) {
+                Callback cb = getCallback();
+                if (cb != null) {
+                    cb.onMenuOpened(FEATURE_ACTION_BAR, mSubMenu);
+                }
             }
         }
     }
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 5ad0edb..3e8318e 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -34,6 +34,7 @@
 import android.database.ContentObserver;
 import android.graphics.PixelFormat;
 import android.graphics.Rect;
+import android.os.Build;
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.LocalPowerManager;
@@ -1017,23 +1018,16 @@
         
         try {
             Context context = mContext;
-            boolean setTheme = false;
             //Log.i(TAG, "addStartingWindow " + packageName + ": nonLocalizedLabel="
             //        + nonLocalizedLabel + " theme=" + Integer.toHexString(theme));
-            if (theme != 0 || labelRes != 0) {
+            if (theme != context.getThemeResId() || labelRes != 0) {
                 try {
                     context = context.createPackageContext(packageName, 0);
-                    if (theme != 0) {
-                        context.setTheme(theme);
-                        setTheme = true;
-                    }
+                    context.setTheme(theme);
                 } catch (PackageManager.NameNotFoundException e) {
                     // Ignore
                 }
             }
-            if (!setTheme) {
-                context.setTheme(com.android.internal.R.style.Theme);
-            }
             
             Window win = PolicyManager.makeNewWindow(context);
             if (win.getWindowStyle().getBoolean(
diff --git a/services/java/com/android/server/DeviceStorageMonitorService.java b/services/java/com/android/server/DeviceStorageMonitorService.java
index 0b1a4a3..0fba7c3 100644
--- a/services/java/com/android/server/DeviceStorageMonitorService.java
+++ b/services/java/com/android/server/DeviceStorageMonitorService.java
@@ -16,7 +16,6 @@
 
 package com.android.server;
 
-import com.android.server.am.ActivityManagerService;
 import android.app.Notification;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
@@ -38,7 +37,6 @@
 import android.util.Config;
 import android.util.EventLog;
 import android.util.Slog;
-import android.provider.Settings;
 
 /**
  * This class implements a service to monitor the amount of disk
@@ -66,6 +64,7 @@
     private static final int MONITOR_INTERVAL = 1; //in minutes
     private static final int LOW_MEMORY_NOTIFICATION_ID = 1;
     private static final int DEFAULT_THRESHOLD_PERCENTAGE = 10;
+    private static final int DEFAULT_THRESHOLD_MAX_BYTES = 500*1024*1024; // 500MB
     private static final int DEFAULT_FREE_STORAGE_LOG_INTERVAL_IN_MINUTES = 12*60; //in minutes
     private static final long DEFAULT_DISK_FREE_CHANGE_REPORTING_THRESHOLD = 2 * 1024 * 1024; // 2MB
     private static final long DEFAULT_CHECK_INTERVAL = MONITOR_INTERVAL*60*1000;
@@ -271,13 +270,18 @@
      * any way
      */
     private long getMemThreshold() {
-        int value = Settings.Secure.getInt(
+        long value = Settings.Secure.getInt(
                               mContentResolver,
                               Settings.Secure.SYS_STORAGE_THRESHOLD_PERCENTAGE,
                               DEFAULT_THRESHOLD_PERCENTAGE);
         if(localLOGV) Slog.v(TAG, "Threshold Percentage="+value);
+        value *= mTotalMemory;
+        long maxValue = Settings.Secure.getInt(
+                mContentResolver,
+                Settings.Secure.SYS_STORAGE_THRESHOLD_MAX_BYTES,
+                DEFAULT_THRESHOLD_MAX_BYTES);
         //evaluate threshold value
-        return mTotalMemory*value;
+        return value < maxValue ? value : maxValue;
     }
 
     /*
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 7965dda..79ec920 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -2927,24 +2927,23 @@
                     System.arraycopy(mTmpSharedLibraries, 0,
                             pkg.usesLibraryFiles, 0, num);
                 }
+            }
 
-                if (pkg.reqFeatures != null) {
-                    N = pkg.reqFeatures.size();
-                    for (int i=0; i<N; i++) {
-                        FeatureInfo fi = pkg.reqFeatures.get(i);
-                        if ((fi.flags&FeatureInfo.FLAG_REQUIRED) == 0) {
-                            // Don't care.
-                            continue;
-                        }
+            if (pkg.reqFeatures != null) {
+                int N = pkg.reqFeatures.size();
+                for (int i = 0; i < N; i++) {
+                    FeatureInfo fi = pkg.reqFeatures.get(i);
+                    if ((fi.flags & FeatureInfo.FLAG_REQUIRED) == 0) {
+                        // Don't care.
+                        continue;
+                    }
 
-                        if (fi.name != null) {
-                            if (mAvailableFeatures.get(fi.name) == null) {
-                                Slog.e(TAG, "Package " + pkg.packageName
-                                        + " requires unavailable feature "
-                                        + fi.name + "; failing!");
-                                mLastScanError = PackageManager.INSTALL_FAILED_MISSING_FEATURE;
-                                return null;
-                            }
+                    if (fi.name != null) {
+                        if (mAvailableFeatures.get(fi.name) == null) {
+                            Slog.e(TAG, "Package " + pkg.packageName
+                                    + " requires unavailable feature " + fi.name + "; failing!");
+                            mLastScanError = PackageManager.INSTALL_FAILED_MISSING_FEATURE;
+                            return null;
                         }
                     }
                 }
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index f1d5489..3c8fb01 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -1324,6 +1324,7 @@
         ActivityThread at = ActivityThread.systemMain();
         mSystemThread = at;
         Context context = at.getSystemContext();
+        context.setTheme(android.R.style.Theme_Holo);
         m.mContext = context;
         m.mFactoryTest = factoryTest;
         m.mMainStack = new ActivityStack(m, context, true);
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index caaae1f..72ea7ce 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -26,6 +26,7 @@
 import android.content.pm.ApplicationInfo;
 import android.content.res.Configuration;
 import android.graphics.Bitmap;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.Message;
 import android.os.Process;
@@ -69,6 +70,7 @@
     int labelRes;           // the label information from the package mgr.
     int icon;               // resource identifier of activity's icon.
     int theme;              // resource identifier of activity's theme.
+    int realTheme;          // actual theme resource we will use, never 0.
     int windowFlags;        // custom window flags for preview window.
     TaskRecord task;        // the task this is in.
     long launchTime;        // when we starting launching this activity
@@ -246,6 +248,13 @@
             }
             icon = aInfo.getIconResource();
             theme = aInfo.getThemeResource();
+            realTheme = theme;
+            if (realTheme == 0) {
+                realTheme = aInfo.applicationInfo.targetSdkVersion
+                        < Build.VERSION_CODES.HONEYCOMB
+                        ? android.R.style.Theme
+                        : android.R.style.Theme_Holo;
+            }
             if ((aInfo.flags&ActivityInfo.FLAG_HARDWARE_ACCELERATED) != 0) {
                 windowFlags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
             }
@@ -266,8 +275,7 @@
             launchMode = aInfo.launchMode;
             
             AttributeCache.Entry ent = AttributeCache.instance().get(packageName,
-                    theme != 0 ? theme : android.R.style.Theme,
-                    com.android.internal.R.styleable.Window);
+                    realTheme, com.android.internal.R.styleable.Window);
             fullscreen = ent != null && !ent.array.getBoolean(
                     com.android.internal.R.styleable.Window_windowIsFloating, false)
                     && !ent.array.getBoolean(
diff --git a/services/java/com/android/server/am/BaseErrorDialog.java b/services/java/com/android/server/am/BaseErrorDialog.java
index 03e3272..d1e89bc 100644
--- a/services/java/com/android/server/am/BaseErrorDialog.java
+++ b/services/java/com/android/server/am/BaseErrorDialog.java
@@ -34,7 +34,7 @@
         getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
                 WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
         getWindow().setTitle("Error Dialog");
-        setIcon(R.drawable.ic_dialog_alert);
+        setIconAttribute(R.attr.alertDialogIcon);
     }
 
     public void onStart() {
diff --git a/services/java/com/android/server/am/LaunchWarningWindow.java b/services/java/com/android/server/am/LaunchWarningWindow.java
index 4130e33..1114a31 100644
--- a/services/java/com/android/server/am/LaunchWarningWindow.java
+++ b/services/java/com/android/server/am/LaunchWarningWindow.java
@@ -4,6 +4,7 @@
 
 import android.app.Dialog;
 import android.content.Context;
+import android.util.TypedValue;
 import android.view.Window;
 import android.view.WindowManager;
 import android.widget.ImageView;
@@ -20,8 +21,11 @@
         
         setContentView(R.layout.launch_warning);
         setTitle(context.getText(R.string.launch_warning_title));
-        getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
-                R.drawable.ic_dialog_alert);
+
+        TypedValue out = new TypedValue();
+        getContext().getTheme().resolveAttribute(android.R.attr.alertDialogIcon, out, true);
+        getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, out.resourceId);
+
         ImageView icon = (ImageView)findViewById(R.id.replace_app_icon);
         icon.setImageDrawable(next.info.applicationInfo.loadIcon(context.getPackageManager()));
         TextView text = (TextView)findViewById(R.id.replace_message);
diff --git a/test-runner/src/android/test/ActivityTestCase.java b/test-runner/src/android/test/ActivityTestCase.java
index 18bfccc..c7b1d70 100644
--- a/test-runner/src/android/test/ActivityTestCase.java
+++ b/test-runner/src/android/test/ActivityTestCase.java
@@ -19,10 +19,11 @@
 import android.app.Activity;
 
 import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 
 /**
  * This is common code used to support Activity test cases.  For more useful classes, please see
- * {@link android.test.ActivityUnitTestCase} and 
+ * {@link android.test.ActivityUnitTestCase} and
  * {@link android.test.ActivityInstrumentationTestCase}.
  */
 public abstract class ActivityTestCase extends InstrumentationTestCase {
@@ -38,7 +39,7 @@
     protected Activity getActivity() {
         return mActivity;
     }
-    
+
     /**
      * Set the activity under test.
      * @param testActivity The activity under test
@@ -46,15 +47,15 @@
     protected void setActivity(Activity testActivity) {
         mActivity = testActivity;
     }
-    
+
     /**
      * This function is called by various TestCase implementations, at tearDown() time, in order
      * to scrub out any class variables.  This protects against memory leaks in the case where a
      * test case creates a non-static inner class (thus referencing the test case) and gives it to
      * someone else to hold onto.
-     * 
+     *
      * @param testCaseClass The class of the derived TestCase implementation.
-     * 
+     *
      * @throws IllegalAccessException
      */
     protected void scrubClass(final Class<?> testCaseClass)
@@ -62,7 +63,8 @@
         final Field[] fields = getClass().getDeclaredFields();
         for (Field field : fields) {
             final Class<?> fieldClass = field.getDeclaringClass();
-            if (testCaseClass.isAssignableFrom(fieldClass) && !field.getType().isPrimitive()) {
+            if (testCaseClass.isAssignableFrom(fieldClass) && !field.getType().isPrimitive()
+                    && (field.getModifiers() & Modifier.FINAL) == 0) {
                 try {
                     field.setAccessible(true);
                     field.set(this, null);
@@ -77,6 +79,6 @@
         }
     }
 
-    
+
 
 }