Merge "Camera: doc update for color aberration modes" into lmp-mr1-dev
diff --git a/api/current.txt b/api/current.txt
index 1f86b03..24501f3 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28541,6 +28541,7 @@
     field public static final int MMS_ERROR_HTTP_FAILURE = 4; // 0x4
     field public static final int MMS_ERROR_INVALID_APN = 2; // 0x2
     field public static final int MMS_ERROR_IO_ERROR = 5; // 0x5
+    field public static final int MMS_ERROR_NO_DATA_NETWORK = 8; // 0x8
     field public static final int MMS_ERROR_RETRY = 6; // 0x6
     field public static final int MMS_ERROR_UNABLE_CONNECT_MMS = 3; // 0x3
     field public static final int MMS_ERROR_UNSPECIFIED = 1; // 0x1
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 7fd586f..0a573ca 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -1667,8 +1667,8 @@
                         System.out.print("package:");
                         System.out.println(splitSourceDir);
                     }
-                    return 0;
                 }
+                return 0;
             }
         } catch (RemoteException e) {
             System.err.println(e.toString());
diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java
index 4ce7835..3c6458f 100644
--- a/core/java/android/app/AlertDialog.java
+++ b/core/java/android/app/AlertDialog.java
@@ -466,6 +466,8 @@
         
         /**
          * Set the resource id of the {@link Drawable} to be used in the title.
+         * <p>
+         * Takes precedence over values set using {@link #setIcon(Drawable)}.
          *
          * @return This Builder object to allow for chaining of calls to set methods
          */
@@ -485,7 +487,11 @@
         }
 
         /**
-         * Set an icon as supplied by a theme attribute. e.g. android.R.attr.alertDialogIcon
+         * Set an icon as supplied by a theme attribute. e.g.
+         * {@link android.R.attr#alertDialogIcon}.
+         * <p>
+         * Takes precedence over values set using {@link #setIcon(int)} or
+         * {@link #setIcon(Drawable)}.
          *
          * @param attrId ID of a theme attribute that points to a drawable resource.
          */
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 17ee494..cdc8661 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -933,10 +933,8 @@
             return -1;
         }
 
-        NetworkCallback networkCallback = removeRequestForFeature(netCap);
-        if (networkCallback != null) {
+        if (removeRequestForFeature(netCap)) {
             Log.d(TAG, "stopUsingNetworkFeature for " + networkType + ", " + feature);
-            unregisterNetworkCallback(networkCallback);
         }
         return 1;
     }
@@ -1103,6 +1101,14 @@
         int expireSequenceNumber;
         Network currentNetwork;
         int delay = -1;
+
+        private void clearDnsBinding() {
+            if (currentNetwork != null) {
+                currentNetwork = null;
+                setProcessDefaultNetworkForHostResolution(null);
+            }
+        }
+
         NetworkCallback networkCallback = new NetworkCallback() {
             @Override
             public void onAvailable(Network network) {
@@ -1112,10 +1118,7 @@
             }
             @Override
             public void onLost(Network network) {
-                if (network.equals(currentNetwork)) {
-                    currentNetwork = null;
-                    setProcessDefaultNetworkForHostResolution(null);
-                }
+                if (network.equals(currentNetwork)) clearDnsBinding();
                 Log.d(TAG, "startUsingNetworkFeature lost Network:" + network);
             }
         };
@@ -1144,10 +1147,7 @@
             LegacyRequest l = sLegacyRequests.get(netCap);
             if (l == null) return;
             ourSeqNum = l.expireSequenceNumber;
-            if (l.expireSequenceNumber == sequenceNum) {
-                unregisterNetworkCallback(l.networkCallback);
-                sLegacyRequests.remove(netCap);
-            }
+            if (l.expireSequenceNumber == sequenceNum) removeRequestForFeature(netCap);
         }
         Log.d(TAG, "expireRequest with " + ourSeqNum + ", " + sequenceNum);
     }
@@ -1178,12 +1178,15 @@
         }
     }
 
-    private NetworkCallback removeRequestForFeature(NetworkCapabilities netCap) {
+    private boolean removeRequestForFeature(NetworkCapabilities netCap) {
+        final LegacyRequest l;
         synchronized (sLegacyRequests) {
-            LegacyRequest l = sLegacyRequests.remove(netCap);
-            if (l == null) return null;
-            return l.networkCallback;
+            l = sLegacyRequests.remove(netCap);
         }
+        if (l == null) return false;
+        unregisterNetworkCallback(l.networkCallback);
+        l.clearDnsBinding();
+        return true;
     }
 
     /**
diff --git a/core/java/android/preference/Preference.java b/core/java/android/preference/Preference.java
index 56d5617..0224c73 100644
--- a/core/java/android/preference/Preference.java
+++ b/core/java/android/preference/Preference.java
@@ -215,7 +215,7 @@
 
         final TypedArray a = context.obtainStyledAttributes(
                 attrs, com.android.internal.R.styleable.Preference, defStyleAttr, defStyleRes);
-        for (int i = a.getIndexCount(); i >= 0; i--) {
+        for (int i = a.getIndexCount() - 1; i >= 0; i--) {
             int attr = a.getIndex(i); 
             switch (attr) {
                 case com.android.internal.R.styleable.Preference_icon:
diff --git a/core/java/android/preference/PreferenceManager.java b/core/java/android/preference/PreferenceManager.java
index ad940c6..0a0e625 100644
--- a/core/java/android/preference/PreferenceManager.java
+++ b/core/java/android/preference/PreferenceManager.java
@@ -156,7 +156,7 @@
      * should be used ANY time a preference will be displayed, since some preference
      * types need an Activity for managed queries.
      */
-    private PreferenceManager(Context context) {
+    /*package*/ PreferenceManager(Context context) {
         init(context);
     }
 
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 27c1978..23792be 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -15531,6 +15531,13 @@
         final int width = bounds.width();
         final int height = bounds.height();
         final HardwareCanvas canvas = renderNode.start(width, height);
+
+        // Reverse left/top translation done by drawable canvas, which will
+        // instead be applied by rendernode's LTRB bounds below. This way, the
+        // drawable's bounds match with its rendernode bounds and its content
+        // will lie within those bounds in the rendernode tree.
+        canvas.translate(-bounds.left, -bounds.top);
+
         try {
             drawable.draw(canvas);
         } finally {
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index 6944c53..55c6cb89 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -18,6 +18,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.SystemApi;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.Resources;
@@ -901,6 +902,14 @@
     }
 
     /** @hide */
+    @SystemApi
+    public void setDisableWallpaperTouchEvents(boolean disable) {
+        setPrivateFlags(disable
+                ? WindowManager.LayoutParams.PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS : 0,
+                WindowManager.LayoutParams.PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS);
+    }
+
+    /** @hide */
     public abstract void alwaysReadCloseOnTouchAttr();
 
     /** @hide */
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index d80ad6a..523f970 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -2565,7 +2565,7 @@
                 if (getVisibility() == VISIBLE) {
                     selector.setVisible(true, false);
                 }
-                selector.setState(getDrawableState());
+                updateSelectorState();
             }
             if (manageHotspot) {
                 selector.setHotspot(x, y);
diff --git a/core/java/android/widget/TimePickerClockDelegate.java b/core/java/android/widget/TimePickerClockDelegate.java
index 8d475a7..1534429 100644
--- a/core/java/android/widget/TimePickerClockDelegate.java
+++ b/core/java/android/widget/TimePickerClockDelegate.java
@@ -63,6 +63,8 @@
     // Also NOT a real index, just used for keyboard mode.
     private static final int ENABLE_PICKER_INDEX = 3;
 
+    // LayoutLib relies on these constants. Change TimePickerClockDelegate_Delegate if
+    // modifying these.
     static final int AM = 0;
     static final int PM = 1;
 
@@ -1051,15 +1053,16 @@
         // Cache the codes.
         if (mAmKeyCode == -1 || mPmKeyCode == -1) {
             // Find the first character in the AM/PM text that is unique.
-            KeyCharacterMap kcm = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD);
-            char amChar;
-            char pmChar;
-            for (int i = 0; i < Math.max(mAmText.length(), mPmText.length()); i++) {
-                amChar = mAmText.toLowerCase(mCurrentLocale).charAt(i);
-                pmChar = mPmText.toLowerCase(mCurrentLocale).charAt(i);
+            final KeyCharacterMap kcm = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD);
+            final CharSequence amText = mAmText.toLowerCase(mCurrentLocale);
+            final CharSequence pmText = mPmText.toLowerCase(mCurrentLocale);
+            final int N = Math.min(amText.length(), pmText.length());
+            for (int i = 0; i < N; i++) {
+                final char amChar = amText.charAt(i);
+                final char pmChar = pmText.charAt(i);
                 if (amChar != pmChar) {
-                    KeyEvent[] events = kcm.getEvents(new char[]{amChar, pmChar});
                     // There should be 4 events: a down and up for both AM and PM.
+                    final KeyEvent[] events = kcm.getEvents(new char[] { amChar, pmChar });
                     if (events != null && events.length == 4) {
                         mAmKeyCode = events[0].getKeyCode();
                         mPmKeyCode = events[2].getKeyCode();
@@ -1070,6 +1073,7 @@
                 }
             }
         }
+
         if (amOrPm == AM) {
             return mAmKeyCode;
         } else if (amOrPm == PM) {
diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java
index 35e03c3..20d209f 100644
--- a/core/java/com/android/internal/app/AlertController.java
+++ b/core/java/com/android/internal/app/AlertController.java
@@ -955,10 +955,10 @@
                 if (mIcon != null) {
                     dialog.setIcon(mIcon);
                 }
-                if (mIconId >= 0) {
+                if (mIconId != 0) {
                     dialog.setIcon(mIconId);
                 }
-                if (mIconAttrId > 0) {
+                if (mIconAttrId != 0) {
                     dialog.setIcon(dialog.getIconAttributeResId(mIconAttrId));
                 }
             }
diff --git a/services/core/java/com/android/server/ShutdownActivity.java b/core/java/com/android/internal/app/ShutdownActivity.java
similarity index 97%
rename from services/core/java/com/android/server/ShutdownActivity.java
rename to core/java/com/android/internal/app/ShutdownActivity.java
index 56172ed0..97521cf 100644
--- a/services/core/java/com/android/server/ShutdownActivity.java
+++ b/core/java/com/android/internal/app/ShutdownActivity.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.server;
+package com.android.internal.app;
 
 import android.app.Activity;
 import android.content.Context;
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 87b9971..ccdb5db 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -3028,8 +3028,9 @@
                android:process=":ui">
         </activity>
 
-        <activity android:name="com.android.server.ShutdownActivity"
+        <activity android:name="com.android.internal.app.ShutdownActivity"
             android:permission="android.permission.SHUTDOWN"
+            android:theme="@style/Theme.NoDisplay"
             android:excludeFromRecents="true">
             <intent-filter>
                 <action android:name="android.intent.action.ACTION_REQUEST_SHUTDOWN" />
diff --git a/core/res/res/drawable/scrollbar_handle_material.xml b/core/res/res/drawable/scrollbar_handle_material.xml
index 1b3bb9b..56fecec 100644
--- a/core/res/res/drawable/scrollbar_handle_material.xml
+++ b/core/res/res/drawable/scrollbar_handle_material.xml
@@ -17,6 +17,6 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:tint="?attr/colorControlNormal"
        android:shape="rectangle">
-    <solid android:color="#42ffffff" />
+    <solid android:color="#84ffffff" />
     <size android:width="4dp" />
 </shape>
diff --git a/docs/html-intl/intl/ja/training/tv/playback/browse.jd b/docs/html-intl/intl/ja/training/tv/playback/browse.jd
new file mode 100755
index 0000000..f2261e1
--- /dev/null
+++ b/docs/html-intl/intl/ja/training/tv/playback/browse.jd
@@ -0,0 +1,194 @@
+page.title=カタログ ブラウザを作成する
+page.tags=tv, browsefragment, presenter, backgroundmanager
+
+trainingnavtop=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>学習の目的</h2>
+  <ol>
+    <li><a href="#layout">メディア ブラウズ レイアウトを作成する</a></li>
+    <li><a href="#lists">メディア リストを表示する</a></li>
+    <li><a href="#background">背景をアップデートする</a></li>
+  </ol>
+
+</div>
+</div>
+
+<p>
+  TV で使用するメディア アプリでは、ユーザーがコンテンツ内容をブラウズして選び、再生を開始できるようにする必要があります。このタイプのアプリのコンテンツ ブラウジングに関するユーザー エクスペリエンスは、シンプルで直感的、そして目を楽しませる魅力的なものである必要があります。
+</p>
+
+<p>
+  このレッスンでは、<a href="{@docRoot}tools/support-library/features.html#v17-leanback">v17 leanback サポート ライブラリ</a> が提供するクラスを使用して、アプリのメディア カタログから音楽やビデオを閲覧するためのユーザー インターフェースを実装する方法を説明します。
+</p>
+
+
+<h2 id="layout">メディア ブラウズ レイアウトを作成する</h2>
+
+<p>
+  leanback サポート ライブラリの {@link android.support.v17.leanback.app.BrowseFragment} クラスを使用すると、最小限のコードでブラウジング カテゴリのプライマリ レイアウトとメディア アイテムの行を作成できます。次の例では、{@link android.support.v17.leanback.app.BrowseFragment} を含むレイアウトの作成方法を示します。
+</p>
+
+<pre>
+&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+  android:layout_width="match_parent"
+  android:layout_height="match_parent"
+  android:orientation="vertical"
+  &gt;
+
+  &lt;fragment
+      <strong>android:name="android.support.v17.leanback.app.BrowseFragment"</strong>
+      android:id="@+id/browse_fragment"
+      android:layout_width="match_parent"
+      android:layout_height="match_parent"
+      /&gt;
+&lt;/LinearLayout&gt;
+</pre>
+
+<p>
+  アクティビティ内でこのレイアウトを使用して作業するには、レイアウトから{@link android.support.v17.leanback.app.BrowseFragment} エレメントを取得します。このクラスのメソッドを使用して、アイコン、タイトル、カテゴリ ヘッダーが有効になっているかどうかなどの表示パラメータを設定します。次のコード サンプルでは、レイアウト内で {@link android.support.v17.leanback.app.BrowseFragment} のレイアウト パラメータの設定方法を示します。
+</p>
+
+<pre>
+public class BrowseMediaActivity extends Activity {
+
+    public static final String TAG ="BrowseActivity";
+
+    protected BrowseFragment mBrowseFragment;
+
+    &#64;Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.browse_fragment);
+
+        final FragmentManager fragmentManager = getFragmentManager();
+        <strong>mBrowseFragment = (BrowseFragment) fragmentManager.findFragmentById(
+                R.id.browse_fragment);</strong>
+
+        // Set display parameters for the BrowseFragment
+        mBrowseFragment.setHeadersState(BrowseFragment.HEADERS_ENABLED);
+        mBrowseFragment.setTitle(getString(R.string.app_name));
+        mBrowseFragment.setBadgeDrawable(getResources().getDrawable(
+                R.drawable.ic_launcher));
+        mBrowseFragment.setBrowseParams(params);
+
+    }
+}
+</pre>
+
+
+<h2 id="lists">メディア リストを表示する</h2>
+
+<p>
+  {@link android.support.v17.leanback.app.BrowseFragment} ではアダプタとプレゼンターを使用して、ブラウズ可能なメディア コンテンツのカテゴリや、メディア カタログのメディア アイテムを定義したり、表示したりできます。アダプタを使用すると、メディア カタログ情報が含まれているローカルやオンラインのデータ ソースに接続できます。プレゼンターは、メディア アイテムに関するデータを保持し、スクリーンにアイテムを表示する際のレイアウト情報を提供します。
+</p>
+
+<p>
+  次のコード例では、文字列データを表示する際の{@link android.support.v17.leanback.widget.Presenter} の実装について示します。
+</p>
+
+<pre>
+public class StringPresenter extends Presenter {
+    private static final String TAG = "StringPresenter";
+
+    public ViewHolder onCreateViewHolder(ViewGroup parent) {
+        TextView textView = new TextView(parent.getContext());
+        textView.setFocusable(true);
+        textView.setFocusableInTouchMode(true);
+        textView.setBackground(
+                parent.getContext().getResources().getDrawable(R.drawable.text_bg));
+        return new ViewHolder(textView);
+    }
+
+    public void onBindViewHolder(ViewHolder viewHolder, Object item) {
+        ((TextView) viewHolder.view).setText(item.toString());
+    }
+
+    public void onUnbindViewHolder(ViewHolder viewHolder) {
+        // no op
+    }
+}
+</pre>
+
+<p>
+  メディア アイテムのプレゼンター クラスを構築したら、アダプタをビルドしたり、{@link android.support.v17.leanback.app.BrowseFragment} にアタッチしたりして、ユーザーのブラウジング用にスクリーン上にそれらのアイテムを表示させることができます。次のコード例では、1 つ前のコード例に示したように、{@code StringPresenter} クラスを使用して、カテゴリ内にカテゴリとアイテムを表示するためのアダプタの構築方法を示します。
+</p>
+
+<pre>
+private ArrayObjectAdapter mRowsAdapter;
+private static final int NUM_ROWS = 4;
+
+&#64;Override
+protected void onCreate(Bundle savedInstanceState) {
+    ...
+
+    buildRowsAdapter();
+}
+
+private void buildRowsAdapter() {
+    mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
+
+    for (int i = 0; i &lt; NUM_ROWS; ++i) {
+        ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(
+                new StringPresenter());
+        listRowAdapter.add("Media Item 1");
+        listRowAdapter.add("Media Item 2");
+        listRowAdapter.add("Media Item 3");
+        HeaderItem header = new HeaderItem(i, "Category " + i, null);
+        mRowsAdapter.add(new ListRow(header, listRowAdapter));
+    }
+
+    mBrowseFragment.setAdapter(mRowsAdapter);
+}
+</pre>
+
+<p>
+  この例では、アダプタの静的実装を示します。一般的なメディア ブラウジング アプリは、オンライン データベースやウェブ サービスのデータを使用します。ウェブから取得したデータを使用したブラウジング アプリの例については、<a href="http://github.com/googlesamples/androidtv-leanback">Android TV</a> のサンプル アプリを参照してください。
+</p>
+
+<h2 id="background">背景をアップデートする</h2>
+
+<p>
+  TV で使用されるメディア ブラウジング アプリを目立たせるために、ユーザーがコンテンツをブラウジングしている間の背景イメージをアップデートできます。これにより、アプリの使用がユーザーにとって、より動きのある楽しいものになります。
+</p>
+
+<p>
+  Leanback サポート ライブラリは、TV アプリのアクティビティの背景を変更するための {@link android.support.v17.leanback.app.BackgroundManager} クラスを提供しています。次の例では、TV アプリのアクティビティ内の背景をアップデートする簡単なメソッドの作成方法を示します。
+</p>
+
+<pre>
+protected void updateBackground(Drawable drawable) {
+    BackgroundManager.getInstance(this).setDrawable(drawable);
+}
+</pre>
+
+<p>
+  ほとんどの既存のメディア ブラウズ アプリでは、ユーザーがメディア リストをスクロールするのに合わせて自動的に背景がアップデートされます。これを行うには選択リスナを設定して、ユーザーの現在の選択に基づいて自動的に背景をアップデートできるようにします。次の例では、{@link android.support.v17.leanback.widget.OnItemViewSelectedListener} クラスをセットアップして、選択イベントの判別後に背景をアップデートする方法を示します。
+</p>
+
+<pre>
+protected void clearBackground() {
+    BackgroundManager.getInstance(this).setDrawable(mDefaultBackground);
+}
+
+protected OnItemViewSelectedListener getDefaultItemViewSelectedListener() {
+    return new OnItemViewSelectedListener() {
+        &#64;Override
+        public void onItemSelected(Object item, Row row) {
+            if (item instanceof Movie ) {
+                URI uri = ((Movie)item).getBackdropURI();
+                updateBackground(uri);
+            } else {
+                clearBackground();
+            }
+        }
+    };
+}
+</pre>
+
+<p class="note">
+  <strong>注意:</strong>上記の実装例はわかりやすく示すため、実際よりも単純化されています。実際にアプリでこの機能を作成する際は、パフォーマンス向上のために、別のスレッドで背景のアップデート アクションを実行するようにしてください。また、ユーザーがアイテムをスクロールする動作に合わせて背景をアップデートする場合には、ユーザーが 1 つのアイテムに落ち着くまで、背景イメージのアップデートを遅らせる時間を追加することも検討してください。これにより、背景イメージのアップデートが過剰にならないようにします。
+</p>
diff --git a/docs/html-intl/intl/ja/training/tv/playback/details.jd b/docs/html-intl/intl/ja/training/tv/playback/details.jd
new file mode 100755
index 0000000..8e6d28f
--- /dev/null
+++ b/docs/html-intl/intl/ja/training/tv/playback/details.jd
@@ -0,0 +1,210 @@
+page.title=詳細ビューをビルドする
+page.tags=tv, detailsfragment
+
+trainingnavtop=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>学習の目的</h2>
+  <ol>
+    <li><a href="#details-presenter">詳細プレゼンターをビルドする</a></li>
+    <li><a href="#details-fragment">詳細フラグメントを拡張する</a>
+    <li><a href="#activity">詳細アクティビティを作成する</a></li>
+    <li><a href="#item-listener">クリックされたアイテムのリスナを定義する</a></li>
+  </ol>
+</div>
+</div>
+
+<p>
+  <a href="{@docRoot}tools/support-library/features.html#v17-leanback">v17 leanback サポート ライブラリ</a> が提供するメディア ブラウジング インターフェース クラスには、説明やレビューなどのメディア アイテムに関する追加情報を表示したり、アイテムの購入やコンテンツの再生など、アイテムに対するアクションを取ったりするためのクラスが含まれます。
+</p>
+
+<p>
+  このレッスンでは、メディア アイテムの詳細に関するプレゼンター クラスを作成したり、{@link android.support.v17.leanback.app.DetailsFragment} クラスを拡張して、ユーザーがメディア アイテムを選択した場合に表示する詳細ビューを実装したりする方法を説明します。
+</p>
+
+<p class="note">
+  <strong>注意:</strong>次の実装例では、追加的なアクティビティを使用して {@link android.support.v17.leanback.app.DetailsFragment} を含めています。ただし、フラグメント トランザクションを使用すると、現在の {@link android.support.v17.leanback.app.BrowseFragment} を<em>同じ</em>アクティビティにある {@link android.support.v17.leanback.app.DetailsFragment} で置き換えることにより、2 つ目のアクティビティの作成を回避できます。フラグメント トランザクションの使用については、<a href="{@docRoot}training/basics/fragments/fragment-ui.html#Replace">フラグメントを使用したダイナミックな UI のビルド</a>を参照してください。
+</p>
+
+
+<h2 id="details-presenter">詳細プレゼンターをビルドする</h2>
+
+<p>
+  Leanback ライブラリが提供するメディア ブラウジングのフレームワークでは、プレゼンター オブジェクトを使用して、メディア アイテムの詳細を含むスクリーン上のデータ表示を制御します。このメディア アイテムの詳細に関するプレゼンターのほぼ完全な実装を目的に、フレームワークでは{@link android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter} クラスを提供しています。これにより、次のコード サンプルのように、{@link android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter#onBindDescription onBindDescription()} メソッドを実装して、ビュー フィールドをデータ オブジェクトにバインドするだけでよくなります。
+</p>
+
+<pre>
+public class DetailsDescriptionPresenter
+        extends AbstractDetailsDescriptionPresenter {
+
+    &#64;Override
+    protected void onBindDescription(ViewHolder viewHolder, Object itemData) {
+        MyMediaItemDetails details = (MyMediaItemDetails) itemData;
+        // In a production app, the itemData object contains the information
+        // needed to display details for the media item:
+        // viewHolder.getTitle().setText(details.getShortTitle());
+
+        // Here we provide static data for testing purposes:
+        viewHolder.getTitle().setText(itemData.toString());
+        viewHolder.getSubtitle().setText("2014   Drama   TV-14");
+        viewHolder.getBody().setText("Lorem ipsum dolor sit amet, consectetur "
+                + "adipisicing elit, sed do eiusmod tempor incididunt ut labore "
+                + " et dolore magna aliqua. Ut enim ad minim veniam, quis "
+                + "nostrud exercitation ullamco laboris nisi ut aliquip ex ea "
+                + "commodo consequat.");
+    }
+}
+</pre>
+
+
+<h2 id="details-fragment">詳細フラグメントを拡張する</h2>
+
+<p>
+  メディア アイテムの詳細を表示するために {@link android.support.v17.leanback.app.DetailsFragment} クラスを使用する場合、そのクラスを拡張すると、メディア アイテムのプレビュー画像やアクションなどの追加コンテンツを提供できます。関連するメディア アイテムのリストといった追加コンテンツも提供できます。
+</p>
+
+<p>
+  次のコード例では、前のセクションで説明したプレゼンター クラスを使用して、表示中のメディア アイテムのプレビュー画像やアクションを追加する方法を示しています。この例では、詳細リストの下に表示される関連するメディア アイテムの行も追加しています。
+</p>
+
+<pre>
+public class MediaItemDetailsFragment extends DetailsFragment {
+    private static final String TAG = "MediaItemDetailsFragment";
+    private ArrayObjectAdapter mRowsAdapter;
+
+    &#64;Override
+    public void onCreate(Bundle savedInstanceState) {
+        Log.i(TAG, "onCreate");
+        super.onCreate(savedInstanceState);
+
+        buildDetails();
+    }
+
+    private void buildDetails() {
+        ClassPresenterSelector selector = new ClassPresenterSelector();
+        // Attach your media item details presenter to the row presenter:
+        DetailsOverviewRowPresenter rowPresenter =
+            new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
+
+        selector.addClassPresenter(DetailsOverviewRow.class, rowPresenter);
+        selector.addClassPresenter(ListRow.class,
+                new ListRowPresenter());
+        mRowsAdapter = new ArrayObjectAdapter(selector);
+
+        Resources res = getActivity().getResources();
+        DetailsOverviewRow detailsOverview = new DetailsOverviewRow(
+                "Media Item Details");
+
+        // Add images and action buttons to the details view
+        detailsOverview.setImageDrawable(res.getDrawable(R.drawable.jelly_beans));
+        detailsOverview.addAction(new Action(1, "Buy $9.99"));
+        detailsOverview.addAction(new Action(2, "Rent $2.99"));
+        mRowsAdapter.add(detailsOverview);
+
+        // Add a Related items row
+        ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(
+                new StringPresenter());
+        listRowAdapter.add("Media Item 1");
+        listRowAdapter.add("Media Item 2");
+        listRowAdapter.add("Media Item 3");
+        HeaderItem header = new HeaderItem(0, "Related Items", null);
+        mRowsAdapter.add(new ListRow(header, listRowAdapter));
+
+        setAdapter(mRowsAdapter);
+    }
+}
+</pre>
+
+
+<h3 id="activity">詳細アクティビティを作成する</h3>
+
+<p>
+  {@link android.support.v17.leanback.app.DetailsFragment} のようなフラグメントを表示に使用するには、これをアクティビティ内に含める必要があります。ブラウズ アクティビティとは別に、詳細ビューのアクティビティを作成すると、{@link android.content.Intent} を使用して詳細ビューを呼び出すことができます。このセクションでは、メディア アイテムの詳細ビューの実装を含んだアクティビティのビルド方法を説明します。
+</p>
+
+<p>
+  次のように {@link android.support.v17.leanback.app.DetailsFragment} の実装を参照するレイアウトをビルドして、詳細アクティビティの作成を開始します。
+</p>
+
+<pre>
+&lt;!-- file: res/layout/details.xml --&gt;
+
+&lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
+    <strong>android:name="com.example.android.mediabrowser.MediaItemDetailsFragment"</strong>
+    android:id="&#64;+id/details_fragment"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+/&gt;
+</pre>
+
+<p>
+  次に、前述のコード例のレイアウトを使用して、アクティビティ クラスを作成します。
+</p>
+
+<pre>
+public class DetailsActivity extends Activity
+{
+    &#64;Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        <strong>setContentView(R.layout.details);</strong>
+    }
+}
+</pre>
+
+<p>
+  最後に、この新しいアクティビティをマニフェストに追加します。次のように、ユーザー インターフェースがメディア ブラウズ アクティビティと一致するように、Leanback テーマを適用します。
+</p>
+
+<pre>
+&lt;application&gt;
+  ...
+
+  &lt;activity android:name=".DetailsActivity"
+    android:exported="true"
+    <strong>android:theme="@style/Theme.Leanback"/&gt;</strong>
+
+&lt;/application&gt;
+</pre>
+
+
+<h3 id="item-listener">クリックされたアイテムのリスナを定義する</h3>
+
+<p>
+  {@link android.support.v17.leanback.app.DetailsFragment} の実装後、メインのメディア ブラウジング ビューを編集して、ユーザーがメディア アイテムをクリックしたときに詳細ビューに移動するようにします。この動作を有効にするには、 {@link android.support.v17.leanback.widget.OnItemViewClickedListener} オブジェクトを、アイテム詳細アクティビティを起動するインテントの起動元の {@link android.support.v17.leanback.app.BrowseFragment} に追加します。
+</p>
+
+<p>
+  次の例では、ユーザーがメインのメディア ブラウジング アクティビティのメディア アイテムをクリックしたときに、詳細ビューを起動するリスナの実装方法を示しています。
+</p>
+
+<pre>
+public class BrowseMediaActivity extends Activity {
+    ...
+
+    &#64;Override
+    protected void onCreate(Bundle savedInstanceState) {
+        ...
+
+        // create the media item rows
+        buildRowsAdapter();
+
+        // add a listener for selected items
+        mBrowseFragment.OnItemViewClickedListener(
+            new OnItemViewClickedListener() {
+                &#64;Override
+                public void onItemClicked(Object item, Row row) {
+                    System.out.println("Media Item clicked: " + item.toString());
+                    Intent intent = new Intent(BrowseMediaActivity.this,
+                            DetailsActivity.class);
+                    // pass the item information
+                    intent.getExtras().putLong("id", item.getId());
+                    startActivity(intent);
+                }
+            });
+    }
+}
+</pre>
diff --git a/docs/html-intl/intl/ja/training/tv/playback/index.jd b/docs/html-intl/intl/ja/training/tv/playback/index.jd
new file mode 100755
index 0000000..55d2b66
--- /dev/null
+++ b/docs/html-intl/intl/ja/training/tv/playback/index.jd
@@ -0,0 +1,42 @@
+page.title=TV 再生アプリのビルド
+page.tags=tv, leanback
+
+startpage=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>依存関係と前提条件</h2>
+  <ul>
+    <li>Android 5.0(API レベル 21)以降</li>
+  </ul>
+  <h2>関連コンテンツ</h2>
+  <ul>
+    <li><a href="{@docRoot}design/tv/index.html">TV 向けデザインとは</a></li>
+  </ul>
+</div>
+</div>
+
+<p>
+  メディア ファイルのブラウジングと再生は、TV アプリが提供するユーザー エクスペリエンスによって左右される部分が多くあります。ゼロから開始して、高速でなめらかな魅力あるユーザー エクスペリエンスを確実にビルドすることは、非常に困難な場合があります。アプリの露出するメディア カタログが、小規模か大規模かにかかわらず、ユーザーが簡単にオプションをブラウジングでき、希望のコンテンツに辿りつけるようにすることが重要です。
+</p>
+
+<p>
+  Android のフレームワークでは、<a href="{@docRoot}tools/support-library/features.html#v17-leanback">v17 leanback サポート ライブラリ</a>を使用して TV アプリのユーザー インターフェースをビルドするためのクラスを提供します。このライブラリは、最小限のコーディングで、メディア ファイルのブラウジングと再生用の効率的で親しみやすいインターフェースを作成するためのクラスのフレームワークを提供します。クラスは拡張やカスタマイズができるように設計されており、アプリ独自のユーザー エクスペリエンスを作成できます。
+</p>
+
+<p>このクラスでは、TV 向けの Leanback サポート ライブラリを使用して、メディア コンテンツブをラウジングしたり再生したりする TV アプリのビルド方法を説明します。</p>
+
+<h2>トピック</h2>
+
+<dl>
+  <dt><b><a href="browse.html">カタログ ブラウザを作成する</a></b></dt>
+    <dd>Leanback サポート ライブラリを使用して、メディア カタログのブラウジング インターフェースをビルドする方法を説明します。</dd>
+
+  <dt><b><a href="details.html">詳細ビューをビルドする</a></b></dt>
+    <dd>Leanback サポート ライブラリを使用して、メディア アイテムの詳細ページをビルドする方法を説明します。</dd>
+
+  <dt><b><a href="now-playing.html">再生中カードを表示する</a></b></dt>
+    <dd>MediaSession を使用して、「再生中」カードをホーム スクリーンに表示する方法を説明します。</dd>
+</dl>
diff --git a/docs/html-intl/intl/ja/training/tv/playback/now-playing.jd b/docs/html-intl/intl/ja/training/tv/playback/now-playing.jd
new file mode 100755
index 0000000..0959204
--- /dev/null
+++ b/docs/html-intl/intl/ja/training/tv/playback/now-playing.jd
@@ -0,0 +1,134 @@
+page.title=再生中カードを表示する
+page.tags=tv, mediasession
+
+trainingnavtop=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>学習の目的</h2>
+  <ol>
+    <li><a href="#session">Media Session を起動する</a></li>
+    <li><a href="#card">再生中カードを表示する</a></li>
+    <li><a href="#state">再生ステータスをアップデートする</a></li>
+    <li><a href="#respond">ユーザー アクションを処理する</a></li>
+  </ol>
+
+</div>
+</div>
+
+<p>TV アプリでは、ユーザーが他のアプリを使用中にバックグラウンドで音楽やその他のメディアを再生できる場合があります。このタイプのアプリの場合、アプリに戻って音楽を一時停止したり、新しい曲に切り替えたりする方法をユーザーに提供する必要があります。Android のフレームワークでは、ホーム スクリーン上の推奨する行に [<em>再生中</em>] カードを表示することで、 TV アプリで上記の操作を行えるようになります。</p>
+
+<p>[再生中] カードは、アクティブなメディア セッションのホーム スクリーンの推奨する行に表示されるシステム アーティファクトです。アルバム アート、タイトル、アプリのアイコンなど、メディアのメタデータが含まれます。ユーザーが選択すると、システムはセッション中のアプリを開きます。</p>
+
+<p>このレッスンでは、{@link android.media.session.MediaSession} クラスを使用して [再生中] カードを実装する方法を説明します。</p>
+
+<h2 id="session">Media Session を起動する</h2>
+
+<p>再生アプリは<a href="{@docRoot}guide/components/activities">アクティビティ</a>か<a href="{@docRoot}guide/components/services">サービス</a>として実行できます。サービスは、サービスを開始したアクティビティが破棄された後もメディアの再生を継続できるため、バックグラウンド再生時に必要となります。ここでは、メディア再生アプリが {@link android.service.media.MediaBrowserService} で実行されているものとします。</p>
+
+<p>ご使用中のサービスの{@link android.service.media.MediaBrowserService#onCreate() onCreate()}メソッドで、{@link android.media.session.MediaSession#MediaSession(android.content.Context, java.lang.String) MediaSession} を新規作成し、メディア アプリへの適切なコールバックとフラグを設定して、{@link android.service.media.MediaBrowserService} のセッション トークンを設定します。</p>
+
+<pre>
+mSession = new MediaSession(this, "MusicService");
+mSession.setCallback(new MediaSessionCallback());
+mSession.setFlags(MediaSession.FLAG_HANDLES_MEDIA_BUTTONS |
+        MediaSession.FLAG_HANDLES_TRANSPORT_CONTROLS);
+
+// for the MediaBrowserService
+setSessionToken(mSession.getSessionToken());
+</pre>
+
+<p class="note"><strong>注意:</strong>[再生中] カードは、{@link android.media.session.MediaSession#FLAG_HANDLES_TRANSPORT_CONTROLS} フラグが設定されたメディア セッションでのみ表示されます。</p>
+
+<h2 id="card">再生中カードを表示する</h2>
+
+<p>[再生中] カードは、セッションがシステム内で最も優先度の高い場合に、{@link android.media.session.MediaSession#setActive(boolean) setActive(true)} を呼び出した後に表示されます。また、<a href="{@docRoot}training/managing-audio/audio-focus">オーディオ フォーカスを管理する</a>で説明したように、アプリからオーディオ フォーカスをリクエストする必要があります。</p>
+
+<pre>
+private void handlePlayRequest() {
+
+    tryToGetAudioFocus();
+
+    if (!mSession.isActive()) {
+        mSession.setActive(true);
+    }
+...
+</pre>
+
+<p>{@link android.media.session.MediaSession#setActive(boolean) setActive(false)} の呼び出し時や別のアプリがメディアの再生を開始した場合に、カードはホーム スクリーンから削除されます。再生が一時停止された後、通常は 5~30 分間、カードを表示したままにして、その後カードをホーム スクリーンから削除することもできiます。</p>
+
+<h2 id="state">再生ステータスをアップデートする</h2>
+
+<p>どのメディア アプリの場合でも、次の例のように現在のメタデータを表示するよう、{@link android.media.session.MediaSession} で再生ステータスをアップデートするようにします。</p>
+
+<pre>
+private void updatePlaybackState() {
+    long position = PlaybackState.PLAYBACK_POSITION_UNKNOWN;
+    if (mMediaPlayer != null &amp;&amp; mMediaPlayer.isPlaying()) {
+        position = mMediaPlayer.getCurrentPosition();
+    }
+    PlaybackState.Builder stateBuilder = new PlaybackState.Builder()
+            .setActions(getAvailableActions());
+    stateBuilder.setState(mState, position, 1.0f);
+    mSession.setPlaybackState(stateBuilder.build());
+}
+private long getAvailableActions() {
+    long actions = PlaybackState.ACTION_PLAY |
+            PlaybackState.ACTION_PLAY_FROM_MEDIA_ID |
+            PlaybackState.ACTION_PLAY_FROM_SEARCH;
+    if (mPlayingQueue == null || mPlayingQueue.isEmpty()) {
+        return actions;
+    }
+    if (mState == PlaybackState.STATE_PLAYING) {
+        actions |= PlaybackState.ACTION_PAUSE;
+    }
+    if (mCurrentIndexOnQueue &gt; 0) {
+        actions |= PlaybackState.ACTION_SKIP_TO_PREVIOUS;
+    }
+    if (mCurrentIndexOnQueue &lt; mPlayingQueue.size() - 1) {
+        actions |= PlaybackState.ACTION_SKIP_TO_NEXT;
+    }
+    return actions;
+}
+</pre>
+
+<h2 id="metadata">メディアのメタデータを表示する</h2>
+
+<p>トラックが現在再生中の場合は、{@link android.media.session.MediaSession#setMetadata(android.media.MediaMetadata) setMetadata()} メソッドを使用して{@link android.media.MediaMetadata} を設定します。メディア セッション オブジェクトのこのメソッドを使用すると、タイトル、サブタイトル、さまざまなアイコンなど、トラックに関する情報を [再生中] カードに表示することができます。次の例は、トラック データがカスタムデータ クラスの {@code MediaData} に格納されている場合です。</p>
+
+<pre>
+private void updateMetadata(MediaData myData) {
+    MediaMetadata.Builder metadataBuilder = new MediaMetadata.Builder();
+    // To provide most control over how an item is displayed set the
+    // display fields in the metadata
+    metadataBuilder.putString(MediaMetadata.METADATA_KEY_DISPLAY_TITLE,
+            myData.displayTitle);
+    metadataBuilder.putString(MediaMetadata.METADATA_KEY_DISPLAY_SUBTITLE,
+            myData.displaySubtitle);
+    metadataBuilder.putString(MediaMetadata.METADATA_KEY_DISPLAY_ICON_URI,
+            myData.artUri);
+    // And at minimum the title and artist for legacy support
+    metadataBuilder.putString(MediaMetadata.METADATA_KEY_TITLE,
+            myData.title);
+    metadataBuilder.putString(MediaMetadata.METADATA_KEY_ARTIST,
+            myData.artist);
+    // A small bitmap for the artwork is also recommended
+    metadataBuilder.putString(MediaMetadata.METADATA_KEY_ART,
+            myData.artBitmap);
+    // Add any other fields you have for your data as well
+    mSession.setMetadata(metadataBuilder.build());
+}
+</pre>
+
+<h2 id="respond">ユーザー アクションを処理する</h2>
+
+<p>ユーザーが [再生中] カード選択すると、システムはセッション中のアプリを開きます。TV アプリが {@link android.app.PendingIntent} を{@link android.media.session.MediaSession#setSessionActivity(android.app.PendingIntent) setSessionActivity()}に渡した場合は、指定したアクティビティをシステムが次のように開始します。それ以外の場合は、デフォルトのシステム インテントが開きます。指定対象のアクティビティでは、ユーザーに再生の一時停止または停止(再生コントロール)機能を提供する必要があります。</p>
+
+<pre>
+Intent intent = new Intent(mContext, MyActivity.class);
+    PendingIntent pi = PendingIntent.getActivity(context, 99 /*request code*/,
+            intent, PendingIntent.FLAG_UPDATE_CURRENT);
+    mSession.setSessionActivity(pi);
+</pre>
diff --git a/docs/html-intl/intl/ja/training/tv/start/hardware.jd b/docs/html-intl/intl/ja/training/tv/start/hardware.jd
new file mode 100755
index 0000000..ccf20fa
--- /dev/null
+++ b/docs/html-intl/intl/ja/training/tv/start/hardware.jd
@@ -0,0 +1,314 @@
+page.title= TV ハードウェアを処理する
+page.tags=tv
+trainingnavtop=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>学習の目的</h2>
+  <ol>
+    <li><a href="#runtime-check">TV 端末をチェックする</a>
+    <li><a href="#handle-features">サポートされていないハードウェア機能を処理する</a></li>
+    <li><a href="#controllers">ハードウェア コントローラを管理する</a>
+    </li>
+  </ol>
+</div>
+</div>
+
+<p>
+  TV のハードウェアは、他の Android 端末とは大きく異なります。TV には、タッチスクリーン、カメラ、GPS 受信機など、他の Android 端末でよく使われるハードウェア機能がありません。そして TV は、2 次ハードウェア端末に完全に依存しています。つまり、ユーザーはリモコンやゲーム機のコントローラで TV アプリを操作する必要があります。TV アプリをビルドする際は、ハードウェア上の制限や TV 向けハードウェアの操作要件を慎重に考慮する必要があります。
+</p>
+
+<p>
+  このレッスンでは、TV でアプリが正常に動作するかどうかチェックする方法や、サポートされていないハードウェア機能を処理する方法、そして TV 端末用のコントローラを処理するための要件について説明します。
+</p>
+
+
+<h2 id="runtime-check">TV 端末をチェックする</h2>
+
+<p>
+  TV 端末やその他の端末の両方で動作するアプリをビルドする場合、アプリが実行される端末の種類をチェックして、アプリの動作を調整する必要があります。たとえば、{@link android.content.Intent} を介して起動するアプリの場合、アクティビティをテレビ向けに起動するか、携帯電話向けに起動するかを判断するために、アプリ側で端末のプロパティをチェックする必要があります。
+</p>
+
+<p>
+  TV 端末でアプリが正常に動作するかどうかを判断するには、{@link android.app.UiModeManager#getCurrentModeType UiModeManager.getCurrentModeType()} メソッドを使用して、その端末がアプリの TV モードで正常に動作するかどうかをチェックすることをお勧めします。次のコード例では、TV 端末でアプリが正常に動作するかどうかチェックする方法を示します。
+</p>
+
+<pre>
+public static final String TAG = "DeviceTypeRuntimeCheck";
+
+UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
+if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
+    Log.d(TAG, "Running on a TV Device")
+} else {
+    Log.d(TAG, "Running on a non-TV Device")
+}
+</pre>
+
+
+<h2 id="handle-features">サポートされていないハードウェア機能を処理する</h2>
+
+<p>
+  アプリのデザインと機能によっては、特定のハードウェア機能を利用できないという事態を回避できる場合があります。このセクションでは、一般的に TV で使用できないハードウェア機能や、それらを検出する方法、そしてそれらの機能の代替案について説明します。
+</p>
+
+
+<h3 id="unsupported-features">サポートされていない TV ハードウェア機能</h3>
+
+<p>
+  TV には他の端末と異なる用途がありますので、他の Android 端末で提供されることの多いハードウェア機能がない場合があります。このため、Android システムは TV 端末では次の機能をサポートしていません。
+</p>
+
+<table>
+  <tr>
+    <th>ハードウェア</th>
+    <th>Android の Feature Descriptor</th>
+  </tr>
+  <tr>
+    <td>タッチスクリーン</td>
+    <td>{@code android.hardware.touchscreen}</td>
+  </tr>
+  <tr>
+    <td>電話</td>
+    <td>{@code android.hardware.telephony}</td>
+  </tr>
+  <tr>
+    <td>カメラ</td>
+    <td>{@code android.hardware.camera}</td>
+  </tr>
+  <tr>
+    <td>近距離無線通信(NFC)</td>
+    <td>{@code android.hardware.nfc}</td>
+  </tr>
+  <tr>
+    <td>GPS</td>
+    <td>{@code android.hardware.location.gps}</td>
+  </tr>
+  <tr>
+    <td>マイク</td>
+    <td>{@code android.hardware.microphone}</td>
+  </tr>
+</table>
+
+
+<h3 id="declare-hardware-requirements">TV のハードウェア要件を宣言する</h3>
+
+<p>
+  Android アプリでは、機能提供がない端末にインストールされてしまわないように、アプリのマニフェストでハードウェア機能の要件を宣言できます。TV 向けに既存のアプリを拡張している場合は、TV 端末へのインストールを阻害する可能性のあるハードウェア要件を宣言しているかどうかについて、アプリのマニフェストを詳細に見直す必要があります。
+</p>
+
+<p>
+  アプリでは TV で使用できないハードウェア機能(タッチスクリーンやカメラなど)を使用しているが、TV 向けにはそれらの機能がなくても構わない場合、アプリのマニフェストを編集して、それが不要な機能であることを示します。次のマニフェストのコード スニペットでは、TV 端末で使用できないハードウェア機能を(TV 以外の端末には提供する可能性がある場合でも)不要と宣言する方法を示します。
+</p>
+
+<pre>
+&lt;uses-feature android:name="android.hardware.touchscreen"
+        android:required="false"/&gt;
+&lt;uses-feature android:name="android.hardware.telephony"
+        android:required="false"/&gt;
+&lt;uses-feature android:name="android.hardware.camera"
+        android:required="false"/&gt;
+&lt;uses-feature android:name="android.hardware.nfc"
+        android:required="false"/&gt;
+&lt;uses-feature android:name="android.hardware.gps"
+        android:required="false"/&gt;
+&lt;uses-feature android:name="android.hardware.microphone"
+        android:required="false"/&gt;
+</pre>
+
+<p>
+  なお、TV 端末向けのすべてのアプリは、<a href="{@docRoot}training/tv/start/start.html#no-touchscreen">TV アプリのビルドを開始する</a>で説明したように、タッチスクリーン機能が不要であることを宣言する必要があります。アプリで上記の機能を 1 つ以上使用している場合は、マニフェストで該当する機能の {@code android:required} 属性の設定を {@code false} に変更します。
+</p>
+
+<p class="caution">
+  <strong>警告:</strong>この値を {@code true} に設定してハードウェア機能を必要と宣言すると、TV 端末にインストールされず、Android 版 TV のホーム スクリーン ランチャーにもアプリが表示されなくなります。
+</p>
+
+<p>
+  アプリのハードウェア機能をオプションにする場合は、実行時にこれらの機能が利用できるかをチェックしてから、アプリの動作を調整する必要があります。次のセクションでは、ハードウェア機能をチェックする方法と、アプリの動作を変更するためのいくつかのアプローチについて説明します。
+</p>
+
+<p>
+  マニフェスト内でのフィルタリングと機能の宣言については、<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code uses-feature}</a>ガイドを参照してください。
+</p>
+
+
+<h3 id="hardware-permissions">ハードウェア機能を暗示するパーミッションを宣言する</h3>
+
+<p>
+  <a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">{@code uses-permission}</a> のマニフェストにおける宣言には、<em>ハードウェア機能を暗示する</em>ものがあります。これは、アプリのマニフェストでいくつかのパーミッションを要求すると、アプリが TV 端末にインストールされず、使用されなくなることを意味します。次の一般によく要求されるパーミッションにより、暗黙的なハードウェア機能の要件が作成されます。
+</p>
+
+<table>
+  <tr>
+    <th>パーミッション</th>
+    <th>暗黙的なハードウェア機能</th>
+  </tr>
+  <tr>
+    <td>{@link android.Manifest.permission#RECORD_AUDIO}</td>
+    <td>{@code android.hardware.microphone}</td>
+  </tr>
+  <tr>
+    <td>{@link android.Manifest.permission#CAMERA}</td>
+    <td>{@code android.hardware.camera} <em>と</em> <br/> {@code android.hardware.camera.autofocus}</td>
+  </tr>
+  <tr>
+    <td>{@link android.Manifest.permission#ACCESS_COARSE_LOCATION}</td>
+    <td>{@code android.hardware.location} <em>と</em> <br/> {@code android.hardware.location.network}</td>
+  </tr>
+  <tr>
+    <td>{@link android.Manifest.permission#ACCESS_FINE_LOCATION}</td>
+    <td>{@code android.hardware.location} <em>と</em> <br/> {@code android.hardware.location.gps}</td>
+  </tr>
+</table>
+
+<p>
+  ハードウェア機能の要件を暗示するパーミッション要求を網羅したリストについては、<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html#permissions-features">{@code uses-feature}</a>ガイドを参照してください。アプリが上記の機能のいずれかを要求する場合、暗示されたハードウェア機能についてマニフェストに <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code uses-feature}</a> 宣言を含めて、不要であることを示します({@code android:required="false"})。
+</p>
+
+
+<h3 id="check-features">ハードウェア機能をチェックする</h2>
+
+<p>
+  Android のフレームワークでは、アプリを実行している端末でハードウェア機能が使用できない場合を判別できます。{@link android.content.pm.PackageManager#hasSystemFeature(String)} メソッドを使用して、実行時に特定の機能をチェックできます。この場合、チェック対象の機能を指定する単一の文字列の引数を使用します。
+</p>
+
+<p>次のコード例では、アプリの実行時にハードウェア機能の利用可能性を検出する方法を示します。</p>
+
+<pre>
+// Check if the telephony hardware feature is available.
+if (getPackageManager().hasSystemFeature("android.hardware.telephony")) {
+    Log.d("HardwareFeatureTest", "Device can make phone calls");
+}
+
+// Check if android.hardware.touchscreen feature is available.
+if (getPackageManager().hasSystemFeature("android.hardware.touchscreen")) {
+    Log.d("HardwareFeatureTest", "Device has a touch screen.");
+}
+</pre>
+
+
+<h4 id="no-touchscreen">タッチスクリーン</h4>
+
+<p>
+  TV には通常タッチスクリーンがないので、Android は TV 端末向けにはタッチスクリーン操作をサポートしていません。そもそも、タッチスクリーン操作は、ユーザーが 10 フィート離れた場所から視聴するという TV 特有の使用環境にそぐわないものです。
+</p>
+
+<p>
+  TV 端末ではリモコンの矢印ボタンによるナビゲーションをサポートして、TV 特有のインタラクション モデルに適したアプリをデザインする必要があります。TV 向けのコントロールを使用してナビゲーションを適切にサポートする方法については、<a href="{@docRoot}training/tv/start/navigation.html">TV 用のナビゲーションを作成する</a>を参照してください。
+</p>
+
+
+<h4 id="no-camera">カメラ</h4>
+
+<p>
+  TV にはカメラがないことが一般的ですが、カメラ関連アプリを提供することは可能です。たとえば、写真の撮影、表示、編集の機能があるアプリの場合、TV 向けに撮影機能を無効にながら、写真をの表示や編集は可能にすることができます。カメラ関連アプリをTV 向けにする場合、アプリのマニフェストには次の機能の宣言を追加します。
+</p>
+
+<pre>
+&lt;uses-feature android:name="android.hardware.camera" android:required="false" /&gt;
+</pre>
+
+<p>
+  カメラ機能を除いてアプリを動作させる場合、カメラ機能の存在を検出し、アプリの動作を調整するためのコードを追加します。次のコード例では、カメラ機能の存在を検出する方法を示します。
+</p>
+
+<pre>
+// Check if the camera hardware feature is available.
+if (getPackageManager().hasSystemFeature("android.hardware.camera")) {
+    Log.d("Camera test", "Camera available!");
+} else {
+    Log.d("Camera test", "No camera available. View and edit features only.");
+}
+</pre>
+
+
+<h4 id="no-gps">GPS</h4>
+
+<p>
+  TV は据え付けタイプの室内用端末であり、全地球測位システム(GPS)の受信機を内蔵していません。アプリが位置情報を使用している場合、TV 端末のセットアップ時に郵便番号などの静的なロケーション プロバイダを構成して、ユーザーが位置を調べたり、それらを使用できるようにすることが可能です。
+</p>
+
+<pre>
+// Request a static location from the location manager
+LocationManager locationManager = (LocationManager) this.getSystemService(
+        Context.LOCATION_SERVICE);
+Location location = locationManager.getLastKnownLocation("static");
+
+// Attempt to get postal or zip code from the static location object
+Geocoder geocoder = new Geocoder(this);
+Address address = null;
+try {
+  address = geocoder.getFromLocation(location.getLatitude(),
+          location.getLongitude(), 1).get(0);
+  Log.d("Zip code", address.getPostalCode());
+
+} catch (IOException e) {
+  Log.e(TAG, "Geocoder error", e);
+}
+</pre>
+
+
+<h2 id="controllers">コントローラを処理する</h2>
+
+<p>
+  TV 端末ではベーシックなタイプのリモコン、ゲーム機のコントローラといった、アプリを操作するための2 次ハードウェア端末が必要となります。これは、アプリで矢印ボタンによる入力をサポートする必要がある、ということです。そして、コントローラのオフライン操作と複数のタイプのコントローラによる入力を処理することも必要です。
+</p>
+
+
+<h3 id="d-pad-minimum">矢印ボタンによる最小限のコントロール</h3>
+
+<p>
+  TV 端末のデフォルト コントローラはリモコン端末の矢印ボタンです。すなわち、上下、左右、[選択]、[戻る]、[ホーム] ボタンのみを使用して、アプリを操作できるようにする必要があります。ゲーム アプリの場合、通常は追加のコントロール機能のあるゲーム機のコントローラが必要ですが、TV ではリモコン端末の矢印ボタンでプレイできるようにする必要があります。この場合、コントローラが必要な旨をユーザーに警告した上で、リモコン端末の矢印ボタンでゲームを終了できるようにする必要があります。TV のリモコン端末の矢印ボタンによるナビゲーションを処理する方法については、<a href="{@docRoot}training/tv/start/navigation.html">TV 用のナビゲーションを作成する</a>を参照してください。
+</p>
+
+
+<h3 id="controller-disconnects">コントローラの接続の切断を処理する</h3>
+
+<p>
+  TV 用コントローラは Bluetooth 端末であることが多く、定期的にスリープ モードに入って TV との接続を切断し、消費電力を節約しようとする場合があります。この場合、アプリ側で再接続イベントの処理を構成していないと、アプリが中断したり再起動する可能性が生じます。これらのイベントは、次のいずれかの場合に発生する可能性があります。
+</p>
+
+<ul>
+  <li>ビデオ(数分程度)を見ている間にリモコン端末かゲーム機のコントローラがスリープ モードになり、TV 端末との接続が失われ、その後再び接続される場合。
+  </li>
+  <li>ゲームプレイ中に、新しいプレイヤーがオフライン状態のゲーム機のコントローラを使用してゲームに参加した場合。
+  </li>
+  <li>ゲームプレイ中に、プレイヤーがゲームを中断し、ゲーム機のントローラとの接続が失われた場合。
+  </li>
+</ul>
+
+<p>
+  接続の切断や再接続の対象となる TV アプリのアクティビティはすべて、アプリのマニフェストで再接続イベントを処理できるように構成する必要があります。次のコード サンプルでは、キーボードやナビゲーション端末の接続、切断、再接続などを含む構成の変更を処理するアクティビティの記述方法を示します。
+</p>
+
+<pre>
+&lt;activity
+  android:name="com.example.android.TvActivity"
+  android:label="&#64;string/app_name"
+  <strong>android:configChanges="keyboard|keyboardHidden|navigation"</strong>
+  android:theme="&#64;style/Theme.Leanback"&gt;
+
+  &lt;intent-filter&gt;
+    &lt;action android:name="android.intent.action.MAIN" /&gt;
+    &lt;category android:name="android.intent.category.LEANBACK_LAUNCHER" /&gt;
+  &lt;/intent-filter&gt;
+  ...
+&lt;/activity&gt;
+</pre>
+
+<p>
+  この構成の変更により、Android のフレームワークによる再起動(ユーザー エクスペリエンスの観点から望ましくない)ではなく、再接続イベントを介してアプリの中断を回避することが可能です。
+</p>
+
+
+<h3 id="d-pad-variants">矢印ボタンによる入力のバリエーションを処理する</h3>
+
+<p>
+  TV 端末のユーザーは、複数のタイプのコントローラを使用して TV を操作する場合があります。たとえば、ベーシックなタイプのリモコンとゲーム機のコントローラを使用している場合があります。TV リモコンの矢印ボタンの機能をゲーム機のコントローラで実行する場合、送信されるキーコードはリモコン本体が送信するキーコードとは異なる場合があります。
+</p>
+
+<p>
+  ユーザーがアプリ操作のためにコントローラとリモコンを持ち替える必要がないよう、アプリでは、ゲーム機のコントローラからの矢印ボタンによる入力のバリエーションを処理する必要があります。入力のバリエーションの処理については、<a href="{@docRoot}training/game-controllers/controller-input.html#dpad">コントローラのアクションを処理する</a>を参照してください。
+</p>
diff --git a/docs/html-intl/intl/ja/training/tv/start/index.jd b/docs/html-intl/intl/ja/training/tv/start/index.jd
new file mode 100755
index 0000000..8f946a1
--- /dev/null
+++ b/docs/html-intl/intl/ja/training/tv/start/index.jd
@@ -0,0 +1,45 @@
+page.title=TV アプリのビルド
+page.tags=tv, leanback
+startpage=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>依存関係と前提条件</h2>
+  <ul>
+    <li>Android 5.0(API レベル 21)以降</li>
+    <li>Android Studio 0.8 以降、Gradle 0.12 以降</li>
+  </ul>
+</div>
+</div>
+
+<p>
+  Android は、ハイビジョン TV などの大画面の端末で使用するアプリ向けに最適化された、表現力豊かなユーザー エクスペリエンスを実現します。TV で使用できるアプリによって、ユーザーは自宅のソファでくつろぎながらさまざまな操作を行えるようになります。
+</p>
+
+<p>
+  TV アプリでは、携帯電話やタブレット向けのものと同じ構造を使用します。つまり、Android アプリのビルドに関する既知の技術を使用して新たな TV アプリを作成したり、既存のアプリを TV 端末でも使用できるように拡張したりできます。ただし、TV ユーザーのインタラクション モデルは、携帯電話やタブレット端末とは大きく異なっています。TV 端末向けアプリがユーザーに受け入れられるには、10 フィート離れた場所からでも容易に識別できる新しいレイアウト デザインや、リモコンの矢印ボタンや選択ボタンだけで操作できるナビゲーションが必要です。
+</p>
+
+<p>
+  このクラスでは、開発環境のセットアップやレイアウトとナビゲーションに関する基本的な要件、TV 端末では通常使用できないハードウェア機能の処理方法に関するガイダンスなど、TV 向けアプリのビルドを開始する方法を説明します。
+</p>
+
+<p class="note">
+  <strong>注意:</strong>TV アプリのビルドには、プロジェクトのセットアップ、ライブラリ インクルード、パッケージングの簡便性を備えた <a href="{@docRoot}sdk/installing/studio.html">Android Studio</a>の使用を推奨します。このトレーニングでは、Android Studio の使用を前提にしています。
+</p>
+
+
+<h2>レッスン</h2>
+
+<dl>
+  <dt><a href="{@docRoot}training/tv/start/start.html">TV アプリのビルドを開始する</a></dt>
+    <dd>TV アプリ用に Android Studio プロジェクトを新規作成したり、TV 端末で使用できるように既存アプリのプロジェクトを編集したりする方法を説明します。</dd>
+  <dt><a href="{@docRoot}training/tv/start/layouts.html">TV 用のレイアウトをビルドする</a></dt>
+    <dd>TV 用のレイアウトに最低限必要な要件と、それらを実装する方法を説明します。</dd>
+  <dt><a href="{@docRoot}training/tv/start/navigation.html"> TV 用のナビゲーションを作成する</a></dt>
+    <dd>TV 用のナビゲーションに必要な要件と、TV と互換性のあるナビゲーションを実装する方法を説明します。</dd>
+  <dt><a href="{@docRoot}training/tv/start/hardware.html"> TV ハードウェアを処理する</a></dt>
+    <dd>作成したアプリの TV ハードウェアでの動作を確認したり、サポートされていないハードウェア機能を処理したり、コントローラ端末を管理したりする方法を説明します。</dd>
+</dl>
diff --git a/docs/html-intl/intl/ja/training/tv/start/layouts.jd b/docs/html-intl/intl/ja/training/tv/start/layouts.jd
new file mode 100755
index 0000000..85193bf
--- /dev/null
+++ b/docs/html-intl/intl/ja/training/tv/start/layouts.jd
@@ -0,0 +1,190 @@
+page.title=TV 向けレイアウトをビルドする
+page.tags=tv
+trainingnavtop=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>学習の目的</h2>
+  <ol>
+    <li><a href="#themes">TV 向けのレイアウト テーマを使用する</a></li>
+    <li><a href="#structure">基本的な TV レイアウトをビルドする</a></li>
+    <li><a href="#visibility">使用可能なテキストとコントロールをビルドする</a></li>
+    <li><a href="#density-resources">TV のレイアウト リソースを管理する</a></li>
+    <li><a href="#anti-patterns">レイアウトのアンチパターンを回避する</a></li>
+    <li><a href="#large-bitmaps">大容量のビットマップを処理する</a></li>
+  </ol>
+  <h2>関連コンテンツ</h2>
+  <ol>
+    <li><a href="{@docRoot}design/tv/index.html">Android の TV 向けデザイン</a></li>
+  </ol>
+</div>
+</div>
+
+<p>
+  TV スクリーンは 10 フィートほど離れて見ることが通常であり、他の Android 端末のディスプレイよりもはるかに大きいことが多く、小型の端末と同レベルの精度と色を再現できません。便利で楽しいユーザー エクスペリエンスを作成する上で、これらの要素を配慮して TV 端末向けアプリのレイアウトを作成する必要があります。
+</p>
+
+<p>
+  このレッスンでは、TV アプリ用の効果的なレイアウトをビルドするための最低限の要件と実装の詳細を説明します。
+</p>
+
+<h2 id="themes">TV 向けのレイアウト テーマを使用する</h2>
+
+<p>
+  Android の<a href="{@docRoot}guide/topics/ui/themes.html">テーマ</a>は、TV アプリのレイアウトの基礎を提供しています。TV 端末上で動作するよう設計されたアプリのアクティビティに関しては、テーマを使用して表示を変更する必要があります。このセクションでは、どのテーマを使用したらよいかについて説明します。
+</p>
+
+<h3 id="leanback-theme">Leanback テーマ</h3>
+
+<p>
+  TV ユーザー インターフェースのサポート ライブラリである <a href="{@docRoot}tools/support-library/features.html#v17-leanback">v17 leanback ライブラリ</a> は、{@code Theme.Leanback} という TV アクティビティに関する標準的なテーマを提供しています。このテーマは、TV アプリに一貫性のある視覚的なスタイルを与えます。ほとんどの TV アプリにはこのテーマをお勧めします。このテーマは v17 leanback クラスを使用するすべての TV アプリに最適です。次のコード例では、アプリ内にあるアクティビティにこのテーマを適用する方法を示します。
+</p>
+
+<pre>
+&lt;activity
+  android:name="com.example.android.TvActivity"
+  android:label="&#64;string/app_name"
+  <strong>android:theme="&#64;style/Theme.Leanback"</strong>&gt;
+</pre>
+
+
+<h3 id="notitle-theme">NoTitleBar テーマ</h3>
+
+<p>
+  タイトル バーは、携帯電話やタブレットの Android アプリにとっては標準的なユーザー インターフェース エレメントですが、TV アプリには適していません。v17 leanback クラスを使用していない場合は、TV アクティビティにこのテーマを適用してタイトル バーの表示を控える必要があります。TV アプリのマニフェストに関する次のコード例では、このテーマを適用してタイトル バーの表示を削除する方法を示します。
+</p>
+
+<pre>
+&lt;application&gt;
+  ...
+
+  &lt;activity
+    android:name="com.example.android.TvActivity"
+    android:label="&#64;string/app_name"
+    <strong>android:theme="&#64;android:style/Theme.NoTitleBar"</strong>&gt;
+    ...
+
+  &lt;/activity&gt;
+&lt;/application&gt;
+</pre>
+
+
+<h2 id="structure">基本的な TV レイアウトをビルドする</h2>
+
+<p>TV 端末用のレイアウトが、大きなスクリーンでも使いやすく効果的になるように、参考となるガイドラインがいくつかあります。次のヒントに従って、TV スクリーン用に最適化された横長のレイアウトをビルドします。
+</p>
+
+<ul>
+  <li>横向きでレイアウトをビルドします。TV スクリーンは常に横表示になります。</li>
+  <li>スクリーンの左か右にナビゲーション コントロールを配置して、垂直方向にコンテンツ用のスペースを確保します。</li>
+  <li><a href="{@docRoot}guide/components/fragments.html">フラグメント</a>を使用してセクションごとに分割された UI を作成し、水平方向のスペースをより有効に活用するために、{@link android.widget.GridView} のようなビュー グループを {@link android.widget.ListView} の代わりに使用します。
+  </li>
+  <li>ビューの配置には、{@link android.widget.RelativeLayout} や {@link android.widget.LinearLayout} のようなビュー グループを使用します。これにより、システムで TV 画面のビューの位置を一定のサイズ、アラインメント、アスペクト比、画素密度に調整することができるようになります。</li>
+  <li>レイアウト コントロール間には十分なマージンを取り、UI が見やすくなるようにします。</li>
+</ul>
+
+
+<h3 id="overscan">オーバースキャン</h3>
+
+<p>TV 向けのレイアウトには、TV 規格の進化と、常に視聴者にフルスクリーン表示を提供したいという開発者側の意図に伴い、いくつかの特殊な要件があります。このため、TV 端末ではフルスクリーン表示の際にディスプレイ全体を埋められるように、アプリのレイアウト周囲がクリッピングされる場合があります。この動作を、一般に<em>オーバースキャン</em>と呼びます。
+</p>
+
+<p>
+  レイアウト周囲には 10%のマージンを与え、スクリーン エレメントがオーバースキャンによりクリッピングされないようにします。具体的には、アクティビティのベース レイアウトの左右には 27dp、上下には 48dp のマージンを設定します。次のレイアウト例では、TV アプリのルート レイアウト内でこれらのマージンを設定する方法を示します。
+</p>
+
+<pre>
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+  android:id="@+id/base_layout"
+  android:layout_width="match_parent"
+  android:layout_height="match_parent"
+  android:orientation="vertical"
+  android:layout_marginTop="27dp"
+  android:layout_marginLeft="48dp"
+  android:layout_marginRight="48dp"
+  android:layout_marginBottom="27dp" &gt;
+&lt;/LinearLayout&gt;
+</pre>
+
+<p class="caution">
+  <strong>警告:</strong>{@link android.support.v17.leanback.app.BrowseFragment} や関連ウィジェットなどの v17 leanback クラスを使用している場合、レイアウトには既にオーバースキャン用のマージンが設定されているため、重複して設定しないようにします。
+</p>
+
+<h2 id="visibility">使用可能なテキストとコントロールをビルドする</h2>
+
+<p>
+  TV アプリのレイアウト内のテキストやコントロールは、遠くからでも見やすく、操作内容を理解できるようにする必要があります。次のヒントに従って、遠くから見ても簡単に判別可能なユーザー インターフェース エレメントを作成します。
+</p>
+
+<ul>
+  <li>ユーザーが一目でわかる小さな単位にテキストを分割します。</li>
+  <li>暗い背景に対して明るい色のテキストを使用します。これにより、TV スクリーン上のテキストが読みやすくなります。</li>
+  <li>細いフォントや、狭すぎたり広すぎたりするストロークのフォントを使用しないようにします。シンプルなサンセリフ フォントやアンチ エイリアスを使用して、より読みやすくします。</li>
+  <li>次の Android の標準フォント サイズを使用します。 <pre>
+&lt;TextView
+      android:id="@+id/atext"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:gravity="center_vertical"
+      android:singleLine="true"
+      <strong>android:textAppearance="?android:attr/textAppearanceMedium"/&gt;</strong>
+</pre>
+  </li>
+  <li>すべてのビュー ウィジェットが、スクリーン位置から 10 フィート(スクリーンが大きくなると、この距離は長くなります)離れていてもはっきりと見えるように十分な大きさを確保します。これには、絶対的なサイズではなく相対レイアウトによるサイジングを、絶対的なピクセル単位ではなく密度に依存しないピクセル(dip)単位を使用します。たとえば、ウィジェットの幅を設定するには画素測定ではなく {@code wrap_content} を、ウィジェットのマージンを設定するにはピクセル値ではなくディップ値を使用します。</li>
+</ul>
+
+<p>
+  密度に依存しないピクセルと、スクリーン サイズが大きな場合のレイアウトのビルドについては、<a href="{@docRoot}guide/practices/screens_support.html">複数のスクリーンをサポートする</a>を参照してください。
+</p>
+
+<h2 id="density-resources">TV のレイアウト リソースを管理する</h2>
+
+<p>一般的なハイビジョン TV ディスプレイの解像度は 720p、1080i、1080p です。TV のレイアウトが 1920×1080 ピクセルのスクリーン サイズになるようにして、Android のシステムが必要に応じてアプリのレイアウト エレメントを 720p にダウンスケールできるようにします。通常は、ダウンスケーリング(ピクセル削除)してもレイアウトのプレゼンテーション品質が低下することはありません。ただし、アップスケーリングはレイアウトの品質を劣化させ、アプリのユーザー エクスペリエンスに悪影響を与えるアーチファクトを引き起こす可能性があります。</p>
+
+<p>
+  画像を最適な状態にスケーリングするには、可能であれば <a href="{@docRoot}tools/help/draw9patch.html">9patch 画像</a>のエレメントとして配置します。レイアウト内に低品質な画像や小さな画像を配置した場合、ピクセル化され、ぼやけた、粗い表示になり、ユーザー エクスペリエンスの低下につながります。それを避けるには、高品質の画像を使用します。
+</p>
+
+<p>
+  大きなスクリーン向けのレイアウトやリソースの最適化については、<a href="{@docRoot}training/multiscreen/index.html">複数のスクリーンをデザインする</a>を参照してください。
+</p>
+
+
+<h2 id="anti-patterns">レイアウトのアンチパターンを回避する</h2>
+
+<p>
+  TV 端末には不向きでユーザー エクスペリエンスの低下につながるため、レイアウトのビルドに際して避けたほうがよいアプローチがいくつかあります。ここでは、TV のレイアウト開発の際に特に使用し<em>ない</em>ほうがよい、ユーザー インターフェースに関するアプローチをいくつか説明します。
+</p>
+
+<ul>
+  <li><strong>携帯電話やタブレットのレイアウトの再利用</strong> 携帯電話やタブレット向けアプリのレイアウトをそのまま再利用しないようにします。他の Android 端末のフォーム ファクタ向けにビルドされたレイアウトは、TV 端末には不向きであり、TV 操作向けに簡略化する必要があります。</li>
+  <li><strong>ActionBar</strong> - このユーザー インターフェース規則は、携帯電話やタブレットでの使用は推奨できますが、TV のインターフェースには適していません。具体的には、TV リモコンではアクション バーのオプション メニュー(その他類似機能のプルダウン メニュー)をナビゲートすることが難しいため、使用しないことをお勧めします。</li>
+  <li><strong>ViewPager</strong> - スクリーン間のスライド操作は携帯電話やタブレット上では非常に有効ですが、TV では推奨できません。</li>
+</ul>
+
+<p>TV に適したレイアウトのデザインについては、<a href="{@docRoot}design/tv/index.html">TV 向けデザイン</a>ガイドを参照してください。</p>
+
+
+<h2 id="large-bitmaps">大容量のビットマップを処理する</h2>
+
+<p>他の Android 端末と同様に、TV 端末ではメモリ容量が限られています。超高解像度の画像を使用してアプリのレイアウトをビルドしたり、アプリの動作に多くの高解像度の画像を使用した場合、すぐにメモリの上限に達し、メモリ不足エラーが発生する可能性があります。次のヒントに従って、このタイプの問題を回避します。</p>
+
+<ul>
+  <li>スクリーン上に表示された場合にのみ画像をロードします。たとえば、{@link android.widget.GridView} や {@link android.widget.Gallery} で複数の画像を表示する場合、 {@link android.widget.Adapter#getView getView()} がビューの {@link android.widget.Adapter} で呼び出されたときのみ画像をロードします。
+  </li>
+  <li>{@link android.graphics.Bitmap#recycle()} を、不要になった {@link android.graphics.Bitmap} ビューで呼び出します。
+  </li>
+  <li> {@link java.lang.ref.WeakReference} を使用して、{@link android.graphics.Bitmap} オブジェクト(メモリ内の {@link java.util.Collection} にある)への参照を格納します。
+  </li>
+  <li>ネットワークから画像を取得する場合は{@link android.os.AsyncTask} を使用して取得し、端末に格納すると、アクセスを高速化できます。アプリのメイン ユーザー インターフェースのスレッドで、ネットワーク トランザクションを実行しないでください。
+  </li>
+  <li>ダウンロードの際は大きな画像をより適切なサイズにスケールダウンしてください。スケールダウンしない場合、メモリ不足により障害が発生する可能性があります。
+  </li>
+</ul>
+
+<p>
+  画像処理の際に最高のパフォーマンスを得るには、<a href="{@docRoot}training/displaying-bitmaps/index.html">ビットマップを効率的に表示する</a>を参照してください。
+</p>
diff --git a/docs/html-intl/intl/ja/training/tv/start/navigation.jd b/docs/html-intl/intl/ja/training/tv/start/navigation.jd
new file mode 100755
index 0000000..e118702
--- /dev/null
+++ b/docs/html-intl/intl/ja/training/tv/start/navigation.jd
@@ -0,0 +1,144 @@
+page.title=TV 用のナビゲーションを作成する
+page.tags=tv, d-pad, focus
+trainingnavtop=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>学習の目的</h2>
+  <ol>
+    <li><a href="#d-pad-navigation">矢印ボタンによるナビゲーションを有効にする</a></li>
+    <li><a href="#focus-selection">明確なフォーカスと選択を可能にする</a></li>
+  </ol>
+
+</div>
+</div>
+
+<p>
+  TV 端末では、アプリのナビゲーション コントロールが限定されています。TV アプリ向けの効率的なナビゲーション スキームを作成できるかどうかは、これらの限定されたナビゲーション コントロールと、アプリを使用するユーザー側の認識の限界についての理解にかかっています。TV 向け Android アプリをビルドする際には、ユーザーがタッチ スクリーンではなく TV のリモコン ボタンを使用して実際にどのようにアプリをナビゲートするかについて、よく考慮する必要があります。
+</p>
+
+<p>
+  このレッスンでは、効率的な TV アプリのナビゲーション スキームを作成するための最小要件と、アプリにそれらの要件を適用する方法を説明します。
+</p>
+
+
+<h2 id="d-pad-navigation">矢印ボタンによるナビゲーションを有効にする</h2>
+
+<p>
+  TV 端末では、ユーザーはリモコン端末の矢印ボタンを使用して、ナビゲーション操作を行います。この操作では、上、下、左、右方向への移動のみが可能です。TV 向けにこの上なく最適化されたアプリをビルドするには、このような限られたコントロールのみを使用して、ユーザーがアプリのナビゲーション方法を簡単に習得できるナビゲーション スキームを提供する必要があります。
+</p>
+
+<p>
+  Android のフレームワークでは、レイアウト エレメント間のナビゲーションを自動的に処理するため、通常は特に何もする必要はありません。ただし、ナビゲーション上の不備がないか、実際のリモコンの矢印ボタンで十分にテストする必要があります。次のガイドラインに従って、アプリのナビゲーション システムが、TV 端末のリモコンの矢印ボタンを使用した場合に正しく動作するかどうかをテストします。
+</p>
+
+<ul>
+  <li>ユーザーがリモコンの矢印ボタンを使って、スクリーン上のすべてのコントロールに移動できるか。
+  </li>
+  <li>フォーカスを使用してリストをスクロールする際、リモコンの上下ボタンでリストをスクロールし、[選択] キーでリスト内の項目を選択できるか。ユーザーがリスト内のエレメントを選択でき、選択後もリストがスクロールするか。
+  </li>
+  <li>コントロール間の切り替え操作がわかりやすく、予測可能であるか。
+  </li>
+</ul>
+
+
+<h3 id="modify-d-pad-nav">矢印ボタンによるナビゲーションを編集する</h3>
+
+<p>
+  Android のフレームワークでは、レイアウト内にあるフォーカス可能なエレメントの相対位置に基づいて、矢印ボタンによるナビゲーション スキームを自動的に適用します。TV 端末のリモコンの矢印ボタンを使用して、アプリ内に生成されたナビゲーション スキームをテストする必要があります。テスト後に、ある特定の方法でユーザーがレイアウト内を移動できるようにしたい場合には、コントロールに関する矢印ボタンによるナビゲーションを明示的にセットアップできます。
+</p>
+
+<p class="note">
+  <strong>注意:</strong>システムが適用したデフォルトの順序がうまく動作しない場合にのみ、これらの属性を使用してナビゲーション順序を変更します。
+</p>
+
+<p>
+  次のコード サンプルでは、{@link android.widget.TextView} レイアウト オブジェクトで隣のコントロールがフォーカスを受け取るよう定義する方法を示します。
+</p>
+
+<pre>
+&lt;TextView android:id="&#64;+id/Category1"
+        android:nextFocusDown="&#64;+id/Category2"\&gt;
+</pre>
+
+<p>
+  次の表では、Android ユーザー インターフェース ウィジェットで使用可能なナビゲーションの属性一覧を示します。
+</p>
+
+<table>
+  <tr>
+    <th>属性</th>
+    <th>機能</th>
+  </tr>
+  <tr>
+    <td>{@link android.R.attr#nextFocusDown}</td>
+    <td>ユーザーが下に移動したときにフォーカスを受け取る隣のビューを定義します。</td>
+  </tr>
+  <tr>
+    <td>{@link android.R.attr#nextFocusLeft}</td>
+    <td>ユーザーが左に移動したときにフォーカスを受け取る隣のビューを定義します。</td>
+  </tr>
+  <tr>
+    <td>{@link android.R.attr#nextFocusRight}</td>
+    <td>ユーザーが右に移動したときにフォーカスを受け取る隣のビューを定義します。</td>
+  </tr>
+  <tr>
+    <td>{@link android.R.attr#nextFocusUp}</td>
+    <td>ユーザーが上に移動したときにフォーカスを受け取る隣のビューを定義します。</td>
+  </tr>
+</table>
+
+<p>
+  これらの明示的なナビゲーション属性のいずれかを使用するには、レイアウト内の別のウィジェットの ID ({@code android:id} 値)に対する値を設定します。最後のコントロールが最初のコントロールにフォーカスを戻すようにするには、ナビゲーションの順序をループとしてセットアップする必要があります。
+</p>
+
+
+
+<h2 id="focus-selection">明確なフォーカスと選択を可能にする</h2>
+
+<p>
+  TV 端末でアプリのナビゲーション スキームにとって重要なのは、スクリーン上のどのユーザー インターフェース エレメントにフォーカスがあるのかを、ユーザーが簡単に判別できるようにすることです。フォーカス状態のアイテムが明確でないと、ユーザーはどのアイテムに対してアクションが可能か判別できず、ストレスを感じてアプリを終了してしまうことになります。同じ理由で、アプリが起動直後やアイドル状態にある場合でも、ユーザーのアクションが可能なフォーカス状態のアイテムを常に配置しておく必要があります。
+</p>
+
+<p>
+  アプリのレイアウトと実装においては、色、サイズ、アニメーションや、これらの属性の組み合わせを使用して、ユーザーが次に可能なアクションを簡単に判別できるようにする必要があります。アプリ内では、一貫したスキームを使用してフォーカス状態を示すようにしてください。
+</p>
+
+<p>
+  Android は<a href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">ドローアブルとしての状態リスト リソース</a>を提供しており、フォーカス状態の、そして選択済みのコントロールにハイライトを実装できます。次のコード例では、ボタンの視覚的な動作を有効にして、ユーザーがそのコントロールにナビゲートし、選択したことを表示する方法を示します。
+</p>
+
+<pre>
+&lt;!-- res/drawable/button.xml --&gt;
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
+    &lt;item android:state_pressed="true"
+          android:drawable="@drawable/button_pressed" /&gt; &lt;!-- pressed --&gt;
+    &lt;item android:state_focused="true"
+          android:drawable="@drawable/button_focused" /&gt; &lt;!-- focused --&gt;
+    &lt;item android:state_hovered="true"
+          android:drawable="@drawable/button_focused" /&gt; &lt;!-- hovered --&gt;
+    &lt;item android:drawable="@drawable/button_normal" /&gt; &lt;!-- default --&gt;
+&lt;/selector&gt;
+</pre>
+
+<p>
+  次のレイアウトの XML サンプル コードは、{@link android.widget.Button} に対する 1 つ前の状態リスト ドローアブルにも該当します。
+</p>
+
+<pre>
+&lt;Button
+    android:layout_height="wrap_content"
+    android:layout_width="wrap_content"
+    android:background="@drawable/button" /&gt;
+</pre>
+
+<p>
+  周囲のハイライトがはっきりと見えるように、フォーカス可能で選択可能なコントロール内には十分なパディングを残してください。
+</p>
+
+<p>
+  TV アプリでの効率的な選択とフォーカスの設計に関する推奨事項については、<a href="{@docRoot}design/tv/patterns.html">TV のパターン</a>を参照してください。
+</p>
diff --git a/docs/html-intl/intl/ja/training/tv/start/start.jd b/docs/html-intl/intl/ja/training/tv/start/start.jd
new file mode 100755
index 0000000..bc99ff9
--- /dev/null
+++ b/docs/html-intl/intl/ja/training/tv/start/start.jd
@@ -0,0 +1,232 @@
+page.title=TV アプリのビルドを開始する
+page.tags=tv, leanback, recyclerview
+
+trainingnavtop=true
+startpage=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>学習の目的</h2>
+  <ol>
+    <li><a href="#dev-project">TV プロジェクトをセットアップする</a></li>
+    <li><a href="#tv-libraries">TV サポート ライブラリを追加する</a></li>
+    <li><a href="#build-it">TV アプリをビルドする</a></li>
+    <li><a href="#run">TV アプリを実行する</a></li>
+  </ol>
+  <h2>関連コンテンツ</h2>
+  <ol>
+    <li><a href="{@docRoot}design/tv/index.html">TV 向けデザイン</a></li>
+    <li><a href="{@docRoot}training/tv/start/layouts.html">TV 用のレイアウトをビルドする</a></li>
+  </ol>
+</div>
+</div>
+
+<p>
+  TV アプリでは、携帯電話やタブレット向けのものと同じ構造を使用します。つまり、Android アプリのビルドに関する既知の技術を使用して新たな TV アプリを作成したり、既存のアプリを TV 端末でも使用できるように編集したりできます。
+</p>
+
+<p class="note">
+  <strong>重要:</strong>Google Play で Android TV アプリを提供するには、特定の要件を満たす必要があります。詳細については、<a href="{@docRoot}distribute/essentials/quality/tv.html">TV アプリの品質</a>に記載されている要件を参照してください。
+</p>
+
+<p>
+  このレッスンでは、TV アプリのビルドの際の開発環境の準備方法と、TV 端末上でアプリを使用できるようにするために最低限必要な変更について説明します。
+</p>
+
+
+<h2 id="dev-project">TV プロジェクトをセットアップする</h2>
+
+<p>
+  このセクションでは、TV 端末向けに既存のアプリを変更したり、新しく作成する方法について説明します。TV 端末向けアプリを作成する際に使用する必要がある主なコンポーネントは次のとおりです。
+</p>
+
+<ul>
+  <li><strong>TV 用のアクティビティ</strong>(必須) - アプリのマニフェストで、TV 端末上で動作させるアクティビティを宣言します。</li>
+  <li><strong>TV サポート ライブラリ</strong>(任意) - ユーザー インターフェースのビルド用にウィジェットを提供する、TV 端末向けの<a href="#tv-libraries">サポート ライブラリ</a>をいくつか利用できます。</li>
+</ul>
+
+
+<h3 id="prerequisites">前提条件</h3>
+
+<p>TV 向けアプリのビルドを開始するには:</p>
+
+<ul>
+  <li><strong><a href="{@docRoot}sdk/installing/adding-packages.html#GetTools">SDK ツールをバージョン 24.0.0 以降にアップデートする</a></strong>
+    <br/> SDK ツールをアップデートすると、TV 向けアプリのビルドとテストができるようになります。
+  </li>
+  <li><strong><a href="{@docRoot}sdk/installing/adding-packages.html#GetTools">SDK ツールを Android 5.0(API レベル 21)以降を使用してアップデートする</a></strong>
+    <br/> アップデート後のプラットフォームのバージョンでは、TV アプリ向けの新しい API を提供しています。
+  </li>
+  <li><strong><a href="{@docRoot}sdk/installing/create-project.html">アプリのプロジェクトを作成またはアップデートする</a></strong>
+    <br/> TV 端末用の新しい API にアクセスするには、プロジェクトを作成するか、Android 5.0(API レベル 21)以降をターゲットとする既存のプロジェクトを変更する必要があります。
+  </li>
+</ul>
+
+
+<h3 id="tv-activity">TV アクティビティを宣言する</h3>
+
+<p>TV 端末向けアプリでは、{@link android.content.Intent#CATEGORY_LEANBACK_LAUNCHER} のインテント フィルタを使用して、アプリのマニフェストで TV 用ランチャーのアクティビティを宣言する必要があります。このフィルタは、アプリが TV 向けになっていることを判別しますので、Google Play 内で TV アプリと認識される上で必要です。この宣言は、ユーザーが TV のホーム スクリーンでアプリのアイコンを選択したときに、アプリ内のどのアクティビティが起動するかについても判別します。</p>
+
+<p>次のコード スニペットでは、マニフェストにインテント フィルタを含める方法を示します。</p>
+
+<pre>
+&lt;application
+  android:banner="&#64;drawable/banner" &gt;
+  ...
+  &lt;activity
+    android:name="com.example.android.MainActivity"
+    android:label="@string/app_name" &gt;
+
+    &lt;intent-filter&gt;
+      &lt;action android:name="android.intent.action.MAIN" /&gt;
+      &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
+    &lt;/intent-filter&gt;
+  &lt;/activity&gt;
+
+  &lt;activity
+    android:name="com.example.android.<strong>TvActivity</strong>"
+    android:label="&#64;string/app_name"
+    android:theme="&#64;style/Theme.Leanback"&gt;
+
+    &lt;intent-filter&gt;
+      &lt;action android:name="android.intent.action.MAIN" /&gt;
+      &lt;category android:name="<strong>android.intent.category.LEANBACK_LAUNCHER</strong>" /&gt;
+    &lt;/intent-filter&gt;
+
+  &lt;/activity&gt;
+&lt;/application&gt;
+</pre>
+
+<p>
+  この例では、2 番目のアクティビティのマニフェスト エントリが、TV 端末で起動するアクティビティを指定しています。
+</p>
+
+<p class="caution">
+  <strong>警告:</strong>アプリに {@link android.content.Intent#CATEGORY_LEANBACK_LAUNCHER} インテント フィルタを含めない場合、TV 端末で Google Play ストアを開いているユーザーにアプリが表示されません。開発者ツールを使用して TV 端末にロードする際にこのフィルタがない場合も、TV のユーザー にはアプリインターフェースが表示されません。
+</p>
+
+<p>
+  TV 向け用途で既存のアプリを変更する場合は、携帯電話やタブレットと同じアクティビティのレイアウトを使用しないでください。TV アプリや既存のアプリの TV 向け部分については、ソファでくつろぎながら TV リモコンを使用して、簡単にナビゲートできるシンプルなユーザー インターフェースを提供する必要があります。TV 向けアプリをデザインする際のガイドラインについては、<a href="{@docRoot}design/tv/index.html">TV 向けデザイン</a>ガイドを参照してください。TV のインターフェースのレイアウトに関する最低限の実装要件については<a href="{@docRoot}training/tv/start/layouts.html">TV 用のレイアウトをビルドする</a>を参照してください。
+</p>
+
+
+<h3 id="no-touchscreen">タッチスクリーンの不要を宣言する</h3>
+
+<p>
+  TV 端末向けアプリでは、入力はタッチスクリーンに依存しません 。これを明確にするために、TV アプリのマニフェストで {@code android.hardware.touchscreen} 機能が不要であることを宣言する必要があります。この設定により、アプリが TV 端末向けであると判別しますので、Google Play 内で TV アプリと認識される上で必要です。次のコード例では、マニフェストに宣言を含める方法を示します。
+</p>
+
+<pre>
+&lt;manifest&gt;
+    <strong>&lt;uses-feature android:name="android.hardware.touchscreen"
+              android:required="false" /&gt;</strong>
+    ...
+&lt;/manifest&gt;
+</pre>
+
+<p class="caution">
+  <strong>警告:</strong>このコード例のようにアプリのマニフェストでタッチスクリーンが不要であると宣言しないと、アプリが TV 端末の Google Play ストアに表示されません。
+</p>
+
+<h3 id="banner">ホーム スクリーンにバナーを配置する</h3>
+
+<p>
+  アプリに Leanback ランチャーのインテント フィルタが含まれている場合は、ホーム スクリーンにバナーを配置する必要があります。バナーは、アプリやゲームの行のホーム スクリーン上に表示されるアプリの起動ポイントです。次のようにマニフェストにバナーを記述します。
+</p>
+
+<pre>
+&lt;application
+    ...
+    android:banner="&#64;drawable/banner" &gt;
+
+    ...
+&lt;/application&gt;
+</pre>
+
+<p>
+  <a href="{@docRoot}guide/topics/manifest/application-element.html#banner">{@code android:banner}</a> 属性を使用して、<a href="{@docRoot}guide/topics/manifest/application.html"><code>&lt;application&gt;</code></a> タグとともにアプリのすべてのアクティビティにデフォルトのバナーを配置するか、<a href="{@docRoot}guide/topics/manifest/activity-element.html"><code>&lt;activity&gt;</code></a> タグとともに特定のアクティビティにバナーを配置します。
+</p>
+
+<p>
+  TV 向けデザインの UI パターンガイドの<a href="{@docRoot}design/tv/patterns.html#banner">バナー</a>を参照してください。
+</p>
+
+<h2 id="tv-libraries">TV サポート ライブラリを追加する</h3>
+
+<p>
+  Android SDK には、TV アプリ向けのサポート ライブラリが用意されています。これらのライブラリでは、TV 端末向けに使用できる API とユーザー インターフェース ウィジェットを提供しています。同ライブラリは {@code &lt;sdk&gt;/extras/android/support/} ディレクトリにあります。ライブラリとその全般的な用途の一覧を次に示します。
+</p>
+
+<ul>
+  <li><a href="{@docRoot}tools/support-library/features.html#v17-leanback"> <strong>v17 leanback ライブラリ</strong></a> - 特にメディア再生用のアプリ向けに、TV アプリのユーザー インターフェース ウィジェットを提供します。
+  </li>
+  <li><a href="{@docRoot}tools/support-library/features.html#v7-recyclerview"> <strong>v7 recyclerview ライブラリ</strong></a> - メモリ効率に配慮した方法で、項目の多いリストの表示を管理するためのクラスを提供します。 v17 leanback ライブラリ内のクラスの一部は、このライブラリ内のクラスに依存します。
+  </li>
+  <li><a href="{@docRoot}tools/support-library/features.html#v7-cardview"> <strong>v7 cardview ライブラリ</strong></a> - メディア アイテムの画像や説明などの情報カードを表示するためのユーザー インターフェース ウィジェットを提供します。
+  </li>
+</ul>
+
+<p class="note">
+  <strong>注意:</strong>これらのサポート ライブラリは TV アプリに必須ではありませんが、特にメディア カタログのブラウジング インターフェースを提供するアプリについては使用することを強くお勧めします。
+</p>
+
+<p>
+  v17 leanback ライブラリを使用する場合、<a href="{@docRoot}tools/support-library/features.html#v4">v4 サポート ライブラリ</a> に依存していることに注意してください。つまり、leanback ライブラリを使用するアプリには、次のサポート ライブラリをすべて含める必要があります。
+</p>
+
+<ul>
+  <li>v4 サポート ライブラリ</li>
+  <li>v7 recyclerview サポート ライブラリ</li>
+  <li>v17 leanback サポート ライブラリ</li>
+</ul>
+
+<p>
+  v17 leanback ライブラリには、アプリのプロジェクトに含める際に、特定の手順を踏む必要があるリソースが含まれています。リソースを使用してサポート ライブラリをインポートする手順については、<a href="{@docRoot}tools/support-library/setup.html#libs-with-res">サポート ライブラリのセットアップ</a>を参照してください。
+</p>
+
+
+<h2 id="build-it">TV アプリをビルドする</h2>
+
+<p>上記の手順を完了したら、TV 向けアプリのビルドに取りかかりましょう。TV アプリのビルドに役立つ次の補足的なトピックに目を通してください。 <ul>
+  <li>
+    <a href="{@docRoot}training/tv/playback/index.html">TV 再生アプリのビルド</a> - TV は娯楽用途に特化されていますので、Android では、ユーザーがビデオや音楽を再生したり、必要なコンテンツをブラウズできたりする TV アプリのビルド向けに、ユーザー インターフェース ツールとウィジェット一式を提供しています。
+  </li>
+  <li>
+    <a href="{@docRoot}training/tv/search/index.html">TV でのコンテンツの露出</a> - ユーザーがすべてのコンテンツを見ながら、お目当てのコンテンツを探し出せるようにすることは、コンテンツ自体の提供と同程度に重要です。このトレーニングでは、TV 端末上にコンテンツを露出させる方法について説明します。
+  </li>
+  <li>
+    <a href="{@docRoot}training/tv/games/index.html">TV 向けゲーム</a> - TV 端末は、ゲームに非常に適したプラットフォームです。TV 向けの優れたゲーム エクスペリエンスのビルド方法については、このトピックを参照してください。
+  </li>
+</ul>
+
+
+<h2 id="run">TV アプリを実行する</h2>
+
+<p>
+  アプリの実行は、開発プロセスの重要な一部です。Android SDK の AVD Manager では端末定義を提供しており、アプリの実行やテスト用の仮想 TV 端末を作成することができます。
+</p>
+
+<p>仮想 TV 端末を作成するには:</p>
+
+<ol>
+  <li>AVD Manager を起動します。詳細については、<a href="{@docRoot}tools/help/avd-manager.html">AVD Manager</a> のヘルプを参照してください。</li>
+  <li>[AVD Manager] ダイアログで [<strong>端末定義</strong>] タブをクリックします。</li>
+  <li>Android の TV 端末定義を選択し、[<strong>AVD の作成</strong>] をクリックします。</li>
+  <li>エミュレータのオプションを選択して、[<strong>OK</strong>] をクリックして AVD を作成します。 <p class="note">
+      <strong>注意:</strong>TV 用のエミュレータ端末で最高のパフォーマンスを得るには、[<strong>ホスト GPU を使用</strong>] オプションを有効にし、サポートされている場合には、仮想端末のアクセラレーションを使用します。エミュレータのハードウェア アクセラレーションについては、<a href="{@docRoot}tools/devices/emulator.html#acceleration">エミュレータを使用する</a>を参照してください。
+    </p>
+  </li>
+</ol>
+
+<p>仮想 TV 端末上でアプリをテストするには:</p>
+
+<ol>
+  <li>自分の開発環境に TV アプリをコンパイルします。</li>
+  <li>自分の開発環境からアプリを実行し、ターゲットの TV 仮想端末を選択します。</li>
+</ol>
+
+<p>
+  エミュレータの使用方法については、<a href="{@docRoot}tools/devices/emulator.html">エミュレータを使用する</a>を参照してください。Android Studio から仮想端末へのアプリのデプロイについては、<a href="{@docRoot}sdk/installing/studio-debug.html">Android Studio を使用してデバッグする</a>を参照してください。ADT を使用した Eclipse からエミュレータへのアプリのデプロイについては、<a href="{@docRoot}tools/building/building-eclipse.html">Eclipse から ADT を使用してビルド、実行する</a>を参照してください。
+</p>
diff --git a/docs/html/design/tv/index.jd b/docs/html/design/tv/index.jd
index d79e279..def1286 100644
--- a/docs/html/design/tv/index.jd
+++ b/docs/html/design/tv/index.jd
@@ -38,7 +38,7 @@
 <p>To learn more about searching within your app, see
   <a href="{@docRoot}training/tv/discovery/in-app-search.html">Searching within TV Apps</a>.
 
-<h2>Recommendations</h2>
+<h2 id="recommendations">Recommendations</h2>
 
 <p>The recommendations row on Android TV is a central feature of the Home Screen that allows
   users quick access to dynamic and relevant content for their media-consumption activities. The
diff --git a/docs/html/design/tv/patterns.jd b/docs/html/design/tv/patterns.jd
index be7ae31..e786ee5 100644
--- a/docs/html/design/tv/patterns.jd
+++ b/docs/html/design/tv/patterns.jd
@@ -15,24 +15,16 @@
 
 <img src="{@docRoot}design/tv/images/focus.png" alt="TV navigation and focus diagram" />
 
-<p>A key aspect of making your application work well with a D-Pad controller is to make sure
+<p>A key aspect of making your application work well with a D-pad controller is to make sure
   that there is always an object that is obviously in focus. Your app must clearly indicate
   what object is focused, so users can easily see what action they can take. Use scale, shadow
   brightness, opacity, animation or a combination of these attributes to help users see a focused
   object.</p>
 
+<h2 id="banner">App and Game Banners</h3>
 
-<h2>Icons</h2>
-
-<p>Apps on TV devices require some additional icon images for presentation in the system
-  user interface, including home screen launcher images (banners) and recommendation icons.
-  The visual specifications for these icons are shown below.</p>
-
-
-<h3 id="banner">Banners</h3>
-
-<p>App Banners represent your app on the home screen of TV devices and serve and as a way for
-  users to launch your app. Here are specific requirements for a banner image:
+<p>App Banners represent your app or game on the home screens of TV devices and serve and as a way for
+  users to launch your app. Here are the specific requirements for a banner image:
 </p>
 
 <ul>
@@ -44,45 +36,97 @@
 <p>See <a href="{@docRoot}training/tv/start/start.html#banner">Provide a home screen banner</a>
 in Get Started with TV Apps for more information.</p>
 
-<h3>Recommendation Icons</h3>
+<h2 id="recommendation">Recommendations</h2>
 
-<p>Recommendation cards include a small icon that is imposed over a colored background.
-  An example and specifications for this icon are shown below:</p>
+<p>The first row of the Android TV home screen displays cards for content recommended by applications.
+Your application provides these recommendations, as described in <a href="{@docRoot}training/tv/discovery/recommendations.html">
+</a>. For a visual overview of recommendations, see <a href="design/tv/index.html#recommendations">
+Design for Android TV</a>.</p>
 
-<img src="{@docRoot}design/tv/images/icon.png" alt="Recommendation icon examples" />
+<div class="layout-content-row">
+  <div class="layout-content-col span-8 with-callouts">
 
-<p>Here are the requirements for recommendation icons:</p>
+  <p>The design elements of the recommendation card are as follows:</p>
+  <ol>
+  <li><strong>Large icon</strong></li>
+  <li><strong>Content title</strong></li>
+  <li><strong>Content text</strong></li>
+  <li><strong>Small icon</strong></li>
+  </ol>
+
+  <p>The design specifications for these elements are described below.</p>
+
+  <p>You can also set a background image (not shown) and the color of the card's text area in the
+  recommendation notification. See <a href="{@docRoot}training/tv/discovery/recommendations.html">
+  Recommendations</a> for more information.</p>
+
+  </div>
+  <div class="layout-content-col span-5">
+
+    <img src="{@docRoot}images/tv/recommend-card.png">
+
+  </div>
+</div>
+
+<h3>Background Image</h3>
+
+<p>The background image also appears behind the recommendations
+row and fills the Android TV home screen when the user selects the recommendation card. This image
+should be different than the one provided for the large icon, and meet the following specifications:</p>
 
 <ul>
-  <li>Monocolor: size 16x16dp, white (#fff) icon with transparent background, PNG format</li>
-  <li>Graphics should be centered within the icon image</li>
+  <li>Measure 2016 x 1134 pixels (1920 x 1080 plus 5% margin for for motion)</li>
+  <li id="solid-background">Must not be transparent</li>
 </ul>
 
 <p class="note">
-  <strong>Note:</strong> Your app icon image may be desaturated and blended for some card
-  displays.
+  <strong>Note:</strong> If the background image does not meet the size requirements, the system
+  scales it to fit.
 </p>
 
-
-<h2>Background Images</h2>
-
-<p>Background images are displayed in the background of your app to provide additional visual
-  interest, information, or branding. The user interface widgets provided in the <a href="{@docRoot}tools/support-library/features.html#v17-leanback">v17 leanback support
+<p>The user interface widgets provided in the
+  <a href="{@docRoot}tools/support-library/features.html#v17-leanback">v17 leanback support
   library</a> provide specific support for background images and for updating them as items gain
-  and lose focus. The specific requirements for background images on TV devices is that they
-  should be full color and a size of 1920 x 1080 pixels.
+  and lose focus.
 </p>
 
-<p class="note" id="solid-background">
-  <strong>Important:</strong> Background images must not be transparent. Your must not allow any
-  portion of another app to be seen through your app.
-</p>
+<h3 id="icons">Icons</h3>
+
+<h4>Large icon</h4>
+
+<p>Typically, the large icon is an image of the content for the recommendation. It appears
+above a colored area that contains the recommendation content title and text. This image should be
+different from that which you provide for the background image, and conform to the following
+specifications:</p>
+
+<ul>
+  <li>Height: 176dp or more</li>
+  <li>Minimum width: 2/3 of the height (117dp for an image 176dp in height)</li>
+  <li>Max width: 4/3 of the height (234dp for an image 176dp in height)</li>
+  <li>Must not be transparent</li>
+</ul>
 
 <p class="note">
-  <strong>Note:</strong> If you background image does not meet the size requirements, it is scaled
-  to fit.
+  <strong>Note:</strong> If the large icon does not meet the size requirements, the system
+  scales it to fit.
 </p>
 
+<h4>Small icon</h4>
+
+<p>Recommendation cards include a small icon that is imposed over a colored background. The icon and
+background color display at 100% opacity when the card is selected, and at 50% opacity when not
+selected.</p>
+
+<img src="{@docRoot}design/tv/images/icon.png" alt="Recommendation icon examples" />
+
+<p>Here are the requirements for recommendation small icons:</p>
+
+<ul>
+  <li>Flat image</li>
+  <li>Monocolor: size 16x16dp, white (#fff) icon with transparent background, PNG format</li>
+  <li>Graphics should be centered within the icon image</li>
+</ul>
+
 <h2>Audio Feedback</h2>
 
 <p>Sounds on Android TV bring a cinematic quality to the interaction experience. You should
diff --git a/docs/html/design/wear/watchfaces.jd b/docs/html/design/wear/watchfaces.jd
index 1a4b1f9..99dc3dd 100644
--- a/docs/html/design/wear/watchfaces.jd
+++ b/docs/html/design/wear/watchfaces.jd
@@ -112,17 +112,17 @@
 in ambient mode, it will look even better in interactive mode. The opposite is not always
 true.</p>
 
-<p>In ambient mode, the screen is only updated once every minute. Only show hours and minutes
-in ambient mode; do not show seconds in this mode.</p>
-
 <h3>Interactive mode</h3>
 <p>When the user moves their wrist to glance at their watch, the screen goes into interactive
 mode. Your design can use full color with fluid animation in this mode.</p>
 
 <h3>Ambient mode</h3>
-<p>Ambient mode helps the device conserve power. In this mode, the screen only displays shades
-of grey, black, and white. Your watch face is notified when the device switches to ambient mode,
-and you should thoughtfully design for it.</p>
+<p>Ambient mode helps the device conserve power. Your design should make clear to the user that
+the screen is in ambient mode by using only grayscale colors. Do not use a lot of white in ambient
+mode, since this distracting and hurts battery life on some screens. In this mode, the screen
+is only updated once every minute. Only show hours and minutes in ambient mode; do not show
+seconds. Your watch face is notified when the device switches to ambient mode, and you should
+thoughtfully design for it.</p>
 
 
 
diff --git a/docs/html/google/play-services/maps.jd b/docs/html/google/play-services/maps.jd
index 7a61d6c..9bf5f80 100644
--- a/docs/html/google/play-services/maps.jd
+++ b/docs/html/google/play-services/maps.jd
@@ -13,7 +13,7 @@
 <div class="col-6">
 
   <h1 itemprop="name" style="margin-bottom:0;">Google Maps Android API v2</h1>
-  <p itemprop="description">Allow your users explore the world with rich maps provided by
+  <p itemprop="description">Allow your users to explore the world with rich maps provided by
   Google. Identify locations with <b>custom markers</b>, augment the map data
   with <b>image overlays</b>, embed <b>one or more maps</b> as fragments,
   and much more.</p>
diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd
index 413000f..cb3fa17 100644
--- a/docs/html/google/play-services/setup.jd
+++ b/docs/html/google/play-services/setup.jd
@@ -62,7 +62,7 @@
   <li>Add a new build rule under <code>dependencies</code> for the latest version of
 <code>play-services</code>. For example:
 <pre class="no-pretty-print">
-apply plugin: 'android'
+apply plugin: 'com.android.application'
 ...
 
 dependencies {
diff --git a/docs/html/guide/topics/search/searchable-config.jd b/docs/html/guide/topics/search/searchable-config.jd
index fc13c04..9d2fa94 100644
--- a/docs/html/guide/topics/search/searchable-config.jd
+++ b/docs/html/guide/topics/search/searchable-config.jd
@@ -32,26 +32,26 @@
 <pre class="stx">
 &lt;?xml version="1.0" encoding="utf-8"?>
 &lt;<a href="#searchable-element">searchable</a> xmlns:android="http://schemas.android.com/apk/res/android"
-    android:label="<em>string resource</em>"
-    android:hint="<em>string resource</em>"
-    android:searchMode=["queryRewriteFromData" | "queryRewriteFromText"]
-    android:searchButtonText="<em>string resource</em>"
-    android:inputType="<em>{@link android.R.attr#inputType}</em>"
-    android:imeOptions="<em>{@link android.R.attr#imeOptions}</em>"
-    android:searchSuggestAuthority="<em>string</em>"
-    android:searchSuggestPath="<em>string</em>"
-    android:searchSuggestSelection="<em>string</em>"
-    android:searchSuggestIntentAction="<em>string</em>"
-    android:searchSuggestIntentData="<em>string</em>"
-    android:searchSuggestThreshold="<em>int</em>"
-    android:includeInGlobalSearch=["true" | "false"]
-    android:searchSettingsDescription="<em>string resource</em>"
-    android:queryAfterZeroResults=["true" | "false"]
-    android:voiceSearchMode=["showVoiceSearchButton" | "launchWebSearch" | "launchRecognizer"]
-    android:voiceLanguageModel=["free-form" | "web_search"]
-    android:voicePromptText="<em>string resource</em>"
-    android:voiceLanguage="<em>string</em>"
-    android:voiceMaxResults="<em>int</em>"
+    android:<a href="#label">label</a>="<em>string resource</em>"
+    android:<a href="#hint">hint</a>="<em>string resource</em>"
+    android:<a href="#searchMode">searchMode</a>=["queryRewriteFromData" | "queryRewriteFromText"]
+    android:<a href="#searchButtonText">searchButtonText</a>="<em>string resource</em>"
+    android:<a href="#inputType">inputType</a>="<em>{@link android.R.attr#inputType}</em>"
+    android:<a href="#imeOptions">imeOptions</a>="<em>{@link android.R.attr#imeOptions}</em>"
+    android:<a href="#searchSuggestAuthority">searchSuggestAuthority</a>="<em>string</em>"
+    android:<a href="#searchSuggestPath">searchSuggestPath</a>="<em>string</em>"
+    android:<a href="#searchSuggestSelection">searchSuggestSelection</a>="<em>string</em>"
+    android:<a href="#searchSuggestIntentAction">searchSuggestIntentAction</a>="<em>string</em>"
+    android:<a href="#searchSuggestIntentData">searchSuggestIntentData</a>="<em>string</em>"
+    android:<a href="#searchSuggestThreshold">searchSuggestThreshold</a>="<em>int</em>"
+    android:<a href="#includeInGlobalSearch">includeInGlobalSearch</a>=["true" | "false"]
+    android:<a href="#searchSettingsDescription">searchSettingsDescription</a>="<em>string resource</em>"
+    android:<a href="#queryAfterZeroResults">queryAfterZeroResults</a>=["true" | "false"]
+    android:<a href="#voiceSearchMode">voiceSearchMode</a>=["showVoiceSearchButton" | "launchWebSearch" | "launchRecognizer"]
+    android:<a href="#voiceLanguageModel">voiceLanguageModel</a>=["free-form" | "web_search"]
+    android:<a href="#voicePromptText">voicePromptText</a>="<em>string resource</em>"
+    android:<a href="#voiceLanguage">voiceLanguage</a>="<em>string</em>"
+    android:<a href="#voiceMaxResults">voiceMaxResults</a>="<em>int</em>"
     &gt;
     &lt;<a href="#actionkey-element">actionkey</a>
         android:keycode="<em>{@link android.view.KeyEvent KEYCODE}</em>"
@@ -69,7 +69,7 @@
   <dd>Defines all search configurations used by the Android system to provide assisted search.
     <p class="caps">attributes:</p>
       <dl class="atn-list">
-      <dt><code>android:label</code></dt>
+      <dt><a name="label"></a><code>android:label</code></dt>
       <dd><em>String resource</em>. (Required.) The name of your application.
 It should be the same as the name applied to the {@code android:label} attribute of your <a
 href="{@docRoot}guide/topics/manifest/activity-element.html#label">{@code &lt;activity&gt;}</a> or
@@ -78,14 +78,14 @@
 <code>android:includeInGlobalSearch</code> to "true", in which case, this label is used to identify
 your application as a searchable item in the system's search settings.</dd>
 
-      <dt><code>android:hint</code></dt>
+      <dt><a name="hint"></a><code>android:hint</code></dt>
       <dd><em>String resource</em>. (Recommended.) The text to display in the search text field when
 no text has been entered. It provides a hint to the user about what
 content is searchable. For consistency with other Android applications, you should format the
 string for {@code android:hint} as "Search <em>&lt;content-or-product&gt;</em>". For example,
 "Search songs and artists" or "Search YouTube".</dd>
 
-      <dt><code>android:searchMode</code></dt>
+      <dt><a name="searchMode"></a><code>android:searchMode</code></dt>
       <dd><em>Keyword</em>. Sets additional modes that control the search presentation.
 Currently available modes define how the query text should be rewritten when a custom suggestion
 receives focus. The following mode values are accepted:
@@ -109,19 +109,19 @@
 href="adding-custom-suggestions.html#RewritingQueryText">Adding Custom Suggestions</a>.</p>
       </dd>
 
-      <dt><code>android:searchButtonText</code></dt>
+      <dt><a name="searchButtonText"></a><code>android:searchButtonText</code></dt>
       <dd><em>String resource</em>. The text to display in the button that executes search. By
 default, the button shows a search icon (a magnifying glass), which is ideal for
 internationalization, so you should not use this attribute to change the button unless the
 behavior is something other than a search (such as a URL request in a web browser).</dd>
 
-      <dt><code>android:inputType</code></dt>
+      <dt><a name="inputType"></a><code>android:inputType</code></dt>
       <dd><em>Keyword</em>. Defines the type of input method (such as the type of soft keyboard)
-to use. For most searches, in which free-form text is expected, you don't 
+to use. For most searches, in which free-form text is expected, you don't
 need this attribute. See {@link android.R.attr#inputType} for a list of suitable values for this
 attribute.</dd>
 
-      <dt><code>android:imeOptions</code></dt>
+      <dt><a name="imeOptions"></a><code>android:imeOptions</code></dt>
       <dd><em>Keyword</em>. Supplies additional options for the input method.
         For most searches, in  which free-form text is expected, you don't need this attribute. The
 default IME is "actionSearch" (provides the "search" button instead of a carriage
@@ -139,12 +139,12 @@
     {@code &lt;searchable>} attributes:</p><br/>
 
       <dl class="atn-list">
-      <dt><code>android:searchSuggestAuthority</code></dt>
+      <dt><a name="searchSuggestAuthority"></a><code>android:searchSuggestAuthority</code></dt>
         <dd><em>String</em>. (Required to provide search suggestions.)
         This value must match the authority string provided in the {@code android:authorities}
 attribute of the Android manifest {@code &lt;provider>} element.</dd>
 
-      <dt><code>android:searchSuggestPath</code></dt>
+      <dt><a name="searchSuggestPath"></a><code>android:searchSuggestPath</code></dt>
         <dd><em>String</em>. This path is used as a portion of the suggestions
         query {@link android.net.Uri}, after the prefix and authority, but before
 the standard suggestions path.
@@ -152,7 +152,7 @@
         of suggestions (such as for different data types) and you need
         a way to disambiguate the suggestions queries when you receive them.</dd>
 
-      <dt><code>android:searchSuggestSelection</code></dt>
+      <dt><a name="searchSuggestSelection"></a><code>android:searchSuggestSelection</code></dt>
         <dd><em>String</em>. This value is passed into your
         query function as the {@code selection} parameter. Typically this is a WHERE clause
 for your database, and should contain a single question mark, which is a placeholder for the
@@ -160,22 +160,22 @@
 can also use any non-null value to trigger the delivery of the query text via the {@code
 selectionArgs} parameter (and then ignore the {@code selection} parameter).</dd>
 
-      <dt><code>android:searchSuggestIntentAction</code></dt>
+      <dt><a name="searchSuggestIntentAction"></a><code>android:searchSuggestIntentAction</code></dt>
         <dd><em>String</em>. The default intent action to be used when a user
         clicks on a custom search suggestion (such as {@code "android.intent.action.VIEW"}).
         If this is not overridden by the selected suggestion (via the {@link
 android.app.SearchManager#SUGGEST_COLUMN_INTENT_ACTION} column), this value is placed in the action
 field of the {@link android.content.Intent} when the user clicks a suggestion.</dd>
 
-      <dt><code>android:searchSuggestIntentData</code></dt>
+      <dt><a name="searchSuggestIntentData"></a><code>android:searchSuggestIntentData</code></dt>
         <dd><em>String</em>. The default intent data to be used when a user
         clicks on a custom search suggestion.
         If not overridden by the selected suggestion (via the {@link
 android.app.SearchManager#SUGGEST_COLUMN_INTENT_DATA} column), this value is
-        placed in the data field of the {@link android.content.Intent} when the user clicks 
+        placed in the data field of the {@link android.content.Intent} when the user clicks
         a suggestion.</dd>
 
-      <dt><code>android:searchSuggestThreshold</code></dt>
+      <dt><a name="searchSuggestThreshold"></a><code>android:searchSuggestThreshold</code></dt>
         <dd><em>Integer</em>. The minimum number of characters needed to
         trigger a suggestion look-up. Only guarantees that the system will not query your
         content provider for anything shorter than the threshold. The default value is 0.</dd>
@@ -192,20 +192,20 @@
     following {@code &lt;searchable>} attributes:</p><br/>
 
       <dl class="atn-list">
-      <dt><code>android:includeInGlobalSearch</code></dt>
+      <dt><a name="includeInGlobalSearch"></a><code>android:includeInGlobalSearch</code></dt>
         <dd><em>Boolean</em>. (Required to provide search suggestions in
         Quick Search Box.) Set to "true" if you want your suggestions to be
         included in the globally accessible Quick Search Box. The user must
         still enable your application as a searchable item in the system search settings before
         your suggestions will appear in Quick Search Box.</dd>
 
-      <dt><code>android:searchSettingsDescription</code></dt>
+      <dt><a name="searchSettingsDescription"></a><code>android:searchSettingsDescription</code></dt>
         <dd><em>String</em>. Provides a brief description of the search suggestions that you provide
 to Quick Search Box, which is displayed in the searchable items entry for your application.
 Your description should concisely describe the content that is searchable. For example, "Artists,
 albums, and tracks" for a music application, or "Saved notes" for a notepad application.</dd>
 
-      <dt><code>android:queryAfterZeroResults</code></dt>
+      <dt><a name="queryAfterZeroResults"></a><code>android:queryAfterZeroResults</code></dt>
         <dd><em>Boolean</em>. Set to "true" if you want your content provider to be invoked for
         supersets of queries that have returned zero results in the past. For example, if
 your content provider returned zero results for "bo", it should be requiried for "bob". If set to
@@ -222,7 +222,7 @@
     following {@code &lt;searchable>} attributes:</p><br/>
 
       <dl class="atn-list">
-        <dt><code>android:voiceSearchMode</code></dt>
+        <dt><a name="voiceSearchMode"></a><code>android:voiceSearchMode</code></dt>
         <dd><em>Keyword</em>. (Required to provide voice search capabilities.)
           Enables voice search, with a specific mode for voice search.
           (Voice search may not be provided by the device, in which case these flags
@@ -252,7 +252,7 @@
           </table>
         </dd>
 
-        <dt><code>android:voiceLanguageModel</code></dt>
+        <dt><a name="voiceLanguageModel"></a><code>android:voiceLanguageModel</code></dt>
           <dd><em>Keyword</em>. The language model that
           should be used by the voice recognition system. The following values are accepted:
           <table>
@@ -268,20 +268,20 @@
 available in more languages than "free_form".</td>
             </tr>
           </table>
-          <p>Also see 
+          <p>Also see
           {@link android.speech.RecognizerIntent#EXTRA_LANGUAGE_MODEL} for more
           information.</p></dd>
 
-        <dt><code>android:voicePromptText</code></dt>
+        <dt><a name="voicePromptText"></a><code>android:voicePromptText</code></dt>
           <dd><em>String</em>. An additional message to display in the voice input dialog.</dd>
 
-        <dt><code>android:voiceLanguage</code></dt>
+        <dt><a name="voiceLanguage"></a><code>android:voiceLanguage</code></dt>
           <dd><em>String</em>. The spoken language to be expected, expressed as the string value of
 a constants in {@link java.util.Locale} (such as {@code "de"} for German or {@code "fr"} for
 French). This is needed only if it is different from the current value of {@link
 java.util.Locale#getDefault() Locale.getDefault()}.</dd>
 
-        <dt><code>android:voiceMaxResults</code></dt>
+        <dt><a name="voiceMaxResults"></a><code>android:voiceMaxResults</code></dt>
           <dd><em>Integer</em>. Forces the maximum number of results to return,
           including the "best" result which is always provided as the {@link
 android.content.Intent#ACTION_SEARCH} intent's primary
@@ -308,7 +308,7 @@
 other three attributes in order to define the search action.</p>
       <p class="caps">attributes:</p>
       <dl class="atn-list">
-      <dt><code>android:keycode</code></dt>
+      <dt><a name="keycode"></a><code>android:keycode</code></dt>
         <dd><em>String</em>. (Required.) A key code from {@link
 android.view.KeyEvent} that represents the action key
         you wish to respond to (for example {@code "KEYCODE_CALL"}). This is added to the
@@ -318,7 +318,7 @@
 keys are supported for a search action, as many of them are used for typing, navigation, or system
 functions.</dd>
 
-      <dt><code>android:queryActionMsg</code></dt>
+      <dt><a name="queryActionMsg"></a><code>android:queryActionMsg</code></dt>
         <dd><em>String</em>. An action message to be sent if the action key is pressed while the
 user is entering query text. This is added to the
         {@link android.content.Intent#ACTION_SEARCH ACTION_SEARCH} intent that the system
@@ -326,17 +326,17 @@
         {@link android.content.Intent#getStringExtra
         getStringExtra(SearchManager.ACTION_MSG)}.</dd>
 
-      <dt><code>android:suggestActionMsg</code></dt>
+      <dt><a name="suggestActionMsg"></a><code>android:suggestActionMsg</code></dt>
         <dd><em>String</em>. An action message to be sent if the action key is pressed while a
         suggestion is in focus. This is added to the
         intent that that the system passes to your searchable activity (using the action
 you've defined for the suggestion). To examine the string,
-        use {@link android.content.Intent#getStringExtra 
+        use {@link android.content.Intent#getStringExtra
         getStringExtra(SearchManager.ACTION_MSG)}. This should only be used if all your
 suggestions support this action key. If not all suggestions can handle the same action key, then
 you must instead use the following {@code android:suggestActionMsgColumn} attribute.</dd>
 
-      <dt><code>android:suggestActionMsgColumn</code></dt>
+      <dt><a name="suggestActionMsgColumn"></a><code>android:suggestActionMsgColumn</code></dt>
         <dd><em>String</em>. The name of the column in your content provider that defines the
 action message for this action key, which is to be sent if the user presses the action key while a
         suggestion is in focus. This attribute lets you control the
diff --git a/docs/html/images/tv/recommend-card.png b/docs/html/images/tv/recommend-card.png
new file mode 100644
index 0000000..1cc4311
--- /dev/null
+++ b/docs/html/images/tv/recommend-card.png
Binary files differ
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 5d73d72..d9a47a2 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -449,7 +449,7 @@
 <ul>
 <li>Microsoft&reg;  Windows&reg;  8/7/Vista/2003 (32 or 64-bit)</li>
 <li>2 GB RAM minimum, 4 GB RAM recommended</li>
-<li>400 MB hard disk space + at least 1 G for Android SDK, emulator system images, and caches</li>
+<li>400 MB hard disk space + at least 1 GB for Android SDK, emulator system images, and caches</li>
 <li>1280 x 800  minimum screen resolution</li>
 <li>Java Development Kit (JDK) 7 </li>
 <li>Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T
diff --git a/docs/html/sdk/installing/create-project.jd b/docs/html/sdk/installing/create-project.jd
index a7c12d4..5082537 100644
--- a/docs/html/sdk/installing/create-project.jd
+++ b/docs/html/sdk/installing/create-project.jd
@@ -1,14 +1,58 @@
-page.title=Creating a Project
+page.title=Managing Projects from Android Studio
 
 @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>
+        <ol>
+          <li><a href="#Step1CreatingAProject">Create a New Project</a> </li>
+          <li><a href="#Step2SelectFormFactor">Select Form Factors and API Level</a> </li>
+          <li><a href="#Step3AddActivity">Add an Activity</a> </li>
+          <li><a href="#Step4ConfigureActivity">Configure Your App</a> </li>
+          <li><a href="#Step5DevelopYourApp">Develop Your App</a> </li>
+        </ol>
+
+        <li><a href="#CreatingAModule">Creating an Android Module</a></li>
+
+        <li><a href="#SettingUpLibraryModule">Setting up a Library Module</a></li>
+
+        <li><a href="#ReferencingLibraryModule">Referencing a Library Module</a></li>
+
+        <li><a href="#ReferencingAppEngModule">Setting up an App Eng Module</a></li>
+
+        <li><a href="#ProjectView">Using the Android Project View</a></li>
+
+      </ol>
+
+    </div>
+  </div>
+
+
+<p>Android Studio provides graphical tools for creating and managing Android projects, which
+contain everything that define your Android apps, from app source code to build configurations and
+test code. Each project contains one or more different types of modules, such as
+  application modules, library modules, and test modules.</p>
+
+<p>This guide explains how to create Android projects and different modules using
+<a href="{@docRoot}tools/studio/index.html">Android Studio</a>.
+For more information about the Android project structure and module types, read <a href=
+"{@docRoot}tools/projects/index.html">Managing Projects Overview</a>.</p>
+
+
+
+<h2 id="CreatingAProject">Creating an Android Project</h2>
+
 <p>Android Studio makes it easy to create Android apps for several form factors, such as phone,
 tablet, TV, Wear, and Google Glass. The <em>New Project</em> wizard lets you choose the form factors
 for your app and populates the project structure with everything you need to get started.</p>
 
 <p>Follow the steps in this section to create a project in Android Studio.</p>
 
-<h2>Step 1: Create a New Project</h2>
+<h3 id="Step1CreatingAProject">Step 1: Create a New Project</h2>
 
 <p>If you didn't have a project opened, Android Studio shows the Welcome screen.
 To create a new project, click <strong>New Project</strong>.</p>
@@ -22,20 +66,20 @@
 <img src="{@docRoot}images/tools/wizard2.png" alt="" width="500" height="381">
 <p class="img-caption"><strong>Figure 1.</strong> Choose a name for your project.</p>
 
-<p>Enter the values for your project and click <strong>Next</strong>.</p>
+<p>Enter the values for your project then click <strong>Next</strong>.</p>
 
-
-<h2>Step 2: Select Form Factors and API Level</h2>
+<h3 id="Step2SelectFormFactor">Step 2: Select Form Factors and API Level</h2>
 
 <p>The next window lets you select the form factors supported by your app, such as phone, tablet,
-TV, Wear, and Google Glass. For each form factor, you can also select the API
-Level that your app requires. To get more information, click <strong>Help me choose</strong>.</p>
+TV, Wear, and Google Glass. The selected form factors become the application modules witin the
+project. For each form factor, you can also select the API Level for that app. To get more information,
+click <strong>Help me choose</strong>.</p>
 
 <img src="{@docRoot}images/tools/wizard4.png" alt="" width="750" height="510">
 <p class="img-caption"><strong>Figure 2.</strong> Select the API Level.</p>
 
 <p>The API Level window shows the distribution of mobile devices running each version of Android,
-as shown in Figure 2. Click on an API level to see a list of features introduced in the corresponding
+as shown in figure 3. Click on an API level to see a list of features introduced in the corresponding
 version of Android. This helps you choose the minimum API Level that has all the features that
 your apps needs, so you can reach as many devices as possible. Then click <strong>OK</strong>.</p>
 
@@ -45,36 +89,39 @@
 <p>Then, on the Form Factors Window, click <strong>Next</strong>.</p>
 
 
-<h2>Step 3: Add an Activity</h2>
+<h3 id="Step3AddActivity">Step 3: Add an Activity</h2>
 
-<p>The next screen lets you select an activity type to add to your app, as shown in Figure 4.
-This screen depends on the form factors you selected earlier.</p>
+<p>The next screen lets you select an activity type to add to your app, as shown in figure 4.
+This screen displays a different set of activities for each of the form factors you selected earlier.</p>
 
 <img src="{@docRoot}images/tools/wizard5.png" alt="" width="720" height="504">
 <p class="img-caption"><strong>Figure 4.</strong> Add an activity to your app.</p>
 
-<p>Choose an activity type and click <strong>Next</strong>.</p>
+<p>Choose an activity type then click <strong>Next</strong>.</p>
+
+ <p class="note"><strong>Note:</strong> If you choose "Add No Activity", click <strong>Finish</strong>
+ to create the project.</p>
 
 
-<h2>Step 4: Configure Your Activity</h2>
+<h3 id="Step4ConfigureActivity">Step 4: Configure Your Activity</h2>
 
-<p>The next screen lets you configure the activity to add to your app, as shown in Figure 6.</p>
+<p>The next screen lets you configure the activity to add to your app, as shown in figure 5.</p>
 
 <img src="{@docRoot}images/tools/wizard6.png" alt="" width="450" height="385">
-<p class="img-caption"><strong>Figure 6.</strong> Choose a name for your activity.</p>
+<p class="img-caption"><strong>Figure 5.</strong> Choose a name for your activity.</p>
 
 <p>Enter the activity name, the layout name, and the activity title. Then click
 <strong>Finish</strong>.</p>
 
 
-<h2>Step 5: Develop Your App</h2>
+<h3 id="Step5DevelopYourApp">Step 5: Develop Your App</h2>
 
 <p>Android Studio creates the default structure for your project and opens the development
-environment. If your app supports more than one form factor, Android Studio creates a module for
-each of them, as shown in Figure 7.</p>
+environment. If your app supports more than one form factor, Android Studio creates a module folder
+with complete source files for each of them as shown in figure 6.</p>
 
 <img src="{@docRoot}images/tools/wizard7.png" alt="" width="750" height="509">
-<p class="img-caption"><strong>Figure 7.</strong> The default project structure for a mobile app.</p>
+<p class="img-caption"><strong>Figure 6.</strong> The default project structure for a mobile app.</p>
 
 <p>Now you are ready to develop your app. For more information, see the following links:</p>
 
@@ -84,3 +131,268 @@
 <li><a href="{@docRoot}tv/">Android TV</a></li>
 <li><a href="https://developers.google.com/glass/">Google Glass</a></li>
 </ul>
+
+
+  <h2 id="CreatingAModule">Creating an Android Module</h2>
+
+  <p>Android application modules contain the <code>src/main/</code>, <code>AndroidManifest.xml</code>,
+  <code>build.gradle</code>, build output and other files you need to generate your app's APK files.
+  Android Studio provides a <em>New Module Wizard</em> that you can use to quickly create a new
+  Android module (or a module from existing code) based on selected application settings, such as
+  minimum SDK level and activity template.</p>
+
+  <p>To create a new module, select <strong>File</strong> &gt; <strong>New</strong> &gt;
+  <strong>Module</strong>. Select the desire module type then click Next to enter the basic module
+  settings:</p>
+
+      <ul>
+        <li>Enter an <strong>Application Name</strong>. This name is used as the title of your
+        application launcher icon when it is installed on a device.</li>
+
+        <li>Enter a <strong>Module Name</strong>. This text is used as the name of the folder where
+        your Java-based activity files are stored.</li>
+
+        <li>Enter a <strong>Package Name</strong> and <strong>Package Location</strong>. This class
+        package namespace creates the initial
+        package structure for your applications code files and is added as the
+        <a href="{@docRoot}guide/topics/manifest/manifest-element.html#package">{@code package}</a>
+        attribute in your application's
+        <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">Android manifest file</a>.
+        This manifest value serves as the unique identifier for your application app when you
+        distribute it to users. The package name must follow the same rules as packages in the Java
+        programming language.</li>
+
+        <li>Select the <strong>Minimum required SDK</strong>.
+        This setting indicates the lowest version of the Android platform that your application
+        supports for the selected form factor. This value sets the
+        <code>minSdkVersion</code> attribute in the build.gradle file.</li>
+
+          <p class="note"><strong>Note:</strong> You can manually change the minimum and target SDK
+          for your module at any time: Double-click the module's build.gradle in the Project Explorer,
+          set the <strong>targetSdkVersion</strong> and  <em>targetSdkVersion</em> in the
+          <em>defaultConfig</em> section.</p>
+
+
+        <li>Select a <strong>Target SDK</strong>. This setting indicates the highest version of
+        Android with which you have tested with your application and sets the
+        <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+        targetSdkVersion}</a> attribute in your application's' build.gradle file.
+
+
+        <li>Select a <strong>Compile With</strong> API version. This setting specifies what version
+        of the SDK to compile your project against. We strongly recommend using the most recent
+        version of the API.</li>
+
+        <li>Select a <strong>Language Level</strong> API version. This setting specifies what version
+        of the SDK to compile your project against. We strongly recommend using the most recent
+        version of the API.</li>
+
+        <li>Select a <strong>Theme</strong>. This setting specifies which standard Android
+        <a href="{@docRoot}design/style/themes.html">visual style</a> is applied to your
+        application. Select activity template. For more information about Android code templates, see
+        <a href="{@docRoot}tools/projects/templates.html">Using Code Templates</a>Leave the <strong>
+        Create activity</strong> option checked so you can start your
+        application with some essential components. </li>
+
+        <li>Click the check box for the required Support Libraries then click <strong>Next</strong>.</li>
+
+        <li>In the <strong>Configure Launcher Icon</strong> page, create an icon and options, then click
+        <strong>Next</strong>.</li>
+
+        <li>In the <strong>Create Activity</strong> page, select activity template then click
+        <strong>Next</strong>. For more information about Android code templates, see
+        <a href="{@docRoot}tools/projects/templates.html">Using Code Templates</a>.
+        </li>
+
+        <li>Review the new module settings then click <strong>Finish</strong>.</li>
+
+     </ul>
+
+    <p>The wizard creates a new Android application module according to the options you have chosen.</p>
+
+
+
+  <h2 id="SettingUpLibraryModule">Setting up a Library Module</h2>
+
+  <p>A library module is a standard Android module, so you can create a new one in the same way
+  as you would a new application module, using the New Module wizard and selecting <em>Android
+  Library</em> as the module type. The created library module will appear in your project view
+  along with the other modules. </p>
+
+  <p> You can easily change an existing application module to a library module by changing the
+  plugin assignment in the <strong>build.gradle</strong> file to <em>com.android.libary</em>.</p>
+
+<pre>
+apply plugin: 'com.android.application'
+
+android {...}
+</pre>
+
+<pre>
+apply plugin: 'com.android.library'
+
+android {...}
+</pre>
+
+
+  <h3>Adding a dependency on a library module</h3>
+
+  <p>The library dependency can be declared in the module's manifest file or in the
+  <strong<build.gradle</strong> file. </p>
+
+  <p>A library modules'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>
+
+
+<p>To add the dependency declaration to the build file, edit the build file for the <code>app</code>
+module (<code>app/build.gradle</code>) and add a dependency on the <code>lib</code> module:</p>
+
+<pre>
+...
+dependencies {
+    ...
+    compile project(":lib")
+}
+</pre>
+
+<p>In this example, the <code>lib</code> module can still be built and tested independently, and
+the build system creates an AAR package for it that you could reuse in other projects.</p>
+
+<p class="note"><strong>Note:</strong> The library settings in the <code>app/build.gradle</code>
+file will override any shared library resources declared in the manifest file.</p>
+
+
+  <h2 id="ReferencingLibraryModule">Referencing a library module</h2>
+
+  <p>If you are developing an application and want to include the shared code or resources from a
+  library module, you can also do so easily by adding a reference to the library module in the
+  module's dependency page.</p>
+
+  <p>To add a reference to a library module, follow these steps:</p>
+
+  <ol>
+    <li>Make sure that both the module library and the application module that depends on it are
+      in your proejct. If one of the modules is missing, import it into your project.</li>
+
+    <li>In the project view, right-click the dependent module and select
+    <strong>Open</strong> > <strong>Module Settings</strong>.</li>
+
+    <li>Right-click the plus icon to add a new dependencies.
+    <p>If you are adding references to multiple libraries, 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>
+    </li>
+
+    <li>Use the <strong>Scope</strong> drop-down to select how the dependency will be applied.</li>
+
+    <li>Click <strong>Apply</strong> to create the dependency and <strong>OK</strong> to close the
+    <strong>Project Structure</strong> window.</li>
+  </ol>
+
+  <p>Android Studio rebuilds the module, including the contents of the library module the next time
+  the project or module is built.</p>
+
+
+
+  <h3>Declaring library components in the manifest file</h3>
+
+  <p>In the manifest file of the application module, you must add declarations of all components
+  that the application will use that are imported from a library module. 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>
+
+
+ <h2 id="ProjectView">Using the Android Project View</h2>
+
+
+<p>The Android project view in Android Studio shows a flattened version of your project's structure
+that provides quick access to the key source files of Android projects and helps you work with
+the new <a href="{@docRoot}sdk/installing/studio-build.html">Gradle-based build system</a>. The
+Android project view:</p>
+
+<ul>
+<li>Groups the build files for all modules at the top level of the project hierarchy.</li>
+<li>Shows the most important source directories at the top level of the module hierarchy.</li>
+<li>Groups all the manifest files for each module.</li>
+<li>Shows resource files from all Gradle source sets.</li>
+<li>Groups resource files for different locales, orientations, and screen types in a single group
+per resource type.</li>
+</ul>
+
+<div style="float:right;margin-left:30px;width:240px">
+<img src="{@docRoot}images/tools/projectview01.png" alt="" width="220" height="264"/>
+<p class="img-caption"><strong>Figure 9:</strong> Show the Android project view.</p>
+</div>
+
+
+<h2 id="enable-view">Enable and use the Android Project View</h2>
+
+<p>The Android project view is not yet enabled by default. To show the Android project view,
+click <strong>Project</strong> and select <strong>Android</strong>, as shown in figure 9.</p>
+
+<p>The Android project view shows all the build files at the top level of the project hierarchy
+under <strong>Gradle Scripts</strong>. Each project module appears as a folder at the top
+level of the project hierarchy and contains these three elements at the top level:</p>
+
+<ul>
+<li><code>java/</code> - Source files for the module.</li>
+<li><code>manifests/</code> - Manifest files for the module.</li>
+<li><code>res/</code> - Resource files for the module.</li>
+</ul>
+
+<p>Figure 10 shows how the Android project view groups all the instances of the
+<code>ic_launcher.png</code> resource for different screen densities under the same element.</p>
+
+<p class="note"><strong>Note:</strong> The Android project view shows a hierarchy that helps you
+work with Android projects by providing a flattened structure that highlights the most commonly
+used files while developing Android applications. However, the project structure on disk differs
+from this representation.</p>
+
+<img src="{@docRoot}images/tools/projectview03.png" alt=""
+     style="margin-top:10px" width="650" height="508"/>
+<p class="img-caption"><strong>Figure 10:</strong> The traditional project view (left) and the
+Android project view (right).</p>
+
+
+
+
diff --git a/docs/html/sdk/installing/studio-build.jd b/docs/html/sdk/installing/studio-build.jd
index 4fe9071..b68b176 100644
--- a/docs/html/sdk/installing/studio-build.jd
+++ b/docs/html/sdk/installing/studio-build.jd
@@ -98,7 +98,7 @@
 <h3>Build output</h3>
 
 <p>The build generates an APK for each build variant in the <code>app/build</code> folder:
-the <code>app/build/apk/</code> directory contains packages named
+the <code>app/build/outputs/apk/</code> directory contains packages named
 <code>app-&lt;flavor>-&lt;buildtype>.apk</code>; for example, <code>app-full-release.apk</code> and
 <code>app-demo-debug.apk</code>.</p>
 
diff --git a/docs/html/sdk/installing/studio-tips.jd b/docs/html/sdk/installing/studio-tips.jd
index 8e7e345..69c188c 100644
--- a/docs/html/sdk/installing/studio-tips.jd
+++ b/docs/html/sdk/installing/studio-tips.jd
@@ -91,16 +91,11 @@
 is based), refer to the
 <a href="http://www.jetbrains.com/idea/documentation/index.jsp">IntelliJ IDEA documentation</a>.</p>
 
-<h3>External annotations</h3>
-<p>Specify annotations within the code or from an external annotation file. The Android Studio
-IDE keeps track of the restrictions and validates compliance, for example setting the data type
-of a string as not null.</p>
-
 
 <h3><em>Alt + Enter</em> key binding</h3>
 <p>For quick fixes to coding errors, the IntelliJ powered IDE implements the <em>Alt + Enter</em>
 key binding to fix errors (missing imports, variable assignments, missing references, etc) when
-possible, and if not, suggest the most probably solution. </p>
+possible, and if not, suggest the most probable solution. </p>
 
 
 <h3><em>Ctrl + D</em> key binding</h3>
@@ -169,12 +164,9 @@
 
 <p class="note"><strong>Note:</strong> This section lists Android Studio keyboard shortcuts
 for the default keymap. To change the default keymap on Windows and Linux, go to
-<strong>File</strong> &gt; <strong>Settings</strong> &gt; <strong>Keymap</strong>. To change
-the default keymap on Mac OS X, go to <strong>Android Studio</strong> &gt;
-<strong>Preferences</strong> &gt; <strong>Keymap</strong>.</p>
-
-<p class="note"><strong>Note:</strong> If you're using Mac OS X, update your keymap to use
-the Mac OS X 10.5+ version keymaps under <strong>Android Studio > Preferences > Keymap</strong>.</p>
+<strong>File</strong> &gt; <strong>Settings</strong> &gt; <strong>Keymap</strong>. If you're
+using Mac OS X, update your keymap to use the Mac OS X 10.5+ version keymaps under
+<strong>Android Studio > Preferences > Keymap</strong>.</p>
 
 
 <p class="table-caption"><strong>Table 1.</strong> Programming key commands</p>
diff --git a/docs/html/tools/building/configuring-gradle.jd b/docs/html/tools/building/configuring-gradle.jd
index 2e15473..5af2096 100644
--- a/docs/html/tools/building/configuring-gradle.jd
+++ b/docs/html/tools/building/configuring-gradle.jd
@@ -44,7 +44,7 @@
 <code>BuildSystemExample</code> project looks like this:</p>
 
 <pre>
-apply plugin: 'android'
+apply plugin: 'com.android.application'
 
 android {
     compileSdkVersion 19
@@ -72,7 +72,7 @@
 }
 </pre>
 
-<p><code>apply plugin: 'android'</code> applies the Android plugin for Gradle to this build.
+<p><code>apply plugin: 'com.android.application'</code> applies the Android plugin for Gradle to this build.
 This adds Android-specific build tasks to the top-level build tasks and makes the
 <code>android {...}</code> element available to specify Android-specific build options.</p>
 
diff --git a/docs/html/tools/building/plugin-for-gradle.jd b/docs/html/tools/building/plugin-for-gradle.jd
index b479ed8..77cbfda 100644
--- a/docs/html/tools/building/plugin-for-gradle.jd
+++ b/docs/html/tools/building/plugin-for-gradle.jd
@@ -23,7 +23,7 @@
 <h2>Download</h2>
 <div class="download-box">
   <a href="{@docRoot}shareables/sdk-tools/android-gradle-plugin-dsl.zip"
-    class="button">Plugin Command Reference</a>
+    class="button">Plugin Language Reference</a>
   <p class="filename">android-gradle-plugin-dsl.zip</p>
 </div>
 
@@ -117,7 +117,7 @@
 <em>repositories</em> and <em>dependencies</em>. This allows different projects to use different
 Gradle versions. Supported repositories include JCenter, Maven Central, or Ivy. This example
 declares that the build script uses the JCenter repository and a classpath dependency artifact
-that contains the Android plugin for Gradle version 0.14.4.
+that contains the Android plugin for Gradle version 1.0.1.
 </p>
 <p>
 <pre>
@@ -126,7 +126,7 @@
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:0.14.4'
+        classpath 'com.android.tools.build:gradle:1.0.1'
 
         // NOTE: Do not place your application dependencies here: they belong
         // in the individual module build.gradle files
@@ -320,6 +320,9 @@
 <p>You can run the shell scripts to build your project from the command line on your development
 machine and on other machines where Android Studio is not installed.</p>
 
+<p class="caution"><strong>Caution:</strong> When you create a project, only use the Gradle wrapper
+scripts and JAR from a trusted source, such as those generated by Android Studio. /p>
+
 
 <h2 id="buildVariants"> Build variants</h2>
 
diff --git a/docs/html/tools/devices/emulator.jd b/docs/html/tools/devices/emulator.jd
index dc9294b..42240b9 100644
--- a/docs/html/tools/devices/emulator.jd
+++ b/docs/html/tools/devices/emulator.jd
@@ -294,9 +294,10 @@
       <strong>Run > Edit Configurations...</strong></li>
       <li>In the left panel of the <strong>Run/Debug Configurations</strong> dialog, select your Android
       run configuration or create a new configuration.</li>
-      <li>Under the <strong>Device Target</strong> options,
+      <li>Under the <strong>Target Device </strong> options,
       select the AVD you created in the previous procedure.</li>
-      <li>In the <strong>Additional Command Line Options</strong> field, enter:<br>
+      <li>In the <strong>Emulator</strong> tab, in the
+      <strong>Additional command line options</strong> field, enter:<br>
         {@code -gpu on}</li>
       <li>Run your Android project using this run configuration.</li>
     </ol>
@@ -421,7 +422,7 @@
 Configurations...</strong></li>
       <li>In the left panel of the <strong>Run/Debug Configurations</strong> dialog, select your Android
 run configuration or create a new configuration.</li>
-      <li>Under the <strong>Device Target</strong> options, select the x86-based AVD you created
+      <li>Under the <strong>Target Device</strong> options, select the x86-based AVD you created
 previously.</li>
       <li>Run your Android project using this run configuration.</li>
     </ol>
@@ -474,7 +475,7 @@
 Configurations...</strong></li>
       <li>In the left panel of the <strong>Run/Debug Configurations</strong> dialog, select your Android
 run configuration or create a new configuration.</li>
-      <li>Under the <strong>Device Target</strong> options,
+      <li>Under the <strong>Target Device</strong> options,
       select the x86-based AVD you created previously.</li>
       <li>Run your Android project using this run configuration.</li>
     </ol>
@@ -513,17 +514,18 @@
     <p class="note"><strong>Note:</strong> You must provide an x86-based AVD configuration
 name, otherwise VM acceleration will not be enabled.</p>
   </li>
-  <li>If you are running the emulator from Android Studio, run your Android application with an x86-based
-AVD and include the KVM options:
+  <li>If you are running the emulator from Android Studio, run your Android application with an
+  x86-based AVD and include the KVM options:
     <ol>
       <li>In Android Studio, click your Android module folder and then select <strong>Run > Edit
 Configurations...</strong></li>
       <li>In the left panel of the <strong>Run/Debug Configurations</strong> dialog, select your Android
 run configuration or create a new configuration.</li>
-      <li>Under the <strong>Device Target</strong> options, select the x86-based AVD you created
+      <li>Under the <strong>Target Device</strong> options, select the x86-based AVD you created
 previously.</li>
-      <li>In the <strong>Additional Command Line Options</strong> field, enter:
-        <pre>-qemu -m 512 -enable-kvm</pre>
+      <li>In the <strong>Emulator</strong> tab, in the
+      <strong>Additional command line options</strong> field, enter:
+      <pre>-qemu -m 512 -enable-kvm</pre>
       </li>
       <li>Run your Android project using this run configuration.</li>
     </ol>
diff --git a/docs/html/tools/projects/projects-studio.jd b/docs/html/tools/projects/projects-studio.jd
deleted file mode 100644
index 5082537..0000000
--- a/docs/html/tools/projects/projects-studio.jd
+++ /dev/null
@@ -1,398 +0,0 @@
-page.title=Managing Projects from Android Studio
-
-@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>
-        <ol>
-          <li><a href="#Step1CreatingAProject">Create a New Project</a> </li>
-          <li><a href="#Step2SelectFormFactor">Select Form Factors and API Level</a> </li>
-          <li><a href="#Step3AddActivity">Add an Activity</a> </li>
-          <li><a href="#Step4ConfigureActivity">Configure Your App</a> </li>
-          <li><a href="#Step5DevelopYourApp">Develop Your App</a> </li>
-        </ol>
-
-        <li><a href="#CreatingAModule">Creating an Android Module</a></li>
-
-        <li><a href="#SettingUpLibraryModule">Setting up a Library Module</a></li>
-
-        <li><a href="#ReferencingLibraryModule">Referencing a Library Module</a></li>
-
-        <li><a href="#ReferencingAppEngModule">Setting up an App Eng Module</a></li>
-
-        <li><a href="#ProjectView">Using the Android Project View</a></li>
-
-      </ol>
-
-    </div>
-  </div>
-
-
-<p>Android Studio provides graphical tools for creating and managing Android projects, which
-contain everything that define your Android apps, from app source code to build configurations and
-test code. Each project contains one or more different types of modules, such as
-  application modules, library modules, and test modules.</p>
-
-<p>This guide explains how to create Android projects and different modules using
-<a href="{@docRoot}tools/studio/index.html">Android Studio</a>.
-For more information about the Android project structure and module types, read <a href=
-"{@docRoot}tools/projects/index.html">Managing Projects Overview</a>.</p>
-
-
-
-<h2 id="CreatingAProject">Creating an Android Project</h2>
-
-<p>Android Studio makes it easy to create Android apps for several form factors, such as phone,
-tablet, TV, Wear, and Google Glass. The <em>New Project</em> wizard lets you choose the form factors
-for your app and populates the project structure with everything you need to get started.</p>
-
-<p>Follow the steps in this section to create a project in Android Studio.</p>
-
-<h3 id="Step1CreatingAProject">Step 1: Create a New Project</h2>
-
-<p>If you didn't have a project opened, Android Studio shows the Welcome screen.
-To create a new project, click <strong>New Project</strong>.</p>
-
-<p>If you had a project opened, Android Studio shows the development environment.
-To create a new project, click <strong>File</strong> > <strong>New Project</strong>.</p>
-
-<p>The next window lets you configure the name of your app, the package name, and the location
-of your project.</p>
-
-<img src="{@docRoot}images/tools/wizard2.png" alt="" width="500" height="381">
-<p class="img-caption"><strong>Figure 1.</strong> Choose a name for your project.</p>
-
-<p>Enter the values for your project then click <strong>Next</strong>.</p>
-
-<h3 id="Step2SelectFormFactor">Step 2: Select Form Factors and API Level</h2>
-
-<p>The next window lets you select the form factors supported by your app, such as phone, tablet,
-TV, Wear, and Google Glass. The selected form factors become the application modules witin the
-project. For each form factor, you can also select the API Level for that app. To get more information,
-click <strong>Help me choose</strong>.</p>
-
-<img src="{@docRoot}images/tools/wizard4.png" alt="" width="750" height="510">
-<p class="img-caption"><strong>Figure 2.</strong> Select the API Level.</p>
-
-<p>The API Level window shows the distribution of mobile devices running each version of Android,
-as shown in figure 3. Click on an API level to see a list of features introduced in the corresponding
-version of Android. This helps you choose the minimum API Level that has all the features that
-your apps needs, so you can reach as many devices as possible. Then click <strong>OK</strong>.</p>
-
-<img src="{@docRoot}images/tools/wizard3.png" alt="" width="500" height="480">
-<p class="img-caption"><strong>Figure 3.</strong> Choose form factors for your app.</p>
-
-<p>Then, on the Form Factors Window, click <strong>Next</strong>.</p>
-
-
-<h3 id="Step3AddActivity">Step 3: Add an Activity</h2>
-
-<p>The next screen lets you select an activity type to add to your app, as shown in figure 4.
-This screen displays a different set of activities for each of the form factors you selected earlier.</p>
-
-<img src="{@docRoot}images/tools/wizard5.png" alt="" width="720" height="504">
-<p class="img-caption"><strong>Figure 4.</strong> Add an activity to your app.</p>
-
-<p>Choose an activity type then click <strong>Next</strong>.</p>
-
- <p class="note"><strong>Note:</strong> If you choose "Add No Activity", click <strong>Finish</strong>
- to create the project.</p>
-
-
-<h3 id="Step4ConfigureActivity">Step 4: Configure Your Activity</h2>
-
-<p>The next screen lets you configure the activity to add to your app, as shown in figure 5.</p>
-
-<img src="{@docRoot}images/tools/wizard6.png" alt="" width="450" height="385">
-<p class="img-caption"><strong>Figure 5.</strong> Choose a name for your activity.</p>
-
-<p>Enter the activity name, the layout name, and the activity title. Then click
-<strong>Finish</strong>.</p>
-
-
-<h3 id="Step5DevelopYourApp">Step 5: Develop Your App</h2>
-
-<p>Android Studio creates the default structure for your project and opens the development
-environment. If your app supports more than one form factor, Android Studio creates a module folder
-with complete source files for each of them as shown in figure 6.</p>
-
-<img src="{@docRoot}images/tools/wizard7.png" alt="" width="750" height="509">
-<p class="img-caption"><strong>Figure 6.</strong> The default project structure for a mobile app.</p>
-
-<p>Now you are ready to develop your app. For more information, see the following links:</p>
-
-<ul>
-<li><a href="{@docRoot}training/">Training Lessons</a></li>
-<li><a href="{@docRoot}training/building-wearables.html">Building Apps for Wearables</a></li>
-<li><a href="{@docRoot}tv/">Android TV</a></li>
-<li><a href="https://developers.google.com/glass/">Google Glass</a></li>
-</ul>
-
-
-  <h2 id="CreatingAModule">Creating an Android Module</h2>
-
-  <p>Android application modules contain the <code>src/main/</code>, <code>AndroidManifest.xml</code>,
-  <code>build.gradle</code>, build output and other files you need to generate your app's APK files.
-  Android Studio provides a <em>New Module Wizard</em> that you can use to quickly create a new
-  Android module (or a module from existing code) based on selected application settings, such as
-  minimum SDK level and activity template.</p>
-
-  <p>To create a new module, select <strong>File</strong> &gt; <strong>New</strong> &gt;
-  <strong>Module</strong>. Select the desire module type then click Next to enter the basic module
-  settings:</p>
-
-      <ul>
-        <li>Enter an <strong>Application Name</strong>. This name is used as the title of your
-        application launcher icon when it is installed on a device.</li>
-
-        <li>Enter a <strong>Module Name</strong>. This text is used as the name of the folder where
-        your Java-based activity files are stored.</li>
-
-        <li>Enter a <strong>Package Name</strong> and <strong>Package Location</strong>. This class
-        package namespace creates the initial
-        package structure for your applications code files and is added as the
-        <a href="{@docRoot}guide/topics/manifest/manifest-element.html#package">{@code package}</a>
-        attribute in your application's
-        <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">Android manifest file</a>.
-        This manifest value serves as the unique identifier for your application app when you
-        distribute it to users. The package name must follow the same rules as packages in the Java
-        programming language.</li>
-
-        <li>Select the <strong>Minimum required SDK</strong>.
-        This setting indicates the lowest version of the Android platform that your application
-        supports for the selected form factor. This value sets the
-        <code>minSdkVersion</code> attribute in the build.gradle file.</li>
-
-          <p class="note"><strong>Note:</strong> You can manually change the minimum and target SDK
-          for your module at any time: Double-click the module's build.gradle in the Project Explorer,
-          set the <strong>targetSdkVersion</strong> and  <em>targetSdkVersion</em> in the
-          <em>defaultConfig</em> section.</p>
-
-
-        <li>Select a <strong>Target SDK</strong>. This setting indicates the highest version of
-        Android with which you have tested with your application and sets the
-        <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
-        targetSdkVersion}</a> attribute in your application's' build.gradle file.
-
-
-        <li>Select a <strong>Compile With</strong> API version. This setting specifies what version
-        of the SDK to compile your project against. We strongly recommend using the most recent
-        version of the API.</li>
-
-        <li>Select a <strong>Language Level</strong> API version. This setting specifies what version
-        of the SDK to compile your project against. We strongly recommend using the most recent
-        version of the API.</li>
-
-        <li>Select a <strong>Theme</strong>. This setting specifies which standard Android
-        <a href="{@docRoot}design/style/themes.html">visual style</a> is applied to your
-        application. Select activity template. For more information about Android code templates, see
-        <a href="{@docRoot}tools/projects/templates.html">Using Code Templates</a>Leave the <strong>
-        Create activity</strong> option checked so you can start your
-        application with some essential components. </li>
-
-        <li>Click the check box for the required Support Libraries then click <strong>Next</strong>.</li>
-
-        <li>In the <strong>Configure Launcher Icon</strong> page, create an icon and options, then click
-        <strong>Next</strong>.</li>
-
-        <li>In the <strong>Create Activity</strong> page, select activity template then click
-        <strong>Next</strong>. For more information about Android code templates, see
-        <a href="{@docRoot}tools/projects/templates.html">Using Code Templates</a>.
-        </li>
-
-        <li>Review the new module settings then click <strong>Finish</strong>.</li>
-
-     </ul>
-
-    <p>The wizard creates a new Android application module according to the options you have chosen.</p>
-
-
-
-  <h2 id="SettingUpLibraryModule">Setting up a Library Module</h2>
-
-  <p>A library module is a standard Android module, so you can create a new one in the same way
-  as you would a new application module, using the New Module wizard and selecting <em>Android
-  Library</em> as the module type. The created library module will appear in your project view
-  along with the other modules. </p>
-
-  <p> You can easily change an existing application module to a library module by changing the
-  plugin assignment in the <strong>build.gradle</strong> file to <em>com.android.libary</em>.</p>
-
-<pre>
-apply plugin: 'com.android.application'
-
-android {...}
-</pre>
-
-<pre>
-apply plugin: 'com.android.library'
-
-android {...}
-</pre>
-
-
-  <h3>Adding a dependency on a library module</h3>
-
-  <p>The library dependency can be declared in the module's manifest file or in the
-  <strong<build.gradle</strong> file. </p>
-
-  <p>A library modules'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>
-
-
-<p>To add the dependency declaration to the build file, edit the build file for the <code>app</code>
-module (<code>app/build.gradle</code>) and add a dependency on the <code>lib</code> module:</p>
-
-<pre>
-...
-dependencies {
-    ...
-    compile project(":lib")
-}
-</pre>
-
-<p>In this example, the <code>lib</code> module can still be built and tested independently, and
-the build system creates an AAR package for it that you could reuse in other projects.</p>
-
-<p class="note"><strong>Note:</strong> The library settings in the <code>app/build.gradle</code>
-file will override any shared library resources declared in the manifest file.</p>
-
-
-  <h2 id="ReferencingLibraryModule">Referencing a library module</h2>
-
-  <p>If you are developing an application and want to include the shared code or resources from a
-  library module, you can also do so easily by adding a reference to the library module in the
-  module's dependency page.</p>
-
-  <p>To add a reference to a library module, follow these steps:</p>
-
-  <ol>
-    <li>Make sure that both the module library and the application module that depends on it are
-      in your proejct. If one of the modules is missing, import it into your project.</li>
-
-    <li>In the project view, right-click the dependent module and select
-    <strong>Open</strong> > <strong>Module Settings</strong>.</li>
-
-    <li>Right-click the plus icon to add a new dependencies.
-    <p>If you are adding references to multiple libraries, 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>
-    </li>
-
-    <li>Use the <strong>Scope</strong> drop-down to select how the dependency will be applied.</li>
-
-    <li>Click <strong>Apply</strong> to create the dependency and <strong>OK</strong> to close the
-    <strong>Project Structure</strong> window.</li>
-  </ol>
-
-  <p>Android Studio rebuilds the module, including the contents of the library module the next time
-  the project or module is built.</p>
-
-
-
-  <h3>Declaring library components in the manifest file</h3>
-
-  <p>In the manifest file of the application module, you must add declarations of all components
-  that the application will use that are imported from a library module. 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>
-
-
- <h2 id="ProjectView">Using the Android Project View</h2>
-
-
-<p>The Android project view in Android Studio shows a flattened version of your project's structure
-that provides quick access to the key source files of Android projects and helps you work with
-the new <a href="{@docRoot}sdk/installing/studio-build.html">Gradle-based build system</a>. The
-Android project view:</p>
-
-<ul>
-<li>Groups the build files for all modules at the top level of the project hierarchy.</li>
-<li>Shows the most important source directories at the top level of the module hierarchy.</li>
-<li>Groups all the manifest files for each module.</li>
-<li>Shows resource files from all Gradle source sets.</li>
-<li>Groups resource files for different locales, orientations, and screen types in a single group
-per resource type.</li>
-</ul>
-
-<div style="float:right;margin-left:30px;width:240px">
-<img src="{@docRoot}images/tools/projectview01.png" alt="" width="220" height="264"/>
-<p class="img-caption"><strong>Figure 9:</strong> Show the Android project view.</p>
-</div>
-
-
-<h2 id="enable-view">Enable and use the Android Project View</h2>
-
-<p>The Android project view is not yet enabled by default. To show the Android project view,
-click <strong>Project</strong> and select <strong>Android</strong>, as shown in figure 9.</p>
-
-<p>The Android project view shows all the build files at the top level of the project hierarchy
-under <strong>Gradle Scripts</strong>. Each project module appears as a folder at the top
-level of the project hierarchy and contains these three elements at the top level:</p>
-
-<ul>
-<li><code>java/</code> - Source files for the module.</li>
-<li><code>manifests/</code> - Manifest files for the module.</li>
-<li><code>res/</code> - Resource files for the module.</li>
-</ul>
-
-<p>Figure 10 shows how the Android project view groups all the instances of the
-<code>ic_launcher.png</code> resource for different screen densities under the same element.</p>
-
-<p class="note"><strong>Note:</strong> The Android project view shows a hierarchy that helps you
-work with Android projects by providing a flattened structure that highlights the most commonly
-used files while developing Android applications. However, the project structure on disk differs
-from this representation.</p>
-
-<img src="{@docRoot}images/tools/projectview03.png" alt=""
-     style="margin-top:10px" width="650" height="508"/>
-<p class="img-caption"><strong>Figure 10:</strong> The traditional project view (left) and the
-Android project view (right).</p>
-
-
-
-
diff --git a/docs/html/tools/support-library/setup.jd b/docs/html/tools/support-library/setup.jd
index 845cf76..8112071 100644
--- a/docs/html/tools/support-library/setup.jd
+++ b/docs/html/tools/support-library/setup.jd
@@ -300,7 +300,7 @@
   overrides the manifest settings.  </p>
 
 <pre>
-apply plugin: 'android'
+apply plugin: 'com.android.application'
 
 android {
     ...
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index 9437c1b..ab6c739 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -52,7 +52,7 @@
       <li class="nav-section">
         <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/projects/index.html"><span class="en">Managing Projects</span></a></div>
         <ul>
-          <li><a href="<?cs var:toroot ?>tools/projects/projects-studio.html"><span class="en">From Android Studio</span></a></li>
+          <li><a href="<?cs var:toroot ?>sdk/installing/create-project.html"><span class="en">From Android Studio</span></a></li>
           <li><a href="<?cs var:toroot ?>tools/projects/projects-cmdline.html"><span class="en">From the Command Line</span></a></li>
           <li><a href="<?cs var:toroot ?>tools/projects/templates.html"><span class="en">Using Code Templates</span></a></li>
         </ul>
diff --git a/docs/html/tools/workflow/index.jd b/docs/html/tools/workflow/index.jd
index 6a114c7..a24a2b0 100644
--- a/docs/html/tools/workflow/index.jd
+++ b/docs/html/tools/workflow/index.jd
@@ -30,15 +30,15 @@
     <p>During this phase you install and set up your development environment. You also create
       Android Virtual Devices (AVDs) and connect hardware devices on which you can install your
       applications.</p>
-    <p>See <a href="{@docRoot}tools/workflow/devices/index.html">Managing Virtual Devices</a>
-      and <a href="{@docRoot}tools/workflow/device.html">Using Hardware Devices</a> for more
+    <p>See <a href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>
+      and <a href="{@docRoot}tools/device.html">Using Hardware Devices</a> for more
       information.
   </li>
   <li><strong>Project Setup and Development</strong>
     <p>During this phase you set up and develop your Android Studio project and application modules,
     which contain all of the source code and resource files for your application. For more
     information, see
-    <a href="{@docRoot}tools/workflow/projects/index.html">Create an Android project</a>.</p>
+    <a href="{@docRoot}tools/projects/index.html">Create an Android project</a>.</p>
   </li>
   <li><strong>Building, Debugging and Testing</strong>
     <p>During this phase you build your project into a debuggable <code>.apk</code> package(s) 
@@ -47,7 +47,7 @@
     that provides flexibility, customized build variants, dependency resolution, and much more. 
     If you're using another IDE, you can build your project using Gradle and install it on a device 
     using <a href="{@docRoot}tools/help/adb.html">adb</a>. For more information, see
-    <a href="{@docRoot}tools/workflow/building/index.html">Build and run your application</a>.</p>
+    <a href="{@docRoot}tools/building/index.html">Build and run your application</a>.</p>
     <p>Next, with Android Studio you debug your application using the
     <a href="{@docRoot}tools/help/monitor.html">Android Debug Monitor</a> and device log messages
     (<a href="{@docRoot}tools/help/logcat.html">logact</a>) along with the IntelliJ IDEA intelligent
diff --git a/docs/html/training/enterprise/app-compatibility.jd b/docs/html/training/enterprise/app-compatibility.jd
new file mode 100644
index 0000000..1ae1ee3
--- /dev/null
+++ b/docs/html/training/enterprise/app-compatibility.jd
@@ -0,0 +1,274 @@
+page.title=Ensuring Compatibility with Managed Profiles
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#prevent_failed_intents">Prevent Failed Intents</a></li>
+ <li><a href="#sharing_files">Share Files Across Profiles</a></li>
+ <li><a href="#testing_apps">Test your App for Compatibility with Managed
+    Profiles</a></li>
+</ol>
+
+<!-- related docs (NOT javadocs) -->
+<h2>Resources</h2>
+<ul>
+  <li><a href="{@docRoot}samples/BasicManagedProfile/index.html">BasicManagedProfile</a></li>
+</ul>
+
+</div>
+</div>
+
+<p>The Android platform allows devices to have
+<a href="{@docRoot}about/versions/android-5.0.html#Enterprise">managed
+profiles</a>. A managed profile is controlled by an administrator, and the
+functionality available to it is set separately from the functionality of the
+user's primary profile. This approach lets enterprises control the environment
+where company-specific apps and data are running on a user's device, while still
+letting users use their personal apps and profiles.</p>
+
+<p>This lesson shows you how to modify your application so it functions
+reliably on a device with managed profiles. You don't need to do anything
+besides the ordinary app-development best practices. However, some of these best
+practices become especially important on devices with managed profiles. This
+document highlights the issues you need to be aware of.</p>
+
+<h2 id="overview">Overview</h2>
+
+<p>Users often want to use their personal devices in an enterprise setting. This
+situation can present enterprises with a dilemma. If the user can use their own
+device, the enterprise has to worry that confidential information (like employee
+emails and contacts) are on a device the enterprise does not control. </p>
+
+<p>To address this situation, Android 5.0 (API level 21) allows enterprises to
+set up <i>managed profiles</i>. If a device has a managed profile, the profile's
+settings are under the control of the enterprise administrator. The
+administrator can choose which apps are allowed for that profile, and can
+control just what device features are available to the profile.</p>
+
+<p>If a device has a managed profile, there are implications for apps
+running on the device, no matter which profile the app is running under:</p>
+
+<ul>
+
+<li>By default, most intents do not cross from one profile to the other. If an
+app running on profile fires an intent, there is no handler for the intent on
+that profile, and the intent is not allowed to cross to the other profile
+due to profile restrictions, the request fails and the app may shut down
+unexpectedly.</li>
+<li>The profile administrator can limit which system apps are available on the
+managed profile. This restriction can also result in there being no handler for
+some common intents on the managed profile.</li>
+<li>Since the managed and unmanaged profiles have separate storage areas, a
+file URI that is valid on one profile is not valid on the other. Any
+intent fired on one profile might be handled on the other (depending on profile
+settings), so it is not safe to attach file URIs to intents.</li>
+
+</ul>
+
+<h2 id="prevent_failed_intents">Prevent Failed Intents</h2>
+
+<p>On a device with a managed profile, there are restrictions on whether intents
+can cross from one profile to another.  In most cases, when an intent is fired
+off, it is handled on the same profile where it is fired. If there is no handler
+for the intent <em>on that profile</em>, the intent is not handled and the app
+that fired it may shut down unexpectedly&mdash;even if there's a handler for the
+intent on the other profile.</p>
+
+<p>The profile administrator can choose which intents are
+allowed to cross from one profile to another. Since the administrator makes
+this decision, there's no way for you
+to know in advance <em>which</em> intents are allowed to cross this boundary. The
+administrator sets this policy, and is free to change it at any time.</p>
+
+<p>Before your app starts an activity, you should verify that there is a
+suitable resolution. You
+can verify  that there is an acceptable resolution by calling {@link
+android.content.Intent#resolveActivity Intent.resolveActivity()}. If there is no
+way to resolve the intent, the method returns
+<code>null</code>. If the method returns non-null, there is at least one way to
+resolve the intent, and it is safe to fire off the intent. In this case, the
+intent could be resolvable either
+because there is a handler on the current profile, or because the intent is
+allowed to cross to a handler on the other profile. (For more information about
+resolving intents, see <a
+href="{@docRoot}guide/components/intents-common.html">Common Intents</a>.)</p>
+
+<p>For example, if your app needs to set timers,  it would need to check that
+there's a valid handler for the {@link
+android.provider.AlarmClock#ACTION_SET_TIMER} intent. If the app cannot resolve
+the intent, it should take an appropriate action (such as showing an error
+message).</p>
+
+<pre>public void startTimer(String message, int seconds) {
+
+    // Build the "set timer" intent
+    Intent timerIntent = new Intent(AlarmClock.ACTION_SET_TIMER)
+            .putExtra(AlarmClock.EXTRA_MESSAGE, message)
+            .putExtra(AlarmClock.EXTRA_LENGTH, seconds)
+            .putExtra(AlarmClock.EXTRA_SKIP_UI, true);
+
+    // Check if there's a handler for the intent
+    <strong>if (timerIntent.resolveActivity(getPackageManager()) == null)</strong> {
+
+        // Can't resolve the intent! Fail this operation cleanly
+        // (perhaps by showing an error message)
+
+    } else {
+        // Intent resolves, it's safe to fire it off
+        startActivity(timerIntent);
+
+    }
+}
+</pre>
+
+<h2 id="sharing_files">Share Files Across Profiles</h2>
+
+<p>Sometimes an app needs to provide other apps with access to its own files.
+For example, an image gallery app might want to share its images with image
+editors. There are two ways you would ordinarily share a file: with a <em>file
+URI</em> or a <em>content URI</em>.</p>
+
+<p>A file URI begins with the <code>file:</code> prefix, followed by the
+absolute path of the file on the device's storage. However, because the
+managed profile and the personal profile use separate storage areas, a file URI
+that is valid on one profile is not valid on the other. This situation
+means that if you
+attach a file URI to an intent, and the intent is handled on the other profile,
+the handler is not able to access the file.</p>
+
+<p>Instead, you should share files with <em>content URIs</em>. Content URIs
+identify the file in a more secure, shareable fashion. The content URI contains
+the file path, but also the authority that provides the file, and an ID number
+identifying the file. You can generate a content ID for any file by using a
+{@link android.support.v4.content.FileProvider}. You can then share that content
+ID with other apps (even on the other profile). The recipient can use the
+content ID to get access to the actual file.</p>
+
+<p>For example, here's how you would get the content URI for a specific file
+URI:</p>
+
+<pre>// Open File object from its file URI
+File fileToShare = new File(<em>fileUriToShare</em>);
+
+Uri contentUriToShare = FileProvider.getUriForFile(getContext(),
+        <em>"com.example.myapp.fileprovider"</em>, fileToShare);</pre>
+
+<p>When you call the {@link
+android.support.v4.content.FileProvider#getUriForFile getUriForFile()} method,
+you must include the file provider's authority (in this example,
+<code>"com.example.myapp.fileprovider"</code>), which is specified in the
+<a href="{@docRoot}guide/topics/manifest/provider-element.html"><code>&lt;provider&gt;</code></a>
+element of your app manifest.
+For more information about sharing files with content URIs, see
+<a href="{@docRoot}training/secure-file-sharing/index.html">Sharing
+Files</a>.</p>
+
+<h2 id="testing_apps">Test your App for Compatibility with Managed Profiles</h2>
+
+<p>You should test your app in a managed-profile environment to
+catch problems that would cause your app to fail on a device with
+managed profiles. In particular, testing on a managed-profile device is a good
+way to make sure that your app handles intents properly: not firing intents that
+can't be handled, not attaching URIs that don't work cross-profile, and so
+on.</p>
+
+<p>We have provided a sample app, <a
+href="{@docRoot}samples/BasicManagedProfile/index.html">BasicManagedProfile</a>,
+which you can use to set up a managed profile on an Android device that runs
+Android 5.0 (API level 21) and higher. This app offers you a simple way to test
+your app in a managed-profile environment. You can also use this app to
+configure the managed profile as follows:</p>
+
+<ul>
+
+  <li>Specify which default apps are available on the managed
+    profile</li>
+
+  <li>Configure which intents are allowed to cross from one profile to
+    the other</li>
+
+</ul>
+
+<p>If you manually install an app over a USB cable to a device which has a
+managed profile, the app is installed on both the managed and the unmanaged
+profile. Once you have installed the app, you can test the app under the
+following conditions:</p>
+
+<ul>
+
+  <li>If an intent would ordinarily be handled by a default app (for example,
+    the camera app), try disabling that default app on the managed profile, and
+    verify that the app handles this appropriately.</li>
+
+  <li>If you fire an intent expecting it to be handled by some other app, try
+enabling and disabling that   intent's permission to cross from one profile to
+another. Verify that the app behaves properly under both circumstances. If the
+intent is not allowed to cross between profiles, verify the app's behavior both
+when there is a suitable handler on the app's profile, and when there is not.
+For example, if your app fires a map-related intent, try each of the following
+scenarios:
+
+    <ul>
+
+<li>The device allows map intents to cross from one profile to the other, and
+there is a suitable handler on the other profile (the profile the app is not
+running on)</li>
+
+<li>The device does not allow map intents to cross between profiles, but there
+is a suitable handler on the app's profile</li>
+
+<li>The device does not allow map intents to cross between profiles, and there
+is no suitable handler for map intents on the device's profile</li>
+
+    </ul>
+  </li>
+
+<li>If you attach content to an intent, verify that the intent behaves properly
+both when it is handled on the app's profile, and when it crosses between
+profiles.</li>
+
+</ul>
+
+<h3 id="testing_tips">Testing on managed profiles: Tips and tricks</h3>
+
+<p>There are a few tricks that you may find helpful in testing on a
+managed-profile device.</p>
+
+<ul>
+
+<li>As noted,  when you side-load an app on a managed profile device, it is
+installed on both profiles. If you wish, you can delete the app from one profile
+and leave it on the other.</li>
+
+<li>Most of the activity manager commands available in the <a
+href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a> (adb) shell
+support the <code>--user</code> flag, which lets you specify which user to run
+as. By specifying a user, you can choose whether to run as the unmanaged or
+managed profile. For
+more information, see <a href="{@docRoot}tools/help/adb.html#am">Android Debug
+Bridge: Using activity manager (am)</a>.</li>
+
+<li>To find the active users on a device, use the adb package manager's
+<code>list users</code> command. The first number in the output string is the
+user ID, which you can use with the <code>--user</code> flag.  For more
+information, see <a href="{@docRoot}tools/help/adb.html#pm">Android Debug
+Bridge: Using package manager (pm)</a>.</li>
+
+</ul>
+
+<p>For example, to find the users on a device, you would run this command:</p>
+
+<pre class="no-pretty-print">$ <strong>adb shell pm list users</strong>
+UserInfo{0:Drew:13} running
+UserInfo{10:Work profile:30} running</pre>
+
+<p>In this case, the unmanaged profile ("Drew") has the user ID 0, and the
+managed profile has the user  ID 10. To run an app in the work profile, you
+would use a command like this:</p>
+
+<pre class="no-pretty-print">$ adb shell am start --user 10 \
+-n "<em>com.example.myapp/com.example.myapp.testactivity</em>" \
+-a android.intent.action.MAIN -c android.intent.category.LAUNCHER</pre>
diff --git a/docs/html/training/enterprise/index.jd b/docs/html/training/enterprise/index.jd
index 2926f71..0ac68cc 100644
--- a/docs/html/training/enterprise/index.jd
+++ b/docs/html/training/enterprise/index.jd
@@ -47,4 +47,12 @@
 Policies</a></b></dt>
     <dd>In this lesson, you will learn how to create a security-aware application that manages
 access to its content by enforcing device management policies</dd>
+
+  <dt><b><a href="app-compatibility.html">Ensuring Compatibility with Managed Profiles</a></b></dt>
+
+    <dd>In this lesson, you will learn the best practices to follow to ensure
+      that your app functions properly on devices that use <a
+      href="{@docRoot}about/versions/android-5.0.html#Enterprise">managed
+      profiles</a></dd>
+
 </dl>
diff --git a/docs/html/training/location/receive-location-updates.jd b/docs/html/training/location/receive-location-updates.jd
index e6e8c51..208dc17 100644
--- a/docs/html/training/location/receive-location-updates.jd
+++ b/docs/html/training/location/receive-location-updates.jd
@@ -1,612 +1,417 @@
 page.title=Receiving Location Updates
 trainingnavtop=true
 @jd:body
+
 <div id="tb-wrapper">
-<div id="tb">
+  <div id="tb">
 
-<h2>This lesson teaches you to</h2>
-<ol>
-    <li><a href="#Permissions">Request Location Permission</a></li>
-    <li><a href="#PlayServices">Check for Google Play Services</a></li>
-    <li><a href="#DefineCallbacks">Define Location Services Callbacks</a></li>
-    <li><a href="#UpdateParameters">Specify Update Parameters</a></li>
-    <li><a href="#StartUpdates">Start Location Updates</a></li>
-    <li><a href="#StopUpdates">Stop Location Updates</a></li>
-</ol>
+  <h2>This lesson teaches you how to</h2>
+  <ol>
+    <li><a href="#connect">Connect to Location Services</a></li>
+    <li><a href="#location-request">Set Up a Location Request</a></li>
+    <li><a href="#updates">Request Location Updates</a></li>
+    <li><a href="#callback">Define the Location Update Callback</a></li>
+    <li><a href="#stop-updates">Stop Location Updates</a></li>
+    <li><a href="#save-state">Save the State of the Activity</a></li>
+  </ol>
 
-<h2>You should also read</h2>
-<ul>
+  <h2>You should also read</h2>
+  <ul>
     <li>
-        <a href="{@docRoot}google/play-services/setup.html">Setup Google Play Services SDK</a>
+      <a href="{@docRoot}google/play-services/setup.html">Setting up Google Play
+      Services</a>
     </li>
     <li>
-        <a href="retrieve-current.html">Retrieving the Current Location</a>
+      <a href="retrieve-current.html">Getting the Last Known Location</a>
     </li>
- </ul>
+   </ul>
 
-<h2>Try it out</h2>
+  <h2>Try it out</h2>
 
-<div class="download-box">
-  <a href="http://developer.android.com/shareables/training/LocationUpdates.zip" class="button">Download the sample</a>
-  <p class="filename">LocationUpdates.zip</p>
+    <ul>
+      <li>
+        <a href="https://github.com/googlesamples/android-play-location/tree/master/LocationUpdates" class="external-link">LocationUpdates</a>
+      </li>
+    </ul>
+  </div>
 </div>
 
-</div>
-</div>
+<p>If your app can continuously track location, it can deliver more relevant
+  information to the user. For example, if your app helps the user find their
+  way while walking or driving, or if your app tracks the location of assets, it
+  needs to get the location of the device at regular intervals. As well as the
+  geographical location (latitude and longitude), you may want to give the user
+  further information such as the bearing (horizontal direction of travel),
+  altitude, or velocity of the device. This information, and more, is available
+  in the {@link android.location.Location} object that your app can retrieve
+  from the
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html">fused
+  location provider</a>.</p>
 
-<p>
-    If your app does navigation or tracking, you probably want to get the user's
-    location at regular intervals. While you can do this with
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html#getLastLocation()">LocationClient.getLastLocation()</a></code>,
-    a more direct approach is to request periodic updates from Location Services. In
-    response, Location Services automatically updates your app with the best available location,
-    based on the currently-available location providers such as WiFi and GPS.
-</p>
-<p>
-    To get periodic location updates from Location Services, you send a request using a location
-    client. Depending on the form of the request, Location Services either invokes a callback
-    method and passes in a {@link android.location.Location} object, or issues an
-    {@link android.content.Intent} that contains the location in its extended data. The accuracy and
-    frequency of the updates are affected by the location permissions you've requested and the
-    parameters you pass to Location Services with the request.
-</p>
-<!-- Request permission -->
-<h2 id="Permissions">Specify App Permissions</h2>
-<p>
-    Apps that use Location Services must request location permissions. Android has two location
-    permissions, {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION}
-    and {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION}. The
-    permission you choose affects the accuracy of the location updates you receive.
-    For example, If you request only coarse location permission, Location Services obfuscates the
-    updated location to an accuracy that's roughly equivalent to a city block.
-</p>
-<p>
-    Requesting {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION} implies
-    a request for {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION}.
-</p>
-<p>
-    For example, to add the coarse location permission to your manifest, insert the following as a
-    child element of
-    the
-<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
-    element:
-</p>
+<p>While you can get a device's location with
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)">{@code getLastLocation()}</a>,
+  as illustrated in the lesson on
+  <a href="retrieve-current.html">Getting the Last Known Location</a>,
+  a more direct approach is to request periodic updates from the fused location
+  provider. In response, the API updates your app periodically with the best
+  available location, based on the currently-available location providers such
+  as WiFi and GPS (Global Positioning System). The accuracy of the location is
+  determined by the providers, the location permissions you've requested, and
+  the options you set in the location request.</p>
+
+<p>This lesson shows you how to request regular updates about a device's
+  location using the
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener)">{@code requestLocationUpdates()}</a>
+  method in the fused location provider.
+
+<h2 id="connect">Connect to Location Services</h2>
+
+<p>Location services for apps are provided through Google Play services and the
+  fused location provider. In order to use these services, you connect your app
+  using the Google API Client and then request location updates. For details on
+  connecting with the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a>,
+  follow the instructions in
+  <a href="retrieve-current.html">Getting the Last Known Location</a>, including
+  requesting the current location.</p>
+
+<p>The last known location of the device provides a handy base from which to
+  start, ensuring that the app has a known location before starting the
+  periodic location updates. The lesson on
+  <a href="retrieve-current.html">Getting the Last Known Location</a> shows you
+  how to get the last known location by calling
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)">{@code getLastLocation()}</a>.
+  The snippets in the following sections assume that your app has already
+  retrieved the last known location and stored it as a
+  {@link android.location.Location} object in the global variable
+  {@code mCurrentLocation}.</p>
+
+<p>Apps that use location services must request location permissions. In this
+  lesson you require fine location detection, so that your app can get as
+  precise a location as possible from the available location providers. Request
+  this permission with the
+  {@code uses-permission} element in your app manifest, as shown in the
+  following example:</p>
+
 <pre>
-&lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
-</pre>
-<!-- Check for Google Play services -->
-<h2 id="PlayServices">Check for Google Play Services</h2>
-<p>
-    Location Services is part of the Google Play services APK. Since it's hard to anticipate the
-    state of the user's device, you should always check that the APK is installed before you attempt
-    to connect to Location Services. To check that the APK is installed, call
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#isGooglePlayServicesAvailable(android.content.Context)">GooglePlayServicesUtil.isGooglePlayServicesAvailable()</a></code>,
-    which returns one of the
-    integer result codes listed in the API reference documentation. If you encounter an error,
-    call
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getErrorDialog(int, android.app.Activity, int)">GooglePlayServicesUtil.getErrorDialog()</a></code>
-    to retrieve localized dialog that prompts users to take the correct action, then display
-    the dialog in a {@link android.support.v4.app.DialogFragment}. The dialog may allow the
-    user to correct the problem, in which case Google Play services may send a result back to your
-    activity. To handle this result, override the method
-    {@link android.support.v4.app.FragmentActivity#onActivityResult onActivityResult()}
+&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.google.android.gms.location.sample.locationupdates" &gt;
 
-</p>
-<p class="note">
-    <strong>Note:</strong> To make your app compatible with
-    platform version 1.6 and later, the activity that displays the
-    {@link android.support.v4.app.DialogFragment} must subclass
-    {@link android.support.v4.app.FragmentActivity} instead of {@link android.app.Activity}. Using
-    {@link android.support.v4.app.FragmentActivity} also allows you to call
-    {@link android.support.v4.app.FragmentActivity#getSupportFragmentManager
-    getSupportFragmentManager()} to display the {@link android.support.v4.app.DialogFragment}.
-</p>
-<p>
-    Since you usually need to check for Google Play services in more than one place in your code,
-    define a method that encapsulates the check, then call the method before each connection
-    attempt. The following snippet contains all of the code required to check for Google
-    Play services:
-</p>
-<pre>
-public class MainActivity extends FragmentActivity {
-    ...
-    // Global constants
-    /*
-     * Define a request code to send to Google Play services
-     * This code is returned in Activity.onActivityResult
-     */
-    private final static int
-            CONNECTION_FAILURE_RESOLUTION_REQUEST = 9000;
-    ...
-    // Define a DialogFragment that displays the error dialog
-    public static class ErrorDialogFragment extends DialogFragment {
-        // Global field to contain the error dialog
-        private Dialog mDialog;
-        // Default constructor. Sets the dialog field to null
-        public ErrorDialogFragment() {
-            super();
-            mDialog = null;
-        }
-        // Set the dialog to display
-        public void setDialog(Dialog dialog) {
-            mDialog = dialog;
-        }
-        // Return a Dialog to the DialogFragment.
-        &#64;Override
-        public Dialog onCreateDialog(Bundle savedInstanceState) {
-            return mDialog;
-        }
-    }
-    ...
-    /*
-     * Handle results returned to the FragmentActivity
-     * by Google Play services
-     */
-    &#64;Override
-    protected void onActivityResult(
-            int requestCode, int resultCode, Intent data) {
-        // Decide what to do based on the original request code
-        switch (requestCode) {
-            ...
-            case CONNECTION_FAILURE_RESOLUTION_REQUEST :
-            /*
-             * If the result code is Activity.RESULT_OK, try
-             * to connect again
-             */
-                switch (resultCode) {
-                    case Activity.RESULT_OK :
-                    /*
-                     * Try the request again
-                     */
-                    ...
-                    break;
-                }
-            ...
-        }
-        ...
-    }
-    ...
-    private boolean servicesConnected() {
-        // Check that Google Play services is available
-        int resultCode =
-                GooglePlayServicesUtil.
-                        isGooglePlayServicesAvailable(this);
-        // If Google Play services is available
-        if (ConnectionResult.SUCCESS == resultCode) {
-            // In debug mode, log the status
-            Log.d("Location Updates",
-                    "Google Play services is available.");
-            // Continue
-            return true;
-        // Google Play services was not available for some reason
-        } else {
-            // Get the error code
-            int errorCode = connectionResult.getErrorCode();
-            // Get the error dialog from Google Play services
-            Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(
-                    errorCode,
-                    this,
-                    CONNECTION_FAILURE_RESOLUTION_REQUEST);
-            // If Google Play services can provide an error dialog
-            if (errorDialog != null) {
-                // Create a new DialogFragment for the error dialog
-                ErrorDialogFragment errorFragment =
-                        new ErrorDialogFragment();
-                // Set the dialog in the DialogFragment
-                errorFragment.setDialog(errorDialog);
-                // Show the error dialog in the DialogFragment
-                errorFragment.show(
-                        getSupportFragmentManager(),
-                        "Location Updates");
-            }
-        }
-    }
-    ...
-}
+  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
+&lt;/manifest&gt;
 </pre>
-<p>
-    Snippets in the following sections call this method to verify that Google Play services is
-    available.
-</p>
-<!--
-    Define Location Services Callbacks
- -->
-<h2 id="DefineCallbacks">Define Location Services Callbacks</h2>
-<p>
-    Before you request location updates, you must first implement the interfaces that Location
-    Services uses to communicate connection status to your app:
-</p>
+
+<h2 id="location-request">Set Up a Location Request</h2>
+
+<p>To store parameters for requests to the fused location provider, create a
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html">{@code LocationRequest}</a>.
+  The parameters determine the levels of accuracy requested. For details of all
+  the options available in the location request, see the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html">{@code LocationRequest}</a>
+  class reference. This lesson sets the update interval, fastest update
+  interval, and priority, as described below:</p>
+
 <dl>
-    <dt>
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.ConnectionCallbacks.html">ConnectionCallbacks</a></code>
-    </dt>
-    <dd>
-        Specifies methods that Location Services calls when a location client is connected or
-        disconnected.
-    </dd>
-    <dt>
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.OnConnectionFailedListener.html">OnConnectionFailedListener</a></code>
-    </dt>
-    <dd>
-        Specifies a method that Location Services calls if an error occurs while attempting to
-        connect the location client. This method uses the previously-defined {@code showErrorDialog}
-        method to display an error dialog that attempts to fix the problem using Google Play
-        services.
-    </dd>
+  <dt>
+    Update interval
+  </dt>
+  <dd>
+    <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">{@code setInterval()}</a>
+    - This method sets the rate in milliseconds at which your app prefers to
+    receive location updates. Note that the location updates may be faster than
+    this rate if another app is receiving updates at a faster rate, or slower
+    than this rate, or there may be no updates at all (if the device has no
+    connectivity, for example).
+  </dd>
+  <dt>
+    Fastest update interval
+  </dt>
+  <dd>
+    <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">{@code setFastestInterval()}</a>
+    - This method sets the <strong>fastest</strong> rate in milliseconds at which
+    your app can handle location updates. You need to set this rate because
+    other apps also affect the rate at which updates are sent. The Google Play
+    services location APIs send out updates at the fastest rate that any app
+    has requested with
+    <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">{@code setInterval()}</a>.
+    If this rate is faster
+    than your app can handle, you may encounter problems with UI flicker or data
+    overflow. To prevent this, call
+    <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">{@code setFastestInterval()}</a>
+    to set an upper limit to the update rate.
+  </dd>
+  <dt>Priority</dt>
+  <dd>
+    <p>
+      <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">{@code setPriority()}</a>
+      - This method sets the priority of the request, which gives the Google Play
+      services location services a strong hint about which location sources to use.
+      The following values are supported:</p>
+      <ul>
+        <li>
+          <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_BALANCED_POWER_ACCURACY">{@code PRIORITY_BALANCED_POWER_ACCURACY}</a>
+          - Use this setting to request location precision to within a city
+          block, which is an accuracy of approximately 100 meters. This is
+          considered a coarse level of accuracy, and is likely to consume less
+          power. With this setting, the location services are likely to use WiFi
+          and cell tower positioning. Note, however, that the choice of location
+          provider depends on many other factors, such as which sources are
+          available.</li>
+        <li>
+          <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">{@code PRIORITY_HIGH_ACCURACY}</a>
+          - Use this setting to request the most precise location possible. With
+          this setting, the location services are more likely to use GPS
+          (Global Positioning System) to determine the location.</li>
+        <li><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_LOW_POWER">{@code PRIORITY_LOW_POWER}</a>
+          - Use this setting to request city-level precision, which is
+          an accuracy of approximately 10 kilometers. This is considered a
+          coarse level of accuracy, and is likely to consume less power.</li>
+        <li><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_NO_POWER">{@code PRIORITY_NO_POWER}</a>
+          - Use this setting if you need negligible impact on power consumption,
+          but want to receive location updates when available. With this
+          setting, your app does not trigger any location updates, but
+          receives locations triggered by other apps.</li>
+      </ul>
+  </dd>
 </dl>
-<p>
-    The following snippet shows how to specify the interfaces and define the methods:
-</p>
+
+<p>Create the location request and set the parameters as shown in this
+  code sample:</p>
+
 <pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener {
-    ...
-    /*
-     * Called by Location Services when the request to connect the
-     * client finishes successfully. At this point, you can
-     * request the current location or start periodic updates
-     */
-    &#64;Override
-    public void onConnected(Bundle dataBundle) {
-        // Display the connection status
-        Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
-    }
-    ...
-    /*
-     * Called by Location Services if the connection to the
-     * location client drops because of an error.
-     */
-    &#64;Override
-    public void onDisconnected() {
-        // Display the connection status
-        Toast.makeText(this, "Disconnected. Please re-connect.",
-                Toast.LENGTH_SHORT).show();
-    }
-    ...
-    /*
-     * Called by Location Services if the attempt to
-     * Location Services fails.
-     */
-    &#64;Override
-    public void onConnectionFailed(ConnectionResult connectionResult) {
-        /*
-         * Google Play services can resolve some errors it detects.
-         * If the error has a resolution, try sending an Intent to
-         * start a Google Play services activity that can resolve
-         * error.
-         */
-        if (connectionResult.hasResolution()) {
-            try {
-                // Start an Activity that tries to resolve the error
-                connectionResult.startResolutionForResult(
-                        this,
-                        CONNECTION_FAILURE_RESOLUTION_REQUEST);
-                /*
-                * Thrown if Google Play services canceled the original
-                * PendingIntent
-                */
-            } catch (IntentSender.SendIntentException e) {
-                // Log the error
-                e.printStackTrace();
-            }
-        } else {
-            /*
-             * If no resolution is available, display a dialog to the
-             * user with the error.
-             */
-            showErrorDialog(connectionResult.getErrorCode());
-        }
-    }
-    ...
+protected void createLocationRequest() {
+    LocationRequest mLocationRequest = new LocationRequest();
+    mLocationRequest.setInterval(10000);
+    mLocationRequest.setFastestInterval(5000);
+    mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
 }
 </pre>
-<h3>Define the location update callback</h3>
-<p>
-    Location Services sends location updates to your app either as an {@link android.content.Intent}
-    or as an argument passed to a callback method you define. This lesson shows you how to get the
-    update using a callback method, because that pattern works best for most use cases. If you want
-    to receive updates in the form of an {@link android.content.Intent}, read the lesson
-    <a href="activity-recognition.html">Recognizing the User's Current Activity</a>, which
-    presents a similar pattern.
-</p>
-<p>
-    The callback method that Location Services invokes to send a location update to your app is
-    specified in the
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">LocationListener</a></code>
-    interface, in the method
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html#onLocationChanged(android.location.Location)">onLocationChanged()</a></code>.
-    The incoming argument is a {@link android.location.Location} object containing the location's
-    latitude and longitude. The following snippet shows how to specify the interface and define
-    the method:
-</p>
+
+<p>The priority of
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">{@code PRIORITY_HIGH_ACCURACY}</a>,
+  combined with the
+  {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION}
+  permission setting that you've defined in the app manifest, and a fast update
+  interval of 5000 milliseconds (5 seconds), causes the fused location
+  provider to return location updates that are accurate to within a few feet.
+  This approach is appropriate for mapping apps that display the location in
+  real time.</p>
+
+<p class="note"><strong>Performance hint:</strong> If your app accesses the
+  network or does other long-running work after receiving a location update,
+  adjust the fastest interval to a slower value. This adjustment prevents your
+  app from receiving updates it can't use. Once the long-running work is done,
+  set the fastest interval back to a fast value.</p>
+
+<h2 id="updates">Request Location Updates</h2>
+
+<p>Now that you've set up a location request containing your app's requirements
+  for the location updates, you can start the regular updates by calling
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener)">{@code requestLocationUpdates()}</a>.
+  Do this in the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks.html#onConnected(android.os.Bundle)">{@code onConnected()}</a>
+  callback provided by Google API Client, which is called when the client is
+  ready.</p>
+
+<p>Depending on the form of the request, the fused location provider either
+  invokes the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener.onLocationChanged()}</a>
+  callback method and passes it a {@link android.location.Location} object, or
+  issues a
+  <a href="{@docRoot}reference/android/app/PendingIntent.html">{@code PendingIntent}</a>
+  that contains the location in its extended data. The accuracy and frequency of
+  the updates are affected by the location permissions you've requested and the
+  options you set in the location request object.</p>
+
+<p>This lesson shows you how to get the update using the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener}</a>
+  callback approach. Call
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener)">{@code requestLocationUpdates()}</a>,
+  passing it your instance of the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a>,
+  the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html">{@code LocationRequest}</a>
+  object,
+  and a <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener}</a>.
+  Define a {@code startLocationUpdates()} method, called from the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks.html#onConnected(android.os.Bundle)">{@code onConnected()}</a>
+  callback, as shown in the following code sample:</p>
+
 <pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener,
-        LocationListener {
+&#64;Override
+public void onConnected(Bundle connectionHint) {
     ...
-    // Define the callback method that receives location updates
+    if (mRequestingLocationUpdates) {
+        startLocationUpdates();
+    }
+}
+
+protected void startLocationUpdates() {
+    LocationServices.FusedLocationApi.requestLocationUpdates(
+            mGoogleApiClient, mLocationRequest, this);
+}
+</pre>
+
+<p>Notice that the above code snippet refers to a boolean flag,
+  {@code mRequestingLocationUpdates}, used to track whether the user has
+  turned location updates on or off. For more about retaining the value of this
+  flag across instances of the activity, see
+  <a href="#save-state">Save the State of the Activity</a>.
+
+<h2 id="callback">Define the Location Update Callback</h2>
+
+<p>The fused location provider invokes the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html#onLocationChanged(android.location.Location)">{@code LocationListener.onLocationChanged()}</a>
+  callback method. The incoming argument is a {@link android.location.Location}
+  object containing the location's latitude and longitude. The following snippet
+  shows how to implement the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener}</a>
+  interface and define the method, then get the timestamp of the location update
+  and display the latitude, longitude and timestamp on your app's user
+  interface:</p>
+
+<pre>
+public class MainActivity extends ActionBarActivity implements
+        ConnectionCallbacks, OnConnectionFailedListener, LocationListener {
+    ...
     &#64;Override
     public void onLocationChanged(Location location) {
-        // Report to the UI that the location was updated
-        String msg = "Updated Location: " +
-                Double.toString(location.getLatitude()) + "," +
-                Double.toString(location.getLongitude());
-        Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
+        mCurrentLocation = location;
+        mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());
+        updateUI();
     }
-    ...
-}
-</pre>
-<p>
-    Now that you have the callbacks prepared, you can set up the request for location updates.
-    The first step is to specify the parameters that control the updates.
-</p>
-<!-- Specify update parameters -->
-<h2 id="UpdateParameters">Specify Update Parameters</h2>
-<p>
-    Location Services allows you to control the interval between updates and the location accuracy
-    you want, by setting the values in a
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></code>
-    object and then sending this object as part of your request to start updates.
-</p>
-<p>
-    First, set the following interval parameters:
-</p>
-<dl>
-    <dt>
-        Update interval
-    </dt>
-    <dd>
-        Set by
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">LocationRequest.setInterval()</a></code>.
-        This method sets the rate in milliseconds at which your app prefers to receive location
-        updates. If no other apps are receiving updates from Location Services, your app will
-        receive updates at this rate.
-    </dd>
-    <dt>
-        Fastest update interval
-    </dt>
-    <dd>
-        Set by
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">LocationRequest.setFastestInterval()</a></code>.
-        This method sets the <b>fastest</b> rate in milliseconds at which your app can handle
-        location updates. You need to set this rate because other apps also affect the rate
-        at which updates are sent. Location Services sends out updates at the fastest rate that any
-        app requested by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">LocationRequest.setInterval()</a></code>.
-        If this rate is faster than your app can handle, you may encounter problems with UI flicker
-        or data overflow. To prevent this, call
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">LocationRequest.setFastestInterval()</a></code>
-        to set an upper limit to the update rate.
-        <p>
-            Calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">LocationRequest.setFastestInterval()</a></code>
-            also helps to save power. When you request a preferred update rate by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">LocationRequest.setInterval()</a></code>,
-            and a maximum rate by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">LocationRequest.setFastestInterval()</a></code>,
-            then your app gets the same update rate as the fastest rate in the system. If other
-            apps have requested a faster rate, you get the benefit of a faster rate. If no other
-            apps have a faster rate request outstanding, your app receives updates at the rate you specified
-        with
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">LocationRequest.setInterval()</a></code>.
-        </p>
-    </dd>
-</dl>
-<p>
-    Next, set the accuracy parameter. In a foreground app, you need constant location updates with
-    high accuracy, so use the setting
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">LocationRequest.PRIORITY_HIGH_ACCURACY</a></code>.
-</p>
-<p>
-    The following snippet shows how to set the update interval and accuracy in
-    {@link android.support.v4.app.FragmentActivity#onCreate onCreate()}:
-</p>
-<pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener,
-        LocationListener {
-    ...
-    // Global constants
-    ...
-    // Milliseconds per second
-    private static final int MILLISECONDS_PER_SECOND = 1000;
-    // Update frequency in seconds
-    public static final int UPDATE_INTERVAL_IN_SECONDS = 5;
-    // Update frequency in milliseconds
-    private static final long UPDATE_INTERVAL =
-            MILLISECONDS_PER_SECOND * UPDATE_INTERVAL_IN_SECONDS;
-    // The fastest update frequency, in seconds
-    private static final int FASTEST_INTERVAL_IN_SECONDS = 1;
-    // A fast frequency ceiling in milliseconds
-    private static final long FASTEST_INTERVAL =
-            MILLISECONDS_PER_SECOND * FASTEST_INTERVAL_IN_SECONDS;
-    ...
-    // Define an object that holds accuracy and frequency parameters
-    LocationRequest mLocationRequest;
-    ...
-    &#64;Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        // Create the LocationRequest object
-        mLocationRequest = LocationRequest.create();
-        // Use high accuracy
-        mLocationRequest.setPriority(
-                LocationRequest.PRIORITY_HIGH_ACCURACY);
-        // Set the update interval to 5 seconds
-        mLocationRequest.setInterval(UPDATE_INTERVAL);
-        // Set the fastest update interval to 1 second
-        mLocationRequest.setFastestInterval(FASTEST_INTERVAL);
-        ...
-    }
-    ...
-}
-</pre>
-<p class="note">
-   <strong>Note:</strong> If your app accesses the network or does other long-running work after
-   receiving a location update, adjust the fastest interval to a slower value. This prevents your
-   app from receiving updates it can't use. Once the long-running work is done, set the fastest
-   interval back to a fast value.
-</p>
-<!-- Start Location Updates -->
-<h2 id="StartUpdates">Start Location Updates</h2>
-<p>
-    To send the request for location updates, create a location client in
-    {@link android.support.v4.app.FragmentActivity#onCreate onCreate()}, then connect it and make
-    the request by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html#requestLocationUpdates(com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener)">requestLocationUpdates()</a></code>.
-    Since your client must be connected for your app to receive updates, you should
-    connect the client in
-    {@link android.support.v4.app.FragmentActivity#onStart onStart()}. This ensures that you always
-    have a valid, connected client while your app is visible. Since you need a connection before you
-    can request updates, make the update request in
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.ConnectionCallbacks.html#onConnected(android.os.Bundle)">ConnectionCallbacks.onConnected()</a></code>
-</p>
-<p>
-    Remember that the user may want to turn off location updates for various reasons. You should
-    provide a way for the user to do this, and you should ensure that you don't start updates in
-    {@link android.support.v4.app.FragmentActivity#onStart onStart()} if updates were previously
-    turned off. To track the user's preference, store it in your app's
-    {@link android.content.SharedPreferences} in
-    {@link android.support.v4.app.FragmentActivity#onPause onPause()} and retrieve it in
-    {@link android.support.v4.app.FragmentActivity#onResume onResume()}.
-</p>
-<p>
-    The following snippet shows how to set up the client in
-    {@link android.support.v4.app.FragmentActivity#onCreate onCreate()}, and how to connect it
-    and request updates in {@link android.support.v4.app.FragmentActivity#onStart onStart()}:
-</p>
-<pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener,
-        LocationListener {
-    ...
-    // Global variables
-    ...
-    LocationClient mLocationClient;
-    boolean mUpdatesRequested;
-    ...
-    &#64;Override
-    protected void onCreate(Bundle savedInstanceState) {
-        ...
-        // Open the shared preferences
-        mPrefs = getSharedPreferences("SharedPreferences",
-                Context.MODE_PRIVATE);
-        // Get a SharedPreferences editor
-        mEditor = mPrefs.edit();
-        /*
-         * Create a new location client, using the enclosing class to
-         * handle callbacks.
-         */
-        mLocationClient = new LocationClient(this, this, this);
-        // Start with updates turned off
-        mUpdatesRequested = false;
-        ...
-    }
-    ...
-    &#64;Override
-    protected void onPause() {
-        // Save the current setting for updates
-        mEditor.putBoolean("KEY_UPDATES_ON", mUpdatesRequested);
-        mEditor.commit();
-        super.onPause();
-    }
-    ...
-    &#64;Override
-    protected void onStart() {
-        ...
-        mLocationClient.connect();
-    }
-    ...
-    &#64;Override
-    protected void onResume() {
-        /*
-         * Get any previous setting for location updates
-         * Gets "false" if an error occurs
-         */
-        if (mPrefs.contains("KEY_UPDATES_ON")) {
-            mUpdatesRequested =
-                    mPrefs.getBoolean("KEY_UPDATES_ON", false);
 
-        // Otherwise, turn off location updates
-        } else {
-            mEditor.putBoolean("KEY_UPDATES_ON", false);
-            mEditor.commit();
-        }
+    private void updateUI() {
+        mLatitudeTextView.setText(String.valueOf(mCurrentLocation.getLatitude()));
+        mLongitudeTextView.setText(String.valueOf(mCurrentLocation.getLongitude()));
+        mLastUpdateTimeTextView.setText(mLastUpdateTime);
     }
-    ...
-    /*
-     * Called by Location Services when the request to connect the
-     * client finishes successfully. At this point, you can
-     * request the current location or start periodic updates
-     */
-    &#64;Override
-    public void onConnected(Bundle dataBundle) {
-        // Display the connection status
-        Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
-        // If already requested, start periodic updates
-        if (mUpdatesRequested) {
-            mLocationClient.requestLocationUpdates(mLocationRequest, this);
-        }
-    }
-    ...
 }
 </pre>
-<p>
-    For more information about saving preferences, read
-<a href="{@docRoot}training/basics/data-storage/shared-preferences.html">Saving Key-Value Sets</a>.
-</p>
-<!--
-    Stop Location Updates
- -->
-<h2 id="StopUpdates">Stop Location Updates</h2>
-<p>
-    To stop location updates, save the state of the update flag in
-    {@link android.support.v4.app.FragmentActivity#onPause onPause()}, and stop updates in
-    {@link android.support.v4.app.FragmentActivity#onStop onStop()} by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html#removeLocationUpdates(com.google.android.gms.location.LocationListener)">removeLocationUpdates(LocationListener)</a></code>.
-    For example:
-</p>
+
+<h2 id="stop-updates">Stop Location Updates</h2>
+
+<p>Consider whether you want to stop the location updates when the activity is
+  no longer in focus, such as when the user switches to another app or to a
+  different activity in the same app. This can be handy to reduce power
+  consumption, provided the app doesn't need to collect information even when
+  it's running in the background. This section shows how you can stop the
+  updates in the activity's
+  {@link android.app.Activity#onPause onPause()} method.</p>
+
+<p>To stop location updates, call
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#removeLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationListener)">{@code removeLocationUpdates()}</a>,
+  passing it your instance of the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a>
+  object and a
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener}</a>,
+  as shown in the following code sample:</p>
+
 <pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener,
-        LocationListener {
-    ...
-    /*
-     * Called when the Activity is no longer visible at all.
-     * Stop updates and disconnect.
-     */
-    &#64;Override
-    protected void onStop() {
-        // If the client is connected
-        if (mLocationClient.isConnected()) {
-            /*
-             * Remove location updates for a listener.
-             * The current Activity is the listener, so
-             * the argument is "this".
-             */
-            removeLocationUpdates(this);
-        }
-        /*
-         * After disconnect() is called, the client is
-         * considered "dead".
-         */
-        mLocationClient.disconnect();
-        super.onStop();
-    }
-    ...
+&#64;Override
+protected void onPause() {
+    super.onPause();
+    stopLocationUpdates();
+}
+
+protected void stopLocationUpdates() {
+    LocationServices.FusedLocationApi.removeLocationUpdates(
+            mGoogleApiClient, this);
 }
 </pre>
-<p>
-    You now have the basic structure of an app that requests and receives periodic location updates.
-    You can combine the features described in this lesson with the geofencing, activity recognition,
-    or reverse geocoding features described in other lessons in this class.
-</p>
-<p>
-    The next lesson, <a href="display-address.html">Displaying a Location Address</a>, shows you how
-    to use the current location to display the current street address.
-</p>
+
+<p>Use a boolean, {@code mRequestingLocationUpdates}, to track
+  whether location updates are currently turned on. In the activity's
+  {@link android.app.Activity#onResume onResume()} method, check
+  whether location updates are currently active, and activate them if not:</p>
+
+<pre>
+&#64;Override
+public void onResume() {
+    super.onResume();
+    if (mGoogleApiClient.isConnected() && !mRequestingLocationUpdates) {
+        startLocationUpdates();
+    }
+}
+</pre>
+
+<h2 id="save-state">Save the State of the Activity</h2>
+
+<p>A change to the device's configuration, such as a change in screen
+  orientation or language, can cause the current activity to be destroyed. Your
+  app must therefore store any information it needs to recreate the activity.
+  One way to do this is via an instance state stored in a
+  {@link android.os.Bundle} object.</p>
+
+<p>The following code sample shows how to use the activity's
+  <a href="{@docRoot}reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)">{@code onSaveInstanceState()}</a>
+  callback to save the instance state:</p>
+
+<pre>
+public void onSaveInstanceState(Bundle savedInstanceState) {
+    savedInstanceState.putBoolean(REQUESTING_LOCATION_UPDATES_KEY,
+            mRequestingLocationUpdates);
+    savedInstanceState.putParcelable(LOCATION_KEY, mCurrentLocation);
+    savedInstanceState.putString(LAST_UPDATED_TIME_STRING_KEY, mLastUpdateTime);
+    super.onSaveInstanceState(savedInstanceState);
+}
+</pre>
+
+<p>Define an {@code updateValuesFromBundle()} method to restore
+  the saved values from the previous instance of the activity, if they're
+  available. Call the method from the activity's
+  {@link android.app.Activity#onCreate onCreate()} method, as shown in the
+  following code sample:</p>
+
+<pre>
+&#64;Override
+public void onCreate(Bundle savedInstanceState) {
+    ...
+    updateValuesFromBundle(savedInstanceState);
+}
+
+private void updateValuesFromBundle(Bundle savedInstanceState) {
+    if (savedInstanceState != null) {
+        // Update the value of mRequestingLocationUpdates from the Bundle, and
+        // make sure that the Start Updates and Stop Updates buttons are
+        // correctly enabled or disabled.
+        if (savedInstanceState.keySet().contains(REQUESTING_LOCATION_UPDATES_KEY)) {
+            mRequestingLocationUpdates = savedInstanceState.getBoolean(
+                    REQUESTING_LOCATION_UPDATES_KEY);
+            setButtonsEnabledState();
+        }
+
+        // Update the value of mCurrentLocation from the Bundle and update the
+        // UI to show the correct latitude and longitude.
+        if (savedInstanceState.keySet().contains(LOCATION_KEY)) {
+            // Since LOCATION_KEY was found in the Bundle, we can be sure that
+            // mCurrentLocationis not null.
+            mCurrentLocation = savedInstanceState.getParcelable(LOCATION_KEY);
+        }
+
+        // Update the value of mLastUpdateTime from the Bundle and update the UI.
+        if (savedInstanceState.keySet().contains(LAST_UPDATED_TIME_STRING_KEY)) {
+            mLastUpdateTime = savedInstanceState.getString(
+                    LAST_UPDATED_TIME_STRING_KEY);
+        }
+        updateUI();
+    }
+}
+</pre>
+
+<p>For more about saving instance state, see the
+  <a href="{@docRoot}reference/android/app/Activity.html#ConfigurationChanges">Android
+  Activity</a> class reference.</p>
+
+<p class="note"><strong>Note:</strong> For a more persistent storage, you can
+  store the user's preferences in your app's
+  {@link android.content.SharedPreferences}. Set the shared preference in
+  your activity's {@link android.app.Activity#onPause onPause()} method, and
+  retrieve the preference in {@link android.app.Activity#onResume onResume()}.
+  For more information about saving preferences, read
+  <a href="{@docRoot}training/basics/data-storage/shared-preferences.html">Saving
+  Key-Value Sets</a>.</p>
+
+<p>The next lesson,
+  <a href="display-address.html">Displaying a Location Address</a>, shows
+  you how to display the street address for a given location.</p>
diff --git a/docs/html/training/material/drawables.jd b/docs/html/training/material/drawables.jd
index fd21e3d..820a004 100644
--- a/docs/html/training/material/drawables.jd
+++ b/docs/html/training/material/drawables.jd
@@ -83,6 +83,16 @@
 
 <h2 id="VectorDrawables">Create Vector Drawables</h2>
 
+<!-- video box -->
+<a class="notice-developers-video"
+   href="https://www.youtube.com/watch?v=wlFVIIstKmA"
+   style="margin-top:18px">
+<div>
+    <h3>Video</h3>
+    <p>Android Vector Graphics</p>
+</div>
+</a>
+
 <p>In Android 5.0 (API Level 21) and above, you can define vector drawables, which scale without
 losing definition. You need only one asset file for a vector image, as opposed to an asset file for
 each screen density in the case of bitmap images. To create a vector image, you define the details
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
index 2489b91..00eca7c 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -891,25 +891,30 @@
         <div class="nav-section-header">
 
           <a href="<?cs var:toroot ?>training/tv/start/index.html"
+             ja-lang="TV アプリのビルド"
              description="How to start building TV apps or extend your existing app to run on TV
              devices.">
              Building TV Apps</a>
         </div>
         <ul>
           <li>
-            <a href="<?cs var:toroot ?>training/tv/start/start.html">
+            <a href="<?cs var:toroot ?>training/tv/start/start.html"
+               ja-lang="TV アプリのビルドを開始する">
               Getting Started with TV Apps</a>
           </li>
           <li>
-            <a href="<?cs var:toroot ?>training/tv/start/hardware.html">
+            <a href="<?cs var:toroot ?>training/tv/start/hardware.html"
+               ja-lang="TV ハードウェアを処理する">
               Handling TV Hardware</a>
           </li>
           <li>
-            <a href="<?cs var:toroot ?>training/tv/start/layouts.html">
+            <a href="<?cs var:toroot ?>training/tv/start/layouts.html"
+               ja-lang="TV 向けレイアウトをビルドする">
               Building TV Layouts</a>
           </li>
           <li>
-            <a href="<?cs var:toroot ?>training/tv/start/navigation.html">
+            <a href="<?cs var:toroot ?>training/tv/start/navigation.html"
+               ja-lang="TV 用のナビゲーションを作成する">
               Creating TV Navigation</a>
           </li>
         </ul>
@@ -918,20 +923,24 @@
       <li class="nav-section">
         <div class="nav-section-header">
           <a href="<?cs var:toroot ?>training/tv/playback/index.html"
+             ja-lang="TV 再生アプリのビルド"
              description="How to build apps that provide media catalogs and play content.">
              Building TV Playback Apps</a>
         </div>
         <ul>
           <li>
-            <a href="<?cs var:toroot ?>training/tv/playback/browse.html">
+            <a href="<?cs var:toroot ?>training/tv/playback/browse.html"
+               ja-lang="カタログ ブラウザを作成する">
               Creating a Catalog Browser</a>
           </li>
           <li>
-            <a href="<?cs var:toroot ?>training/tv/playback/details.html">
+            <a href="<?cs var:toroot ?>training/tv/playback/details.html"
+               ja-lang="詳細ビューをビルドする">
               Building a Details View</a>
           </li>
           <li>
-            <a href="<?cs var:toroot ?>training/tv/playback/now-playing.html">
+            <a href="<?cs var:toroot ?>training/tv/playback/now-playing.html"
+               ja-lang="再生中カードを表示する">
               Displaying a Now Playing Card</a>
           </li>
         </ul>
@@ -949,6 +958,9 @@
               Recommending TV Content</a>
           </li>
           <li>
+            <a href="<?cs var:toroot ?>training/tv/discovery/searchable.html">
+              Making TV Apps Searchable</a>
+          <li>
             <a href="<?cs var:toroot ?>training/tv/discovery/in-app-search.html">
               Searching within TV Apps</a>
           </li>
@@ -1713,6 +1725,10 @@
             Enhancing Security with Device Management Policies
           </a>
           </li>
+          <li><a href="<?cs var:toroot ?>training/enterprise/app-compatibility.html">
+            Ensuring Compatibility with Managed Profiles
+          </a>
+          </li>
         </ul>
       </li>
     </ul>
diff --git a/docs/html/training/tv/discovery/recommendations.jd b/docs/html/training/tv/discovery/recommendations.jd
index 0f6d256..d348c14 100644
--- a/docs/html/training/tv/discovery/recommendations.jd
+++ b/docs/html/training/tv/discovery/recommendations.jd
@@ -14,6 +14,11 @@
     <li><a href="#build">Build Recommendations</a></li>
     <li><a href="#run-service">Run Recommendations Service</a></li>
   </ol>
+  <h2>Try it out</h2>
+  <ul>
+    <li><a class="external-link" href="https://github.com/googlesamples/androidtv-Leanback">Android
+      Leanback sample app</a></li>
+  </ul>
 </div>
 </div>
 
@@ -25,7 +30,7 @@
 
 <p>
   The Android framework assists with minimum-input interaction by providing a recommendations row
-  on the home screen. Content recommendations appear as the first row of the TV launch screen after
+  on the home screen. Content recommendations appear as the first row of the TV home screen after
   the first use of the device. Contributing recommendations from your app's content catalog can help
   bring users back to your app.
 </p>
@@ -37,7 +42,9 @@
 
 <p>
   This lesson teaches you how to create recommendations and provide them to the Android framework
-  so your app content can be easily discovered and enjoyed by users.
+  so users can easily discover and enjoy your app content. This discussion describes some code from
+  the <a class="external-link" href="https://github.com/googlesamples/androidtv-Leanback">Android
+  Leanback sample app</a>.
 </p>
 
 
@@ -46,7 +53,7 @@
 <p>
   Content recommendations are created with background processing. In order for your application to
   contribute to recommendations, create a service that periodically adds listings from your
-  app's catalog to the system list of recommendations.
+  app's catalog to the system's list of recommendations.
 </p>
 
 <p>
@@ -54,26 +61,50 @@
   create a recommendation service for your application:
 </p>
 
+
+<p class="code-caption">
+  <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/UpdateRecommendationsService.java" target="_blank">
+  UpdateRecommendationsService.java</a>
+</p>
 <pre>
-public class RecommendationsService extends IntentService {
+public class UpdateRecommendationsService extends IntentService {
+    private static final String TAG = "UpdateRecommendationsService";
     private static final int MAX_RECOMMENDATIONS = 3;
 
-    public RecommendationsService() {
+    public UpdateRecommendationsService() {
         super("RecommendationService");
     }
 
     &#64;Override
     protected void onHandleIntent(Intent intent) {
-        MovieDatabase database = MovieDatabase.instance(getApplicationContext());
-        List<Movie> recommendations = database.recommendations();
+        Log.d(TAG, "Updating recommendation cards");
+        HashMap&lt;String, List&lt;Movie&gt;&gt; recommendations = VideoProvider.getMovieList();
+        if (recommendations == null) return;
 
         int count = 0;
 
         try {
-            for (Movie movie : recommendations) {
-                // build the individual content recommendations
-                buildRecommendation(getApplicationContext(), movie);
+            RecommendationBuilder builder = new RecommendationBuilder()
+                    .setContext(getApplicationContext())
+                    .setSmallIcon(R.drawable.videos_by_google_icon);
 
+            for (Map.Entry&lt;String, List&lt;Movie&gt;&gt; entry : recommendations.entrySet()) {
+                for (Movie movie : entry.getValue()) {
+                    Log.d(TAG, "Recommendation - " + movie.getTitle());
+
+                    builder.setBackground(movie.getCardImageUrl())
+                            .setId(count + 1)
+                            .setPriority(MAX_RECOMMENDATIONS - count)
+                            .setTitle(movie.getTitle())
+                            .setDescription(getString(R.string.popular_header))
+                            .setImage(movie.getCardImageUrl())
+                            .setIntent(buildPendingIntent(movie))
+                            .build();
+
+                    if (++count >= MAX_RECOMMENDATIONS) {
+                        break;
+                    }
+                }
                 if (++count >= MAX_RECOMMENDATIONS) {
                     break;
                 }
@@ -82,6 +113,21 @@
             Log.e(TAG, "Unable to update recommendation", e);
         }
     }
+
+    private PendingIntent buildPendingIntent(Movie movie) {
+        Intent detailsIntent = new Intent(this, DetailsActivity.class);
+        detailsIntent.putExtra("Movie", movie);
+
+        TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
+        stackBuilder.addParentStack(DetailsActivity.class);
+        stackBuilder.addNextIntent(detailsIntent);
+        // Ensure a unique PendingIntents, otherwise all recommendations end up with the same
+        // PendingIntent
+        detailsIntent.setAction(Long.toString(movie.getId()));
+
+        PendingIntent intent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
+        return intent;
+    }
 }
 </pre>
 
@@ -90,125 +136,165 @@
   app manifest. The following code snippet illustrates how to declare this class as a service:
 </p>
 
+<p class="code-caption">
+  <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/AndroidManifest.xml" target="_blank">
+  AndroidManifest.xml</a>
+</p>
 <pre>
 &lt;manifest ... &gt;
   &lt;application ... &gt;
     ...
 
-    &lt;service android:name=&quot;.RecommendationsService&quot;
-             android:enabled=&quot;true&quot; android:exported=&quot;true&quot;/&gt;
+    &lt;service
+            android:name="com.example.android.tvleanback.UpdateRecommendationsService"
+            android:enabled="true" /&gt;
   &lt;/application&gt;
 &lt;/manifest&gt;
 </pre>
 
+<h3 id="refreshing">Refreshing Recommendations</h3>
+
+<p>Base your recommendations on user behavior and data such as play lists, wish lists, and associated
+content. When refreshing recommendations, don't just remove and repost them, because doing so causes
+the recommendations to appear at the end of the recommendations row. Once a content item, such as a
+movie, has been played, <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html#Removing">
+remove it</a> from the recommendations.</p>
 
 <h2 id="build">Build Recommendations</h2>
 
 <p>
-  Once your recommendation server starts running, it must create recommendations and pass them to
+  Once your recommendation service starts running, it must create recommendations and pass them to
   the Android framework. The framework receives the recommendations as {@link
   android.app.Notification} objects that use a specific template and are marked with a specific
   category.
 </p>
 
-<p>
-  The following code example demonstrates how to get an instance of the {@link
-  android.app.NotificationManager}, build a recommendation, and post it to the manager:
+<h3 id="setting-ui">Setting the Values</h3>
+
+<p>To set the UI element values for the recommendation card, you create a builder class that follows
+the builder pattern described as follows. First, you set the values of the recommendation card
+elements.</p>
+
+<p class="code-caption">
+  <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/RecommendationBuilder.java" target="_blank">
+  RecommendationBuilder.java</a>
 </p>
-
 <pre>
-public class RecommendationsService extends IntentService {
-
+public class RecommendationBuilder {
     ...
 
-    public Notification buildRecommendation(Context context, Movie movie)
-            throws IOException {
-
-        if (mNotificationManager == null) {
-            mNotificationManager = (NotificationManager)
-                    mContext.getSystemService(Context.NOTIFICATION_SERVICE);
+    public RecommendationBuilder setTitle(String title) {
+            mTitle = title;
+            return this;
         }
 
-        Bundle extras = new Bundle();
-        if (mBackgroundUri != movie.getBackgroundUri()) {
-            extras.putString(EXTRA_BACKGROUND_IMAGE_URL, movie.getBackgroundUri());
+        public RecommendationBuilder setDescription(String description) {
+            mDescription = description;
+            return this;
         }
 
-        // build the recommendation as a Notification object
+        public RecommendationBuilder setImage(String uri) {
+            mImageUri = uri;
+            return this;
+        }
+
+        public RecommendationBuilder setBackground(String uri) {
+            mBackgroundUri = uri;
+            return this;
+        }
+...
+</pre>
+
+<h3 id="create-notification">Creating the Notification</h3>
+
+<p>
+  Once you've set the values, you then build the notification, assigning the values from the builder
+  class to the notification, and calling {@link android.support.v4.app.NotificationCompat.Builder#build()
+  NotificationCompat.Builder.build()}.
+</p>
+
+<p>
+  Also, be sure to call
+  {@link android.support.v4.app.NotificationCompat.Builder#setLocalOnly(boolean) setLocalOnly()}
+  so the {@link android.support.v4.app.NotificationCompat.BigPictureStyle} notification won't show up
+  on other devices.
+</p>
+
+<p>
+  The following code example demonstrates how to build a recommendation, and post it to the manager.
+</p>
+
+<p class="code-caption">
+  <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/RecommendationBuilder.java" target="_blank">
+  RecommendationBuilder.java</a>
+</p>
+<pre>
+public class RecommendationBuilder {
+    ...
+
+    public Notification build() throws IOException {
+        ...
+
         Notification notification = new NotificationCompat.BigPictureStyle(
-                new NotificationCompat.Builder(context)
-                        .setContentTitle(movie.getTitle())
-                        .setContentText(movie.getDescription())
-                        .setContentInfo(APP_NAME)
-                        .setGroup("ActionMovies")
-                        .setSortKey("0.8")
-                        .setPriority(movie.getPriority())
-                        .setColor(#FFFF2020)
-                        .setCategory("recommendation")
-                        .setLargeIcon(movie.getImage())
-                        .setSmallIcon(movie.getSmallIcon())
-                        .setContentIntent(buildPendingIntent(movie.getId()))
+                new NotificationCompat.Builder(mContext)
+                        .setContentTitle(mTitle)
+                        .setContentText(mDescription)
+                        .setPriority(mPriority)
+                        .setLocalOnly(true)
+                        .setOngoing(true)
+                        .setColor(mContext.getResources().getColor(R.color.fastlane_background))
+                        .setCategory(Notification.CATEGORY_RECOMMENDATION)
+                        .setLargeIcon(image)
+                        .setSmallIcon(mSmallIcon)
+                        .setContentIntent(mIntent)
                         .setExtras(extras))
                 .build();
 
-        // post the recommendation to the NotificationManager
-        mNotificationManager.notify(movie.getId(), notification);
+        mNotificationManager.notify(mId, notification);
         mNotificationManager = null;
         return notification;
     }
-
-    private PendingIntent buildPendingIntent(long id) {
-        Intent detailsIntent = new Intent(this, DetailsActivity.class);
-        detailsIntent.putExtra("id", id);
-
-        TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
-        stackBuilder.addParentStack(DetailsActivity.class);
-        stackBuilder.addNextIntent(detailsIntent);
-        // Ensure each PendingIntent is unique
-        detailsIntent.setAction(Long.toString(id));
-
-        PendingIntent intent = stackBuilder.getPendingIntent(
-                0, PendingIntent.FLAG_UPDATE_CURRENT);
-        return intent;
-    }
 }
 </pre>
 
-
-<h3 id="run-service">Run Recommendations Service</h3>
+<h2 id="run-service">Run Recommendations Service</h3>
 
 <p>
   Your app's recommendation service must run periodically in order to create current
   recommendations. To run your service, create a class that runs a timer and invokes
   it at regular intervals. The following code example extends the {@link
   android.content.BroadcastReceiver} class to start periodic execution of a recommendation service
-  every 12 hours:
+  every half hour:
 </p>
 
+<p class="code-caption">
+  <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/BootupActivity.java" target="_blank">
+  BootupActivity.java</a>
+</p>
 <pre>
-public class BootupReceiver extends BroadcastReceiver {
+public class BootupActivity extends BroadcastReceiver {
     private static final String TAG = "BootupActivity";
 
     private static final long INITIAL_DELAY = 5000;
 
     &#64;Override
     public void onReceive(Context context, Intent intent) {
+        Log.d(TAG, "BootupActivity initiated");
         if (intent.getAction().endsWith(Intent.ACTION_BOOT_COMPLETED)) {
             scheduleRecommendationUpdate(context);
         }
     }
 
     private void scheduleRecommendationUpdate(Context context) {
-        AlarmManager alarmManager = (AlarmManager)context.getSystemService(
-                Context.ALARM_SERVICE);
-        Intent recommendationIntent = new Intent(context,
-                UpdateRecommendationsService.class);
-        PendingIntent alarmIntent = PendingIntent.getService(context, 0,
-                recommendationIntent, 0);
+        Log.d(TAG, "Scheduling recommendations update");
+
+        AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
+        Intent recommendationIntent = new Intent(context, UpdateRecommendationsService.class);
+        PendingIntent alarmIntent = PendingIntent.getService(context, 0, recommendationIntent, 0);
 
         alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                 INITIAL_DELAY,
-                AlarmManager.INTERVAL_HALF_DAY,
+                AlarmManager.INTERVAL_HALF_HOUR,
                 alarmIntent);
     }
 }
@@ -221,10 +307,15 @@
   following sample code demonstrates how to add this configuration to the manifest:
 </p>
 
+<p class="code-caption">
+  <a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/AndroidManifest.xml" target="_blank">
+  AndroidManifest.xml</a>
+</p>
 <pre>
 &lt;manifest ... &gt;
   &lt;application ... &gt;
-    &lt;receiver android:name=&quot;.BootupReceiver&quot; android:enabled=&quot;true&quot;
+    &lt;receiver android:name=&quot;com.example.android.tvleanback.BootupActivity&quot;
+              android:enabled=&quot;true&quot;
               android:exported=&quot;false&quot;&gt;
       &lt;intent-filter&gt;
         &lt;action android:name=&quot;android.intent.action.BOOT_COMPLETED&quot;/&gt;
@@ -234,7 +325,7 @@
 &lt;/manifest&gt;
 </pre>
 
-<p class="important">
+<p class="note">
   <strong>Important:</strong> Receiving a boot completed notification requires that your app
   requests the {@link android.Manifest.permission#RECEIVE_BOOT_COMPLETED} permission.
   For more information, see {@link android.content.Intent#ACTION_BOOT_COMPLETED}.
diff --git a/docs/html/training/tv/discovery/searchable.jd b/docs/html/training/tv/discovery/searchable.jd
new file mode 100644
index 0000000..5d3b9e3
--- /dev/null
+++ b/docs/html/training/tv/discovery/searchable.jd
@@ -0,0 +1,383 @@
+page.title=Making TV Apps Searchable
+page.tags="search","searchable"
+
+trainingnavtop=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+  <h2>This lesson teaches you to</h2>
+  <ol>
+    <li><a href="#columns">Identify Columns</a></li>
+    <li><a href="#provide">Provide Search Suggestion Data</a></li>
+    <li><a href="#suggestions">Handle Search Suggestions</a></li>
+    <li><a href="#terms">Handle Search Terms</a></li>
+    <li><a href="#details">Deep Link to Your App in the Details Screen</a></li>
+  </ol>
+  <h2>You should also read</h2>
+  <ul>
+    <li><a href="{@docRoot}guide/topics/search/index.html">Search</a></li>
+    <li><a href="{@docRoot}training/search/index.html">Adding Search Functionality</a></li>
+  </ul>
+  <h2>Try it out</h2>
+  <ul>
+    <li><a class="external-link" href="https://github.com/googlesamples/androidtv-Leanback">Android Leanback sample app</a></li>
+  </ul>
+</div>
+</div>
+
+<p>Android TV uses the Android <a href="{@docRoot}guide/topics/search/index.html">search interface</a>
+to retrieve content data from installed apps and deliver search results to the user. Your app's
+content data can be included with these results, to give the user instant access to the content in
+your app.</p>
+
+<p>Your app must provide Android TV with the data fields from which it generates suggested search
+results as the user enters characters in the search dialog. To do that, your app must implement a
+<a href="{@docRoot}guide/topics/providers/content-providers.html">Content Provider</a> that serves
+up the suggestions along with a <a href="{@docRoot}guide/topics/search/searchable-config.html">
+{@code searchable.xml}</a> configuration file that describes the content
+provider and other vital information for Android TV. You also need an activity that handles the
+intent that fires when the user selects a suggested search result. All of this is described in
+more detail in <a href="{@docRoot}guide/topics/search/adding-custom-suggestions.html">Adding Custom
+Suggestions</a>. Here are described the main points for Android TV apps.</p>
+
+<p>This lesson builds on your knowledge of using search in Android to show you how to make your app
+searchable in Android TV. Be sure you are familiar with the concepts explained in the
+<a href="{@docRoot}guide/topics/search/index.html">Search API guide</a> before following this lesson.
+See also the training <a href="{@docRoot}training/search/index.html">Adding Search Functionality</a>.</p>
+
+<p>This discussion describes some code from the
+<a class="external-link" href="https://github.com/googlesamples/androidtv-Leanback">Android Leanback sample app</a>,
+available on GitHub.</p>
+
+<h2 id="columns">Identify Columns</h2>
+
+<p>The {@link android.app.SearchManager} describes the data fields it expects by representing them as
+columns of an SQLite database. Regardless of your data's format, you must map your data fields to
+these columns, usually in the class that accessess your content data. For information about building
+a class that maps your existing data to the required fields, see
+<a href="{@docRoot}guide/topics/search/adding-custom-suggestions.html#SuggestionTable">
+Building a suggestion table</a>.</p>
+
+<p>The {@link android.app.SearchManager} class includes several columns for Android TV. Some of the
+more important columns are described below.</p>
+
+<table>
+<tr>
+   <th>Value</th>
+   <th>Description</th>
+</tr><tr>
+   <td>{@code SUGGEST_COLUMN_TEXT_1}</td>
+   <td>The name of your content <strong>(required)</strong></td>
+</tr><tr>
+   <td>{@code SUGGEST_COLUMN_TEXT_2}</td>
+   <td>A text description of your content</td>
+</tr><tr>
+   <td>{@code SUGGEST_COLUMN_RESULT_CARD_IMAGE}</td>
+   <td>An image/poster/cover for your content</td>
+</tr><tr>
+   <td>{@code SUGGEST_COLUMN_CONTENT_TYPE}</td>
+   <td>The MIME type of your media <strong>(required)</strong></td>
+</tr><tr>
+   <td>{@code SUGGEST_COLUMN_VIDEO_WIDTH}</td>
+   <td>The resolution width of your media</td>
+</tr><tr>
+   <td>{@code SUGGEST_COLUMN_VIDEO_HEIGHT}</td>
+   <td>The resolution height of your media</td>
+</tr><tr>
+   <td>{@code SUGGEST_COLUMN_PRODUCTION_YEAR}</td>
+   <td>The production year of your content <strong>(required)</strong></td>
+</tr><tr>
+   <td>{@code SUGGEST_COLUMN_DURATION}</td>
+   <td>The duration in milliseconds of your media</td>
+</tr>
+</table>
+
+<p>The search framework requires the following columns:</p>
+<ul>
+  <li>{@link android.app.SearchManager#SUGGEST_COLUMN_TEXT_1}</li>
+  <li>{@link android.app.SearchManager#SUGGEST_COLUMN_CONTENT_TYPE}</li>
+  <li>{@link android.app.SearchManager#SUGGEST_COLUMN_PRODUCTION_YEAR}</li>
+</ul>
+
+<p>When the values of these columns for your content match the values for the same content from other
+providers found by Google servers, the system provides a
+<a href="{@docRoot}training/app-indexing/deep-linking.html">deep link</a> to your app in the details
+view for the content, along with links to the apps of other providers. This is discussed more in
+<a href="#details">Display Content in the Details Screen</a>, below.</p>
+
+<p>Your application's database class might define the columns as follows:</p>
+
+<p class="code-caption"><a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/VideoDatabase.java#L41" target="_blank">
+VideoDatabase.java</a></p>
+<pre>
+public class VideoDatabase {
+  //The columns we'll include in the video database table
+  public static final String KEY_NAME = SearchManager.SUGGEST_COLUMN_TEXT_1;
+  public static final String KEY_DESCRIPTION = SearchManager.SUGGEST_COLUMN_TEXT_2;
+  public static final String KEY_ICON = SearchManager.SUGGEST_COLUMN_RESULT_CARD_IMAGE;
+  public static final String KEY_DATA_TYPE = SearchManager.SUGGEST_COLUMN_CONTENT_TYPE;
+  public static final String KEY_IS_LIVE = SearchManager.SUGGEST_COLUMN_IS_LIVE;
+  public static final String KEY_VIDEO_WIDTH = SearchManager.SUGGEST_COLUMN_VIDEO_WIDTH;
+  public static final String KEY_VIDEO_HEIGHT = SearchManager.SUGGEST_COLUMN_VIDEO_HEIGHT;
+  public static final String KEY_AUDIO_CHANNEL_CONFIG =
+          SearchManager.SUGGEST_COLUMN_AUDIO_CHANNEL_CONFIG;
+  public static final String KEY_PURCHASE_PRICE = SearchManager.SUGGEST_COLUMN_PURCHASE_PRICE;
+  public static final String KEY_RENTAL_PRICE = SearchManager.SUGGEST_COLUMN_RENTAL_PRICE;
+  public static final String KEY_RATING_STYLE = SearchManager.SUGGEST_COLUMN_RATING_STYLE;
+  public static final String KEY_RATING_SCORE = SearchManager.SUGGEST_COLUMN_RATING_SCORE;
+  public static final String KEY_PRODUCTION_YEAR = SearchManager.SUGGEST_COLUMN_PRODUCTION_YEAR;
+  public static final String KEY_COLUMN_DURATION = SearchManager.SUGGEST_COLUMN_DURATION;
+  public static final String KEY_ACTION = SearchManager.SUGGEST_COLUMN_INTENT_ACTION;
+...
+</pre>
+
+<p>When you build the map from the {@link android.app.SearchManager} columns to your data fields, you
+must also specify the {@link android.provider.BaseColumns#_ID} to give each row a unique ID.</p>
+
+<p class="code-caption"><a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/VideoDatabase.java#L83" target="_blank">
+VideoDatabase.java</a></p>
+<pre>
+...
+  private static HashMap<String, String> buildColumnMap() {
+    HashMap<String, String> map = new HashMap<String, String>();
+    map.put(KEY_NAME, KEY_NAME);
+    map.put(KEY_DESCRIPTION, KEY_DESCRIPTION);
+    map.put(KEY_ICON, KEY_ICON);
+    map.put(KEY_DATA_TYPE, KEY_DATA_TYPE);
+    map.put(KEY_IS_LIVE, KEY_IS_LIVE);
+    map.put(KEY_VIDEO_WIDTH, KEY_VIDEO_WIDTH);
+    map.put(KEY_VIDEO_HEIGHT, KEY_VIDEO_HEIGHT);
+    map.put(KEY_AUDIO_CHANNEL_CONFIG, KEY_AUDIO_CHANNEL_CONFIG);
+    map.put(KEY_PURCHASE_PRICE, KEY_PURCHASE_PRICE);
+    map.put(KEY_RENTAL_PRICE, KEY_RENTAL_PRICE);
+    map.put(KEY_RATING_STYLE, KEY_RATING_STYLE);
+    map.put(KEY_RATING_SCORE, KEY_RATING_SCORE);
+    map.put(KEY_PRODUCTION_YEAR, KEY_PRODUCTION_YEAR);
+    map.put(KEY_COLUMN_DURATION, KEY_COLUMN_DURATION);
+    map.put(KEY_ACTION, KEY_ACTION);
+    map.put(BaseColumns._ID, "rowid AS " +
+            BaseColumns._ID);
+    map.put(SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID, "rowid AS " +
+            SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID);
+    map.put(SearchManager.SUGGEST_COLUMN_SHORTCUT_ID, "rowid AS " +
+            SearchManager.SUGGEST_COLUMN_SHORTCUT_ID);
+    return map;
+  }
+...
+</pre>
+
+<p>In the example above, notice the mapping to the {@link android.app.SearchManager#SUGGEST_COLUMN_INTENT_DATA_ID}
+field. This is the portion of the URI that points to the content unique to the data in this row &mdash;
+that is, the last part of the URI describing where the content is stored. The first part of the URI,
+when it is common to all of the rows in the table, is set in the
+<a href="{@docRoot}guide/topics/search/searchable-config.html"> {@code searchable.xml}</a> file as the
+<a href="{@docRoot}guide/topics/search/searchable-config.html#searchSuggestIntentData">
+{@code android:searchSuggestIntentData}</a> attribute, as described in
+<a href="#suggestions">Handle Search Suggestions</a>, below.
+
+<p>If the first part of the URI is different for each row in the
+table, you map that value with the {@link android.app.SearchManager#SUGGEST_COLUMN_INTENT_DATA} field.
+When the user selects this content, the intent that fires provides the intent data from the
+combination of the {@link android.app.SearchManager#SUGGEST_COLUMN_INTENT_DATA_ID}
+and either the {@code android:searchSuggestIntentData} attribute or the
+{@link android.app.SearchManager#SUGGEST_COLUMN_INTENT_DATA} field value.</p>
+
+<h2 id="provide">Provide Search Suggestion Data</h2>
+
+<p>Implement a <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Provider</a>
+to return search term suggestions to the Android TV search dialog. The system queries your content
+provider for suggestions by calling the {@link android.content.ContentProvider#query(android.net.Uri,
+java.lang.String[], java.lang.String, java.lang.String[], java.lang.String) query()} method each time
+a letter is typed. In your implementation of {@link android.content.ContentProvider#query(android.net.Uri,
+java.lang.String[], java.lang.String, java.lang.String[], java.lang.String) query()}, your content
+provider searches your suggestion data and returns a {@link android.database.Cursor} that points to
+the rows you have designated for suggestions.</p>
+
+<p class="code-caption"><a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/java/com/example/android/tvleanback/VideoContentProvider.java" target="_blank">
+VideoContentProvider.java</a></p>
+<pre>
+&#64;Override
+  public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
+                      String sortOrder) {
+    // Use the UriMatcher to see what kind of query we have and format the db query accordingly
+    switch (URI_MATCHER.match(uri)) {
+      case SEARCH_SUGGEST:
+          Log.d(TAG, "search suggest: " + selectionArgs[0] + " URI: " + uri);
+          if (selectionArgs == null) {
+              throw new IllegalArgumentException(
+                      "selectionArgs must be provided for the Uri: " + uri);
+          }
+          return getSuggestions(selectionArgs[0]);
+      default:
+          throw new IllegalArgumentException("Unknown Uri: " + uri);
+    }
+  }
+
+  private Cursor getSuggestions(String query) {
+    query = query.toLowerCase();
+    String[] columns = new String[]{
+      BaseColumns._ID,
+      VideoDatabase.KEY_NAME,
+      VideoDatabase.KEY_DESCRIPTION,
+      VideoDatabase.KEY_ICON,
+      VideoDatabase.KEY_DATA_TYPE,
+      VideoDatabase.KEY_IS_LIVE,
+      VideoDatabase.KEY_VIDEO_WIDTH,
+      VideoDatabase.KEY_VIDEO_HEIGHT,
+      VideoDatabase.KEY_AUDIO_CHANNEL_CONFIG,
+      VideoDatabase.KEY_PURCHASE_PRICE,
+      VideoDatabase.KEY_RENTAL_PRICE,
+      VideoDatabase.KEY_RATING_STYLE,
+      VideoDatabase.KEY_RATING_SCORE,
+      VideoDatabase.KEY_PRODUCTION_YEAR,
+      VideoDatabase.KEY_COLUMN_DURATION,
+      VideoDatabase.KEY_ACTION,
+      SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID
+    };
+    return mVideoDatabase.getWordMatch(query, columns);
+  }
+...
+</pre>
+
+<p>In your manifest file, the content provider receives special treatment. Rather than getting
+tagged as an activity, it is described as a
+<a href="{@docRoot}guide/topics/manifest/provider-element.html">{@code &lt;provider&gt;}</a>. The
+provider includes the {@code android:searchSuggestAuthority} attribute to tell the system the
+namespace of your content provider. Also, you must set its {@code android:exported} attribute to
+{@code "true"} so that the Android global search can use the results returned from it.</p>
+
+<p class="code-caption"><a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/AndroidManifest.xml" target="_blank">
+AndroidManifest.xml</a></p>
+<pre>
+&lt;provider android:name="com.example.android.tvleanback.VideoContentProvider"
+    android:authorities="com.example.android.tvleanback"
+    android:exported="true" /&gt;
+</pre>
+
+<h2 id="suggestions">Handle Search Suggestions</h2>
+
+<p>Your app must include a <a href="{@docRoot}guide/topics/search/searchable-config.html">
+{@code res/xml/searchable.xml}</a> file to configure the search suggestions settings. It inlcudes
+the <a href="{@docRoot}guide/topics/search/searchable-config.html#searchSuggestAuthority">
+{@code android:searchSuggestAuthority}</a> attribute to tell the system the namespace of your
+content provider. This must match the string value you specify in the
+<a href="{@docRoot}guide/topics/manifest/provider-element.html#auth">{@code android:authorities}</a>
+attribute of the <a href="{@docRoot}guide/topics/manifest/provider-element.html">{@code &lt;provider&gt;}
+</a> element in your {@code AndroidManifest.xml} file.</p>
+
+The <a href="{@docRoot}guide/topics/search/searchable-config.html">{@code searchable.xml}</a> file
+must also include the <a href="{@docRoot}guide/topics/search/searchable-config.html#searchSuggestIntentAction">
+{@code android:searchSuggestIntentAction}</a> with the value {@code "android.intent.action.VIEW"}
+to define the intent action for providing a custom suggestion. This is different from the intent
+action for providing a search term, explained below. See also,
+<a href="{@docRoot}guide/topics/search/adding-custom-suggestions.html#IntentAction">Declaring the
+intent action</a> for other ways to declare the intent action for suggestions.</p>
+
+<p>Along with the intent action, your app must provide the intent data, which you specify with the
+<a href="{@docRoot}guide/topics/search/searchable-config.html#searchSuggestIntentData">
+{@code android:searchSuggestIntentData}</a> attribute. This is the first part of the URI that points
+to the content. It describes the portion of the URI common to all rows in the mapping table for that
+content. The portion of the URI that is unique to each row is established with the {@link android.app.SearchManager#SUGGEST_COLUMN_INTENT_DATA_ID} field,
+as described above in <a href="#columns">Identify Columns</a>. See also,
+<a href="{@docRoot}guide/topics/search/adding-custom-suggestions.html#IntentData">
+Declaring the intent data</a> for other ways to declare the intent data for suggestions.</p>
+
+<p>Also, note the {@code android:searchSuggestSelection=" ?"} attribute which specifies the value passed
+as the {@code selection} parameter of the {@link android.content.ContentProvider#query(android.net.Uri,
+java.lang.String[], java.lang.String, java.lang.String[], java.lang.String) query()} method where the
+question mark ({@code ?}) value is replaced with the query text.</p>
+
+<p>Finally, you must also include the <a href="{@docRoot}guide/topics/search/searchable-config.html#includeInGlobalSearch">
+{@code android:includeInGlobalSearch}</a> attribute with the value {@code "true"}. Here is an example
+<a href="{@docRoot}guide/topics/search/searchable-config.html">{@code searchable.xml}</a>
+file:</p>
+
+<p class="code-caption"><a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/res/xml/searchable.xml" target="_blank">
+Searchable.xml</a></p>
+<pre>
+&lt;searchable xmlns:android="http://schemas.android.com/apk/res/android"
+    android:label="@string/search_label"
+        android:hint="@string/search_hint"
+        android:searchSettingsDescription="@string/settings_description"
+        android:searchSuggestAuthority="com.example.android.tvleanback"
+        android:searchSuggestIntentAction="android.intent.action.VIEW"
+        android:searchSuggestIntentData="content://com.example.android.tvleanback/video_database_leanback"
+        android:searchSuggestSelection=" ?"
+        android:searchSuggestThreshold="1"
+        android:includeInGlobalSearch="true"
+    &gt;
+&lt;/searchable&gt;
+</pre>
+
+<h2 id="terms">Handle Search Terms</h2>
+
+<p>As soon as the search dialog has a word which matches the value in one of your app's columns
+(described in <a href="#identifying">Identifying Columns</a>, above), the system fires the
+{@link android.content.Intent#ACTION_SEARCH} intent. The activity in your app which handles that
+intent searches the repository for columns with the given word in their values, and returns a list
+of content items with those columns. In your {@code AndroidManifest.xml} file, you designate the
+activity which handles the {@link android.content.Intent#ACTION_SEARCH} intent like this:
+
+<p class="code-caption"><a href="https://github.com/googlesamples/androidtv-Leanback/blob/master/app/src/main/AndroidManifest.xml" target="_blank">
+AndroidManifest.xml</a></p>
+<pre>
+...
+  &lt;activity
+      android:name="com.example.android.tvleanback.DetailsActivity"
+      android:exported="true"&gt;
+
+      &lt;!-- Receives the search request. --&gt;
+      &lt;intent-filter&gt;
+          &lt;action android:name="android.intent.action.SEARCH" /&gt;
+          &lt;!-- No category needed, because the Intent will specify this class component --&gt;
+      &lt;/intent-filter&gt;
+
+      &lt;!-- Points to searchable meta data. --&gt;
+      &lt;meta-data android:name="android.app.searchable"
+          android:resource="@xml/searchable" /&gt;
+  &lt;/activity&gt;
+...
+  &lt;!-- Provides search suggestions for keywords against video meta data. --&gt;
+  &lt;provider android:name="com.example.android.tvleanback.VideoContentProvider"
+      android:authorities="com.example.android.tvleanback"
+      android:exported="true" /&gt;
+...
+</pre>
+
+<p>The activity must also describe the searchable configuration with a reference to the
+<a href="{@docRoot}guide/topics/search/searchable-config.html">{@code searchable.xml}</a> file.
+To <a href="{@docRoot}guide/topics/search/search-dialog.html">use the global search dialog</a>,
+the manifest must describe which activity should receive search queries. The manifest must also
+describe the <a href="{@docRoot}guide/topics/manifest/provider-element.html">{@code &lt;provider&gt;}
+</a>element, exactly as it is described in the <a href="{@docRoot}guide/topics/search/searchable-config.html">
+{@code searchable.xml}</a> file.</p>
+
+<h2 id="details">Deep Link to Your App in the Details Screen</h2>
+
+<p>If you have set up the search configuration as described in <a href="#suggestions">Handle Search
+Suggestions</a> and mapped the {@link android.app.SearchManager#SUGGEST_COLUMN_TEXT_1},
+{@link android.app.SearchManager#SUGGEST_COLUMN_CONTENT_TYPE}, and
+{@link android.app.SearchManager#SUGGEST_COLUMN_PRODUCTION_YEAR} fields as described in
+<a href="#columns">Identify Columns</a>, a <a href="{@docRoot}training/app-indexing/deep-linking.html">
+deep link</a> to your content appears in the details screen that launches when the user selects a
+search result.</p>
+
+<p>When the user selects the link for your app, identified by the "Available On" button in the
+details screen, the system launches the activity which handles the {@link android.content.Intent#ACTION_VIEW}
+(set as <a href="{@docRoot}guide/topics/search/searchable-config.html#searchSuggestIntentAction">
+{@code android:searchSuggestIntentAction}</a> with the value {@code "android.intent.action.VIEW"} in
+the <a href="{@docRoot}guide/topics/search/searchable-config.html">{@code searchable.xml}</a> file).</p>
+
+<p>You can also set up a custom intent to launch your activity, and this is demonstrated in the
+<a class="external-link" href="https://github.com/googlesamples/androidtv-Leanback">Android Leanback
+sample app</a>. Note that the sample app launches its own <code>LeanbackDetailsFragment</code> to
+show the details for the selected media, but you should launch the activity that plays the media
+immediately to save the user another click or two.</p>
+
+
+
+
+
+
diff --git a/docs/html/training/wearables/ui/lists.jd b/docs/html/training/wearables/ui/lists.jd
index 1d6e8ed..20f8bbd 100644
--- a/docs/html/training/wearables/ui/lists.jd
+++ b/docs/html/training/wearables/ui/lists.jd
@@ -82,20 +82,21 @@
 <p>In many cases, each list item consists of an icon and a description. The
 <em>Notifications</em> sample from the Android SDK implements a custom layout that extends
 {@link android.widget.LinearLayout} to incorporate these two elements inside each list item.
-This layout also implements the methods in the <code>WearableListView.Item</code> interface
-to animate the item's icon and fade the text in response to events from
+This layout also implements the methods in the
+<code>WearableListView.OnCenterProximityListener</code> interface
+to change the color of the item's icon and fade the text in response to events from
 <code>WearableListView</code> as the user scrolls through the list.</p>
 
 <pre>
 public class WearableListItemLayout extends LinearLayout
-                                    implements WearableListView.Item {
+             implements WearableListView.OnCenterProximityListener {
+
+    private ImageView mCircle;
+    private TextView mName;
 
     private final float mFadedTextAlpha;
     private final int mFadedCircleColor;
     private final int mChosenCircleColor;
-    private ImageView mCircle;
-    private float mScale;
-    private TextView mName;
 
     public WearableListItemLayout(Context context) {
         this(context, null);
@@ -108,6 +109,7 @@
     public WearableListItemLayout(Context context, AttributeSet attrs,
                                   int defStyle) {
         super(context, attrs, defStyle);
+
         mFadedTextAlpha = getResources()
                          .getInteger(R.integer.action_text_faded_alpha) / 100f;
         mFadedCircleColor = getResources().getColor(R.color.grey);
@@ -124,46 +126,27 @@
         mName = (TextView) findViewById(R.id.name);
     }
 
-    // Provide scaling values for WearableListView animations
     &#64;Override
-    public float getProximityMinValue() {
-        return 1f;
-    }
-
-    &#64;Override
-    public float getProximityMaxValue() {
-        return 1.6f;
-    }
-
-    &#64;Override
-    public float getCurrentProximityValue() {
-        return mScale;
-    }
-
-    // Scale the icon for WearableListView animations
-    &#64;Override
-    public void setScalingAnimatorValue(float scale) {
-        mScale = scale;
-        mCircle.setScaleX(scale);
-        mCircle.setScaleY(scale);
-    }
-
-    // Change color of the icon, remove fading from the text
-    &#64;Override
-    public void onScaleUpStart() {
+    public void onCenterPosition(boolean animate) {
         mName.setAlpha(1f);
         ((GradientDrawable) mCircle.getDrawable()).setColor(mChosenCircleColor);
     }
 
-    // Change the color of the icon, fade the text
     &#64;Override
-    public void onScaleDownStart() {
+    public void onNonCenterPosition(boolean animate) {
         ((GradientDrawable) mCircle.getDrawable()).setColor(mFadedCircleColor);
         mName.setAlpha(mFadedTextAlpha);
     }
 }
 </pre>
 
+<p>You can also create animator objects to enlarge the icon of the center item in the list. You can
+use the <code>onCenterPosition()</code> and <code>onNonCenterPosition()</code> callback methods
+in the <code>WearableListView.OnCenterProximityListener</code> interface to manage your
+animators. For more information about animators, see
+<a href="{@docRoot}guide/topics/graphics/prop-animation.html#object-animator">Animating with
+ObjectAnimator</a>.</p>
+
 
 <h2 id="layout-def">Create a Layout Definition for Items</h2>
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java
index 479c982..dc6af6a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java
@@ -125,7 +125,7 @@
                 Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
                 intent.putExtra(EXTRA_START_CONNECT_SSID, ap.ssid);
                 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-                mContext.startActivity(intent);
+                mContext.startActivityAsUser(intent, new UserHandle(mCurrentUser));
                 return true;
             } else {
                 WifiConfiguration config = new WifiConfiguration();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java
index af51266..f2b2f66 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java
@@ -113,7 +113,9 @@
         if (session == null) {
             return warn("no stats session");
         }
-        final NetworkTemplate template = NetworkTemplate.buildTemplateMobileAll(subscriberId);
+        NetworkTemplate template = NetworkTemplate.buildTemplateMobileAll(subscriberId);
+        template = NetworkTemplate.normalize(template, mTelephonyManager.getMergedSubscriberIds());
+
         final NetworkPolicy policy = findNetworkPolicy(template);
         try {
             final NetworkStatsHistory history = mSession.getHistoryForNetwork(template, FIELDS);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 5eebf3c..b289155 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -134,7 +134,8 @@
     private ArrayList<SignalCluster> mSignalClusters = new ArrayList<SignalCluster>();
     private ArrayList<NetworkSignalChangedCallback> mSignalsChangedCallbacks =
             new ArrayList<NetworkSignalChangedCallback>();
-    private boolean mListening;
+    @VisibleForTesting
+    boolean mListening;
 
     // The current user ID.
     private int mCurrentUserId;
@@ -474,7 +475,7 @@
             int subId = subscriptions.get(i).getSubscriptionId();
             // If we have a copy of this controller already reuse it, otherwise make a new one.
             if (cachedControllers.containsKey(subId)) {
-                mMobileSignalControllers.put(subId, cachedControllers.get(subId));
+                mMobileSignalControllers.put(subId, cachedControllers.remove(subId));
             } else {
                 MobileSignalController controller = new MobileSignalController(mContext, mConfig,
                         mHasMobileDataFeature, mPhone, mSignalsChangedCallbacks, mSignalClusters,
@@ -502,7 +503,8 @@
         updateAirplaneMode(true /* force */);
     }
 
-    private boolean hasCorrectMobileControllers(List<SubscriptionInfo> allSubscriptions) {
+    @VisibleForTesting
+    boolean hasCorrectMobileControllers(List<SubscriptionInfo> allSubscriptions) {
         if (allSubscriptions.size() != mMobileSignalControllers.size()) {
             return false;
         }
@@ -992,8 +994,8 @@
     }
 
     // TODO: Move to its own file.
-    static class MobileSignalController extends SignalController<MobileSignalController.MobileState,
-            MobileSignalController.MobileIconGroup> {
+    public static class MobileSignalController extends SignalController<
+            MobileSignalController.MobileState, MobileSignalController.MobileIconGroup> {
         private final TelephonyManager mPhone;
         private final String mNetworkNameDefault;
         private final String mNetworkNameSeparator;
diff --git a/packages/SystemUI/tests/AndroidManifest.xml b/packages/SystemUI/tests/AndroidManifest.xml
index e52806d..c21af24 100644
--- a/packages/SystemUI/tests/AndroidManifest.xml
+++ b/packages/SystemUI/tests/AndroidManifest.xml
@@ -18,6 +18,7 @@
     package="com.android.systemui.tests">
 
     <uses-permission android:name="android.permission.INJECT_EVENTS" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
 
     <application>
         <uses-library android:name="android.test.runner" />
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
index 27a4052..525dd20 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
@@ -2,14 +2,21 @@
 
 import static org.mockito.Mockito.mock;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.mockito.Mockito;
+
+import android.content.Intent;
 import android.net.ConnectivityManager;
 import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
+import android.telephony.SubscriptionInfo;
 import android.telephony.TelephonyManager;
 
+import com.android.internal.telephony.TelephonyIntents;
 import com.android.systemui.R;
-
-import org.mockito.Mockito;
+import com.android.systemui.statusbar.policy.NetworkControllerImpl.MobileSignalController;
 
 public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
 
@@ -145,6 +152,86 @@
         //verifyLastMobileDataIndicators(true, R.drawable.stat_sys_signal_null, 0 /* No Icon */);
     }
 
+    // Some tests of actual NetworkController code, just internals not display stuff
+    // TODO: Put this somewhere else, maybe in its own file.
+    public void testHasCorrectMobileControllers() {
+        int[] testSubscriptions = new int[] { 1, 5, 3 };
+        int notTestSubscription = 0;
+        MobileSignalController mobileSignalController = Mockito.mock(MobileSignalController.class);
+
+        mNetworkController.mMobileSignalControllers.clear();
+        List<SubscriptionInfo> subscriptions = new ArrayList<>();
+        for (int i = 0; i < testSubscriptions.length; i++) {
+            // Force the test controllers into NetworkController.
+            mNetworkController.mMobileSignalControllers.put(testSubscriptions[i],
+                    mobileSignalController);
+
+            // Generate a list of subscriptions we will tell the NetworkController to use.
+            SubscriptionInfo mockSubInfo = Mockito.mock(SubscriptionInfo.class);
+            Mockito.when(mockSubInfo.getSubscriptionId()).thenReturn(testSubscriptions[i]);
+            subscriptions.add(mockSubInfo);
+        }
+        assertTrue(mNetworkController.hasCorrectMobileControllers(subscriptions));
+
+        // Add a subscription that the NetworkController doesn't know about.
+        SubscriptionInfo mockSubInfo = Mockito.mock(SubscriptionInfo.class);
+        Mockito.when(mockSubInfo.getSubscriptionId()).thenReturn(notTestSubscription);
+        subscriptions.add(mockSubInfo);
+        assertFalse(mNetworkController.hasCorrectMobileControllers(subscriptions));
+    }
+
+    public void testSetCurrentSubscriptions() {
+        // We will not add one controller to make sure it gets created.
+        int indexToSkipController = 0;
+        // We will not add one subscription to make sure it's controller gets removed.
+        int indexToSkipSubscription = 1;
+
+        int[] testSubscriptions = new int[] { 1, 5, 3 };
+        MobileSignalController[] mobileSignalControllers = new MobileSignalController[] {
+                Mockito.mock(MobileSignalController.class),
+                Mockito.mock(MobileSignalController.class),
+                Mockito.mock(MobileSignalController.class),
+        };
+        mNetworkController.mMobileSignalControllers.clear();
+        List<SubscriptionInfo> subscriptions = new ArrayList<>();
+        for (int i = 0; i < testSubscriptions.length; i++) {
+            if (i != indexToSkipController) {
+                // Force the test controllers into NetworkController.
+                mNetworkController.mMobileSignalControllers.put(testSubscriptions[i],
+                        mobileSignalControllers[i]);
+            }
+
+            if (i != indexToSkipSubscription) {
+                // Generate a list of subscriptions we will tell the NetworkController to use.
+                SubscriptionInfo mockSubInfo = Mockito.mock(SubscriptionInfo.class);
+                Mockito.when(mockSubInfo.getSubscriptionId()).thenReturn(testSubscriptions[i]);
+                Mockito.when(mockSubInfo.getSimSlotIndex()).thenReturn(testSubscriptions[i]);
+                subscriptions.add(mockSubInfo);
+            }
+        }
+
+        // We can only test whether unregister gets called if it thinks its in a listening
+        // state.
+        mNetworkController.mListening = true;
+        mNetworkController.setCurrentSubscriptions(subscriptions);
+
+        for (int i = 0; i < testSubscriptions.length; i++) {
+            if (i == indexToSkipController) {
+                // Make sure a controller was created despite us not adding one.
+                assertTrue(mNetworkController.mMobileSignalControllers.containsKey(
+                        testSubscriptions[i]));
+            } else if (i == indexToSkipSubscription) {
+                // Make sure the controller that did exist was removed
+                assertFalse(mNetworkController.mMobileSignalControllers.containsKey(
+                        testSubscriptions[i]));
+            } else {
+                // If a MobileSignalController is around it needs to not be unregistered.
+                Mockito.verify(mobileSignalControllers[i], Mockito.never())
+                        .unregisterListener();
+            }
+        }
+    }
+
     private void setCdma() {
         setIsGsm(false);
         updateDataConnectionState(TelephonyManager.DATA_CONNECTED,
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index 6b8b5b1..8c74ca5 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -7963,8 +7963,6 @@
         // Record that we need a backup pass for the caller.  Since multiple callers
         // may share a uid, we need to note all candidates within that uid and schedule
         // a backup pass for each of them.
-        EventLog.writeEvent(EventLogTags.BACKUP_DATA_CHANGED, packageName);
-
         if (targets == null) {
             Slog.w(TAG, "dataChanged but no participant pkg='" + packageName + "'"
                    + " uid=" + Binder.getCallingUid());
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index c0fc890..022ef44 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -8182,17 +8182,7 @@
         }
     }
 
-    private TaskRecord taskForIdLocked(int id) {
-        final TaskRecord task = recentTaskForIdLocked(id);
-        if (task != null) {
-            return task;
-        }
-
-        // Don't give up. Sometimes it just hasn't made it to recents yet.
-        return mStackSupervisor.anyTaskForIdLocked(id);
-    }
-
-    private TaskRecord recentTaskForIdLocked(int id) {
+    TaskRecord recentTaskForIdLocked(int id) {
         final int N = mRecentTasks.size();
             for (int i=0; i<N; i++) {
                 TaskRecord tr = mRecentTasks.get(i);
@@ -8208,7 +8198,7 @@
         synchronized (this) {
             enforceCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER,
                     "getTaskThumbnail()");
-            TaskRecord tr = recentTaskForIdLocked(id);
+            TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(id);
             if (tr != null) {
                 return tr.getTaskThumbnailLocked();
             }
@@ -8453,7 +8443,7 @@
      * @return Returns true if the given task was found and removed.
      */
     private boolean removeTaskByIdLocked(int taskId, boolean killProcess) {
-        TaskRecord tr = taskForIdLocked(taskId);
+        TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(taskId);
         if (tr != null) {
             tr.removeTaskActivitiesLocked();
             cleanUpRemovedTaskLocked(tr, killProcess);
@@ -8529,7 +8519,7 @@
                 "moveTaskToBack()");
 
         synchronized(this) {
-            TaskRecord tr = taskForIdLocked(taskId);
+            TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(taskId);
             if (tr != null) {
                 if (tr == mStackSupervisor.mLockTaskModeTask) {
                     mStackSupervisor.showLockTaskToast();
@@ -8721,7 +8711,7 @@
         long ident = Binder.clearCallingIdentity();
         try {
             synchronized (this) {
-                TaskRecord tr = taskForIdLocked(taskId);
+                TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(taskId);
                 return tr != null && tr.stack != null && tr.stack.isHomeStack();
             }
         } finally {
@@ -11177,9 +11167,6 @@
             if (mRecentTasks == null) {
                 mRecentTasks = mTaskPersister.restoreTasksLocked();
                 mTaskPersister.restoreTasksFromOtherDeviceLocked();
-                if (!mRecentTasks.isEmpty()) {
-                    mStackSupervisor.createStackForRestoredTaskHistory(mRecentTasks);
-                }
                 cleanupRecentTasksLocked(UserHandle.USER_ALL);
                 mTaskPersister.startPersisting();
             }
@@ -11196,8 +11183,7 @@
                             mDidUpdate = true;
                         }
                         writeLastDonePreBootReceivers(doneReceivers);
-                        showBootMessage(mContext.getText(
-                                R.string.android_upgrading_complete),
+                        showBootMessage(mContext.getText(R.string.android_upgrading_complete),
                                 false);
                         systemReady(goingCallback);
                     }
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index df5b3c5..19252ee 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -24,6 +24,7 @@
 import static com.android.server.am.ActivityManagerService.DEBUG_CONFIGURATION;
 import static com.android.server.am.ActivityManagerService.DEBUG_FOCUS;
 import static com.android.server.am.ActivityManagerService.DEBUG_PAUSE;
+import static com.android.server.am.ActivityManagerService.DEBUG_RECENTS;
 import static com.android.server.am.ActivityManagerService.DEBUG_RESULTS;
 import static com.android.server.am.ActivityManagerService.DEBUG_STACK;
 import static com.android.server.am.ActivityManagerService.DEBUG_SWITCH;
@@ -460,7 +461,21 @@
                 }
             }
         }
-        return null;
+
+        // Don't give up! Look in recents.
+        if (DEBUG_RECENTS) Slog.v(TAG, "Looking for task id=" + id + " in recents");
+        TaskRecord task = mService.recentTaskForIdLocked(id);
+        if (task == null) {
+            if (DEBUG_RECENTS) Slog.d(TAG, "\tDidn't find task id=" + id + " in recents");
+            return null;
+        }
+
+        if (!restoreRecentTaskLocked(task)) {
+            if (DEBUG_RECENTS) Slog.w(TAG, "Couldn't restore task id=" + id + " found in recents");
+            return null;
+        }
+        if (DEBUG_RECENTS) Slog.w(TAG, "Restored task id=" + id + " from in recents");
+        return task;
     }
 
     ActivityRecord isInAnyStackLocked(IBinder token) {
@@ -2586,23 +2601,53 @@
         return mLastStackId;
     }
 
-    void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks) {
-        int stackId = createStackOnDisplay(getNextStackId(), Display.DEFAULT_DISPLAY);
-        final ActivityStack stack = getStack(stackId);
-        for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) {
-            final TaskRecord task = tasks.get(taskNdx);
-            stack.addTask(task, false, false);
-            final int taskId = task.taskId;
-            final ArrayList<ActivityRecord> activities = task.mActivities;
-            for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
-                final ActivityRecord r = activities.get(activityNdx);
-                mWindowManager.addAppToken(0, r.appToken, taskId, stackId,
-                        r.info.screenOrientation, r.fullscreen,
-                        (r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,
-                        r.userId, r.info.configChanges, task.voiceSession != null,
-                        r.mLaunchTaskBehind);
+    private boolean restoreRecentTaskLocked(TaskRecord task) {
+        ActivityStack stack = null;
+        // Determine stack to restore task to.
+        if (mLeanbackOnlyDevice) {
+            // There is only one stack for lean back devices.
+            stack = mHomeStack;
+        } else {
+            // Look for the top stack on the home display that isn't the home stack.
+            final ArrayList<ActivityStack> homeDisplayStacks = mHomeStack.mStacks;
+            for (int stackNdx = homeDisplayStacks.size() - 1; stackNdx >= 0; --stackNdx) {
+                final ActivityStack tmpStack = homeDisplayStacks.get(stackNdx);
+                if (!tmpStack.isHomeStack()) {
+                    stack = tmpStack;
+                    break;
+                }
             }
         }
+
+        if (stack == null) {
+            // We couldn't find a stack to restore the task to. Possible if are restoring recents
+            // before an application stack is created...Go ahead and create one on the default
+            // display.
+            stack = getStack(createStackOnDisplay(getNextStackId(), Display.DEFAULT_DISPLAY));
+            if (DEBUG_RECENTS)
+                Slog.v(TAG, "Created stack=" + stack + " for recents restoration.");
+        }
+
+        if (stack == null) {
+            // What does this mean??? Not sure how we would get here...
+            if (DEBUG_RECENTS)
+                Slog.v(TAG, "Unable to find/create stack to restore recent task=" + task);
+            return false;
+        }
+
+        stack.addTask(task, false, false);
+        if (DEBUG_RECENTS)
+            Slog.v(TAG, "Added restored task=" + task + " to stack=" + stack);
+        final ArrayList<ActivityRecord> activities = task.mActivities;
+        for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
+            final ActivityRecord r = activities.get(activityNdx);
+            mWindowManager.addAppToken(0, r.appToken, task.taskId, stack.mStackId,
+                    r.info.screenOrientation, r.fullscreen,
+                    (r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,
+                    r.userId, r.info.configChanges, task.voiceSession != null,
+                    r.mLaunchTaskBehind);
+        }
+        return true;
     }
 
     void moveTaskToStack(int taskId, int stackId, boolean toTop) {
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index ae4af5f..c380160 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -235,15 +235,16 @@
             Slog.i("XXXXXX", "minfree_adj=" + minfree_adj + " minfree_abs=" + minfree_abs);
         }
 
-        if (Build.SUPPORTED_64_BIT_ABIS.length > 0) {
-            // Increase the high min-free levels for cached processes for 64-bit
-            mOomMinFreeHigh[4] = (mOomMinFreeHigh[4]*3)/2;
-            mOomMinFreeHigh[5] = (mOomMinFreeHigh[5]*7)/4;
-        }
+        final boolean is64bit = Build.SUPPORTED_64_BIT_ABIS.length > 0;
 
         for (int i=0; i<mOomAdj.length; i++) {
             int low = mOomMinFreeLow[i];
             int high = mOomMinFreeHigh[i];
+            if (is64bit) {
+                // Increase the high min-free levels for cached processes for 64-bit
+                if (i == 4) high = (high*3)/2;
+                else if (i == 5) high = (high*7)/4;
+            }
             mOomMinFree[i] = (int)(low + ((high-low)*scale));
         }
 
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
index ed7cebb..90dbd17 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
@@ -326,8 +326,12 @@
             ActiveSource activeSource = getActiveSource();
             HdmiDeviceInfo info = getCecDeviceInfo(activeSource.logicalAddress);
             if (info == null) {
-                info = new HdmiDeviceInfo(Constants.ADDR_INVALID, path, getActivePortId(),
-                        HdmiDeviceInfo.DEVICE_RESERVED, 0, null);
+                info = mService.getDeviceInfoByPort(getActivePortId());
+                if (info == null) {
+                    // No CEC/MHL device is present at the port. Attempt to switch to
+                    // the hardware port itself for non-CEC devices that may be connected.
+                    info = new HdmiDeviceInfo(path, getActivePortId());
+                }
             }
             mService.invokeInputChangeListener(info);
         }
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 8ce6caf..e8cb720 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -672,6 +672,16 @@
         return tv() == null ? null : tv().getCecDeviceInfo(logicalAddress);
     }
 
+    @ServiceThreadOnly
+    HdmiDeviceInfo getDeviceInfoByPort(int port) {
+        assertRunOnServiceThread();
+        HdmiMhlLocalDeviceStub info = mMhlController.getLocalDevice(port);
+        if (info != null) {
+            return info.getInfo();
+        }
+        return null;
+    }
+
     /**
      * Returns version of CEC.
      */
diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java
index a72cc8d..105ec77 100644
--- a/services/core/java/com/android/server/media/MediaSessionService.java
+++ b/services/core/java/com/android/server/media/MediaSessionService.java
@@ -836,8 +836,8 @@
                             mAudioService.setMasterMute(!isMasterMute, flags, packageName, mICallback);
                         } else {
                             mAudioService.adjustMasterVolume(direction, flags, packageName);
-                            // Do not call setStreamMute when direction = 0 which is just to show
-                            // UI.
+                            // Do not call setMasterMute when direction = 0 which is used just to
+                            // show the UI.
                             if (isMasterMute && direction != 0) {
                                 mAudioService.setMasterMute(false, flags, packageName, mICallback);
                             }
@@ -849,8 +849,8 @@
                         } else {
                             mAudioService.adjustSuggestedStreamVolume(direction, suggestedStream,
                                     flags, packageName);
-                            // Do not call setStreamMute when direction = 0 which is just to show
-                            // UI.
+                            // Do not call setStreamMute when direction = 0 which is used just to
+                            // show the UI.
                             if (isStreamMute && direction != 0) {
                                 mAudioService.setStreamMute(suggestedStream, false, mICallback);
                             }
diff --git a/tools/layoutlib/.idea/codeStyleSettings.xml b/tools/layoutlib/.idea/codeStyleSettings.xml
index b324213..a04e440 100644
--- a/tools/layoutlib/.idea/codeStyleSettings.xml
+++ b/tools/layoutlib/.idea/codeStyleSettings.xml
@@ -67,9 +67,13 @@
             </groups>
           </arrangement>
         </codeStyleSettings>
+        <codeStyleSettings language="XML">
+          <indentOptions>
+            <option name="CONTINUATION_INDENT_SIZE" value="4" />
+          </indentOptions>
+        </codeStyleSettings>
       </value>
     </option>
     <option name="USE_PER_PROJECT_SETTINGS" value="true" />
   </component>
-</project>
-
+</project>
\ No newline at end of file
diff --git a/tools/layoutlib/bridge/src/android/preference/BridgePreferenceInflater.java b/tools/layoutlib/bridge/src/android/preference/BridgePreferenceInflater.java
new file mode 100644
index 0000000..4f00b5d
--- /dev/null
+++ b/tools/layoutlib/bridge/src/android/preference/BridgePreferenceInflater.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package android.preference;
+
+import com.android.layoutlib.bridge.android.BridgeContext;
+import com.android.layoutlib.bridge.android.BridgeXmlBlockParser;
+
+import android.content.Context;
+import android.util.AttributeSet;
+
+public class BridgePreferenceInflater extends PreferenceInflater {
+
+    public BridgePreferenceInflater(Context context, PreferenceManager preferenceManager) {
+        super(context, preferenceManager);
+    }
+
+    @Override
+    protected Preference onCreateItem(String name, AttributeSet attrs)
+            throws ClassNotFoundException {
+        Object viewKey = null;
+        BridgeContext bc = null;
+
+        Context context = getContext();
+        if (context instanceof BridgeContext) {
+            bc = (BridgeContext) context;
+        }
+        if (attrs instanceof BridgeXmlBlockParser) {
+            viewKey = ((BridgeXmlBlockParser) attrs).getViewCookie();
+        }
+
+        Preference preference = super.onCreateItem(name, attrs);
+
+        if (viewKey != null && bc != null) {
+            bc.addCookie(preference, viewKey);
+        }
+        return preference;
+    }
+}
diff --git a/tools/layoutlib/bridge/src/android/preference/Preference_Delegate.java b/tools/layoutlib/bridge/src/android/preference/Preference_Delegate.java
new file mode 100644
index 0000000..49ee642
--- /dev/null
+++ b/tools/layoutlib/bridge/src/android/preference/Preference_Delegate.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package android.preference;
+
+import com.android.internal.R;
+import com.android.layoutlib.bridge.android.BridgeContext;
+import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
+
+import org.xmlpull.v1.XmlPullParser;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ListView;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Delegate that provides implementation for native methods in {@link Preference}
+ * <p/>
+ * Through the layoutlib_create tool, selected methods of Preference have been replaced by calls to
+ * methods of the same name in this delegate class.
+ */
+public class Preference_Delegate {
+
+    @LayoutlibDelegate
+    /*package*/ static View getView(Preference pref, View convertView, ViewGroup parent) {
+        Context context = pref.getContext();
+        BridgeContext bc = context instanceof BridgeContext ? ((BridgeContext) context) : null;
+        convertView = pref.getView_Original(convertView, parent);
+        if (bc != null) {
+            Object cookie = bc.getCookie(pref);
+            if (cookie != null) {
+                bc.addViewKey(convertView, cookie);
+            }
+        }
+        return convertView;
+    }
+
+    /**
+     * Inflates the parser and returns the ListView containing the Preferences.
+     */
+    public static View inflatePreference(Context context, XmlPullParser parser, ViewGroup root) {
+        PreferenceManager pm = new PreferenceManager(context);
+        PreferenceScreen ps = pm.getPreferenceScreen();
+        PreferenceInflater inflater = new BridgePreferenceInflater(context, pm);
+        ps = (PreferenceScreen) inflater.inflate(parser, ps, true);
+        ListView preferenceView = createContainerView(context, root);
+        ps.bind(preferenceView);
+        return preferenceView;
+    }
+
+    private static ListView createContainerView(Context context, ViewGroup root) {
+        TypedArray a = context.obtainStyledAttributes(null, R.styleable.PreferenceFragment,
+                R.attr.preferenceFragmentStyle, 0);
+        int mLayoutResId = a.getResourceId(R.styleable.PreferenceFragment_layout,
+                        R.layout.preference_list_fragment);
+        a.recycle();
+
+        LayoutInflater inflater =
+                (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+        inflater.inflate(mLayoutResId, root, true);
+
+        return (ListView) root.findViewById(android.R.id.list);
+    }
+}
diff --git a/tools/layoutlib/bridge/src/android/text/StaticLayout_Delegate.java b/tools/layoutlib/bridge/src/android/text/StaticLayout_Delegate.java
index 5a467b2..b0d79a8 100644
--- a/tools/layoutlib/bridge/src/android/text/StaticLayout_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/text/StaticLayout_Delegate.java
@@ -13,8 +13,8 @@
 
 /**
  * Delegate that provides implementation for native methods in {@link android.text.StaticLayout}
- *
- * Through the layoutlib_create tool, selected methods of Handler have been replaced
+ * <p/>
+ * Through the layoutlib_create tool, selected methods of StaticLayout have been replaced
  * by calls to methods of the same name in this delegate class.
  *
  */
diff --git a/tools/layoutlib/bridge/src/android/widget/TimePickerClockDelegate_Delegate.java b/tools/layoutlib/bridge/src/android/widget/TimePickerClockDelegate_Delegate.java
new file mode 100644
index 0000000..1bd9830
--- /dev/null
+++ b/tools/layoutlib/bridge/src/android/widget/TimePickerClockDelegate_Delegate.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package android.widget;
+
+import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
+
+import android.view.KeyEvent;
+
+/**
+ * Delegate used to provide new implementation of few methods in {@link TimePickerClockDelegate}.
+ */
+public class TimePickerClockDelegate_Delegate {
+
+    // Copied from TimePickerClockDelegate.
+    private static final int AM = 0;
+    private static final int PM = 1;
+
+    @LayoutlibDelegate
+    static int getAmOrPmKeyCode(TimePickerClockDelegate tpcd, int amOrPm) {
+        // We don't care about locales here.
+        if (amOrPm == AM) {
+            return KeyEvent.KEYCODE_A;
+        } else if (amOrPm == PM) {
+            return KeyEvent.KEYCODE_P;
+        } else {
+            assert false : "amOrPm value in TimePickerSpinnerDelegate can only be 0 or 1";
+            return -1;
+        }
+    }
+}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
index 0af04ec..4d2c2fc 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -22,6 +22,7 @@
 import com.android.annotations.NonNull;
 import com.android.ide.common.rendering.api.Capability;
 import com.android.ide.common.rendering.api.DrawableParams;
+import com.android.ide.common.rendering.api.Features;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.ide.common.rendering.api.RenderSession;
 import com.android.ide.common.rendering.api.Result;
@@ -180,7 +181,7 @@
      */
     private static LayoutLog sCurrentLog = sDefaultLog;
 
-    private EnumSet<Capability> mCapabilities;
+    private static final int LAST_SUPPORTED_FEATURE = Features.PREFERENCES_RENDERING;
 
     @Override
     public int getApiLevel() {
@@ -188,8 +189,16 @@
     }
 
     @Override
+    @Deprecated
     public EnumSet<Capability> getCapabilities() {
-        return mCapabilities;
+        // The Capability class is deprecated and frozen. All Capabilities enumerated there are
+        // supported by this version of LayoutLibrary. So, it's safe to use EnumSet.allOf()
+        return EnumSet.allOf(Capability.class);
+    }
+
+    @Override
+    public boolean supports(int feature) {
+        return feature <= LAST_SUPPORTED_FEATURE;
     }
 
     @Override
@@ -200,26 +209,6 @@
         sPlatformProperties = platformProperties;
         sEnumValueMap = enumValueMap;
 
-        // don't use EnumSet.allOf(), because the bridge doesn't come with its specific version
-        // of layoutlib_api. It is provided by the client which could have a more recent version
-        // with newer, unsupported capabilities.
-        mCapabilities = EnumSet.of(
-                Capability.UNBOUND_RENDERING,
-                Capability.CUSTOM_BACKGROUND_COLOR,
-                Capability.RENDER,
-                Capability.LAYOUT_ONLY,
-                Capability.EMBEDDED_LAYOUT,
-                Capability.VIEW_MANIPULATION,
-                Capability.PLAY_ANIMATION,
-                Capability.ANIMATED_VIEW_MANIPULATION,
-                Capability.ADAPTER_BINDING,
-                Capability.EXTENDED_VIEWINFO,
-                Capability.FIXED_SCALABLE_NINE_PATCH,
-                Capability.RTL,
-                Capability.ACTION_BAR,
-                Capability.SIMULATE_PLATFORM);
-
-
         BridgeAssetManager.initSystem();
 
         // When DEBUG_LAYOUT is set and is not 0 or false, setup a default listener
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index e74debb..3953624 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -74,6 +74,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.WindowManager;
+import android.view.accessibility.AccessibilityManager;
 import android.view.textservice.TextServicesManager;
 
 import java.io.File;
@@ -93,8 +94,15 @@
  */
 public final class BridgeContext extends Context {
 
-    private Resources mSystemResources;
+    /** The map adds cookies to each view so that IDE can link xml tags to views. */
     private final HashMap<View, Object> mViewKeyMap = new HashMap<View, Object>();
+    /**
+     * In some cases, when inflating an xml, some objects are created. Then later, the objects are
+     * converted to views. This map stores the mapping from objects to cookies which can then be
+     * used to populate the mViewKeyMap.
+     */
+    private final HashMap<Object, Object> mViewKeyHelpMap = new HashMap<Object, Object>();
+    private Resources mSystemResources;
     private final Object mProjectKey;
     private final DisplayMetrics mMetrics;
     private final RenderResources mRenderResources;
@@ -121,8 +129,9 @@
     private BridgeContentResolver mContentResolver;
 
     private final Stack<BridgeXmlBlockParser> mParserStack = new Stack<BridgeXmlBlockParser>();
+    private SharedPreferences mSharedPreferences;
 
-    /**
+  /**
      * @param projectKey An Object identifying the project. This is used for the cache mechanism.
      * @param metrics the {@link DisplayMetrics}.
      * @param renderResources the configured resources (both framework and projects) for this
@@ -190,6 +199,14 @@
         return mViewKeyMap.get(view);
     }
 
+    public void addCookie(Object o, Object cookie) {
+        mViewKeyHelpMap.put(o, cookie);
+    }
+
+    public Object getCookie(Object o) {
+        return mViewKeyHelpMap.get(o);
+    }
+
     public Object getProjectKey() {
         return mProjectKey;
     }
@@ -461,6 +478,10 @@
             return mDisplayManager;
         }
 
+        if (ACCESSIBILITY_SERVICE.equals(service)) {
+            return AccessibilityManager.getInstance(this);
+        }
+
         throw new UnsupportedOperationException("Unsupported Service: " + service);
     }
 
@@ -476,19 +497,22 @@
     @Override
     public final BridgeTypedArray obtainStyledAttributes(int resid, int[] attrs)
             throws Resources.NotFoundException {
+        StyleResourceValue style = null;
         // get the StyleResourceValue based on the resId;
-        StyleResourceValue style = getStyleByDynamicId(resid);
+        if (resid != 0) {
+            style = getStyleByDynamicId(resid);
 
-        if (style == null) {
-            // In some cases, style may not be a dynamic id, so we do a full search.
-            ResourceReference ref = resolveId(resid);
-            if (ref != null) {
-                style = mRenderResources.getStyle(ref.getName(), ref.isFramework());
+            if (style == null) {
+                // In some cases, style may not be a dynamic id, so we do a full search.
+                ResourceReference ref = resolveId(resid);
+                if (ref != null) {
+                    style = mRenderResources.getStyle(ref.getName(), ref.isFramework());
+                }
             }
-        }
 
-        if (style == null) {
-            throw new Resources.NotFoundException();
+            if (style == null) {
+                throw new Resources.NotFoundException();
+            }
         }
 
         if (mTypedArrayCache == null) {
@@ -1176,8 +1200,10 @@
 
     @Override
     public SharedPreferences getSharedPreferences(String arg0, int arg1) {
-        // pass
-        return null;
+        if (mSharedPreferences == null) {
+            mSharedPreferences = new BridgeSharedPreferences();
+        }
+        return mSharedPreferences;
     }
 
     @Override
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeSharedPreferences.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeSharedPreferences.java
new file mode 100644
index 0000000..132ff2f
--- /dev/null
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeSharedPreferences.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package com.android.layoutlib.bridge.android;
+
+import android.content.SharedPreferences;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * An empty shared preferences implementation which doesn't store anything. It always returns
+ * null, 0 or false.
+ */
+public class BridgeSharedPreferences implements SharedPreferences {
+    private Editor mEditor;
+
+    @Override
+    public Map<String, ?> getAll() {
+        return null;
+    }
+
+    @Override
+    public String getString(String key, String defValue) {
+        return null;
+    }
+
+    @Override
+    public Set<String> getStringSet(String key, Set<String> defValues) {
+        return null;
+    }
+
+    @Override
+    public int getInt(String key, int defValue) {
+        return 0;
+    }
+
+    @Override
+    public long getLong(String key, long defValue) {
+        return 0;
+    }
+
+    @Override
+    public float getFloat(String key, float defValue) {
+        return 0;
+    }
+
+    @Override
+    public boolean getBoolean(String key, boolean defValue) {
+        return false;
+    }
+
+    @Override
+    public boolean contains(String key) {
+        return false;
+    }
+
+    @Override
+    public Editor edit() {
+        if (mEditor != null) {
+            return mEditor;
+        }
+        mEditor = new Editor() {
+            @Override
+            public Editor putString(String key, String value) {
+                return null;
+            }
+
+            @Override
+            public Editor putStringSet(String key, Set<String> values) {
+                return null;
+            }
+
+            @Override
+            public Editor putInt(String key, int value) {
+                return null;
+            }
+
+            @Override
+            public Editor putLong(String key, long value) {
+                return null;
+            }
+
+            @Override
+            public Editor putFloat(String key, float value) {
+                return null;
+            }
+
+            @Override
+            public Editor putBoolean(String key, boolean value) {
+                return null;
+            }
+
+            @Override
+            public Editor remove(String key) {
+                return null;
+            }
+
+            @Override
+            public Editor clear() {
+                return null;
+            }
+
+            @Override
+            public boolean commit() {
+                return false;
+            }
+
+            @Override
+            public void apply() {
+            }
+        };
+        return mEditor;
+    }
+
+    @Override
+    public void registerOnSharedPreferenceChangeListener(
+            OnSharedPreferenceChangeListener listener) {
+    }
+
+    @Override
+    public void unregisterOnSharedPreferenceChangeListener(
+            OnSharedPreferenceChangeListener listener) {
+    }
+}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/SessionParamsFlags.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/SessionParamsFlags.java
new file mode 100644
index 0000000..e00ea6a
--- /dev/null
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/SessionParamsFlags.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package com.android.layoutlib.bridge.android;
+
+import com.android.ide.common.rendering.api.SessionParams;
+
+/**
+ * This contains all known keys for the {@link SessionParams#getFlag(SessionParams.Key)}.
+ * <p/>
+ * The IDE has its own copy of this class which may be newer or older than this one.
+ * <p/>
+ * Constants should never be modified or removed from this class.
+ */
+public final class SessionParamsFlags {
+
+    public static final SessionParams.Key<String> FLAG_KEY_ROOT_TAG =
+            new SessionParams.Key<String>("rootTag", String.class);
+
+    // Disallow instances.
+    private SessionParamsFlags() {}
+}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
index a2eed9a..daf82fc 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
@@ -49,6 +49,7 @@
 import com.android.layoutlib.bridge.android.BridgeContext;
 import com.android.layoutlib.bridge.android.BridgeLayoutParamsMapAttributes;
 import com.android.layoutlib.bridge.android.BridgeXmlBlockParser;
+import com.android.layoutlib.bridge.android.SessionParamsFlags;
 import com.android.layoutlib.bridge.bars.Config;
 import com.android.layoutlib.bridge.bars.NavigationBar;
 import com.android.layoutlib.bridge.bars.StatusBar;
@@ -73,6 +74,7 @@
 import android.graphics.Bitmap_Delegate;
 import android.graphics.Canvas;
 import android.graphics.drawable.Drawable;
+import android.preference.Preference_Delegate;
 import android.util.DisplayMetrics;
 import android.util.TypedValue;
 import android.view.AttachInfo_Accessor;
@@ -87,7 +89,6 @@
 import android.view.ViewGroup.MarginLayoutParams;
 import android.view.ViewParent;
 import android.view.WindowManagerGlobal_Delegate;
-import android.view.ViewParent;
 import android.widget.AbsListView;
 import android.widget.AbsSpinner;
 import android.widget.ActionMenuView;
@@ -397,7 +398,15 @@
             // it can instantiate the custom Fragment.
             Fragment_Delegate.setProjectCallback(params.getProjectCallback());
 
-            View view = mInflater.inflate(mBlockParser, mContentRoot);
+            String rootTag = params.getFlag(SessionParamsFlags.FLAG_KEY_ROOT_TAG);
+            boolean isPreference = "PreferenceScreen".equals(rootTag);
+            View view;
+            if (isPreference) {
+                view = Preference_Delegate.inflatePreference(getContext(), mBlockParser,
+                  mContentRoot);
+            } else {
+                view = mInflater.inflate(mBlockParser, mContentRoot);
+            }
 
             // done with the parser, pop it.
             context.popParser();
@@ -408,7 +417,7 @@
             AttachInfo_Accessor.setAttachInfo(mViewRoot);
 
             // post-inflate process. For now this supports TabHost/TabWidget
-            postInflateProcess(view, params.getProjectCallback());
+            postInflateProcess(view, params.getProjectCallback(), isPreference ? view : null);
 
             // get the background drawable
             if (mWindowBackground != null) {
@@ -1210,12 +1219,16 @@
      * based on the content of the {@link FrameLayout}.
      * @param view the root view to process.
      * @param projectCallback callback to the project.
+     * @param skip the view and it's children are not processed.
      */
     @SuppressWarnings("deprecation")  // For the use of Pair
-    private void postInflateProcess(View view, IProjectCallback projectCallback)
+    private void postInflateProcess(View view, IProjectCallback projectCallback, View skip)
             throws PostInflateException {
+        if (view == skip) {
+            return;
+        }
         if (view instanceof TabHost) {
-            setupTabHost((TabHost)view, projectCallback);
+            setupTabHost((TabHost) view, projectCallback);
         } else if (view instanceof QuickContactBadge) {
             QuickContactBadge badge = (QuickContactBadge) view;
             badge.setImageToDefault();
@@ -1248,7 +1261,7 @@
                             boolean skipCallbackParser = false;
 
                             int count = binding.getHeaderCount();
-                            for (int i = 0 ; i < count ; i++) {
+                            for (int i = 0; i < count; i++) {
                                 Pair<View, Boolean> pair = context.inflateView(
                                         binding.getHeaderAt(i),
                                         list, false /*attachToRoot*/, skipCallbackParser);
@@ -1260,7 +1273,7 @@
                             }
 
                             count = binding.getFooterCount();
-                            for (int i = 0 ; i < count ; i++) {
+                            for (int i = 0; i < count; i++) {
                                 Pair<View, Boolean> pair = context.inflateView(
                                         binding.getFooterAt(i),
                                         list, false /*attachToRoot*/, skipCallbackParser);
@@ -1289,11 +1302,11 @@
                 }
             }
         } else if (view instanceof ViewGroup) {
-            ViewGroup group = (ViewGroup)view;
+            ViewGroup group = (ViewGroup) view;
             final int count = group.getChildCount();
-            for (int c = 0 ; c < count ; c++) {
+            for (int c = 0; c < count; c++) {
                 View child = group.getChildAt(c);
-                postInflateProcess(child, projectCallback);
+                postInflateProcess(child, projectCallback, skip);
             }
         }
     }
@@ -1361,6 +1374,7 @@
             for (int i = 0 ; i < count ; i++) {
                 View child = content.getChildAt(i);
                 String tabSpec = String.format("tab_spec%d", i+1);
+                @SuppressWarnings("ConstantConditions")  // child cannot be null.
                 int id = child.getId();
                 @SuppressWarnings("deprecation")
                 Pair<ResourceType, String> resource = projectCallback.resolveResourceId(id);
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/activity.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/activity.png
new file mode 100644
index 0000000..943cdf1
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/activity.png
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/layout/layout.xml b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/layout/layout.xml
index 2704c07..b8ec5661 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/layout/layout.xml
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/layout/layout.xml
@@ -8,4 +8,10 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="Some text"/>
+    <DatePicker
+        android:layout_width="100dp"
+        android:layout_height="100dp"/>
+    <CalendarView
+        android:layout_width="100dp"
+        android:layout_height="100dp"/>
 </LinearLayout>
\ No newline at end of file
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/ImageUtils.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/ImageUtils.java
new file mode 100644
index 0000000..e13ad72
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/ImageUtils.java
@@ -0,0 +1,336 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package com.android.layoutlib.bridge.intensive;
+
+import com.android.annotations.NonNull;
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.imageio.ImageIO;
+
+import static java.awt.RenderingHints.*;
+import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
+import static java.io.File.separatorChar;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+
+// Adapted by taking the relevant pieces of code from the following classes:
+//
+// com.android.tools.idea.rendering.ImageUtils,
+// com.android.tools.idea.tests.gui.framework.fixture.layout.ImageFixture and
+// com.android.tools.idea.rendering.RenderTestBase
+/**
+ * Utilities related to image processing.
+ */
+public class ImageUtils {
+    /**
+     * Normally, this test will fail when there is a missing thumbnail. However, when
+     * you create creating a new test, it's useful to be able to turn this off such that
+     * you can generate all the missing thumbnails in one go, rather than having to run
+     * the test repeatedly to get to each new render assertion generating its thumbnail.
+     */
+    private static final boolean FAIL_ON_MISSING_THUMBNAIL = true;
+
+    private static final int THUMBNAIL_SIZE = 250;
+
+    private static final double MAX_PERCENT_DIFFERENCE = 0.1;
+
+    public static void requireSimilar(@NonNull String relativePath, @NonNull BufferedImage image)
+            throws IOException {
+        int maxDimension = Math.max(image.getWidth(), image.getHeight());
+        double scale = THUMBNAIL_SIZE / (double)maxDimension;
+        BufferedImage thumbnail = scale(image, scale, scale);
+
+        InputStream is = ImageUtils.class.getResourceAsStream(relativePath);
+        if (is == null) {
+            String message = "Unable to load golden thumbnail: " + relativePath + "\n";
+            message = saveImageAndAppendMessage(thumbnail, message, relativePath);
+            if (FAIL_ON_MISSING_THUMBNAIL) {
+                fail(message);
+            } else {
+                System.out.println(message);
+            }
+        }
+        else {
+            BufferedImage goldenImage = ImageIO.read(is);
+            assertImageSimilar(relativePath, goldenImage, thumbnail, MAX_PERCENT_DIFFERENCE);
+        }
+    }
+
+    public static void assertImageSimilar(String relativePath, BufferedImage goldenImage,
+            BufferedImage image, double maxPercentDifferent) throws IOException {
+        assertEquals("Only TYPE_INT_ARGB image types are supported",  TYPE_INT_ARGB, image.getType());
+
+        if (goldenImage.getType() != TYPE_INT_ARGB) {
+            BufferedImage temp = new BufferedImage(goldenImage.getWidth(), goldenImage.getHeight(),
+                    TYPE_INT_ARGB);
+            temp.getGraphics().drawImage(goldenImage, 0, 0, null);
+            goldenImage = temp;
+        }
+        assertEquals(TYPE_INT_ARGB, goldenImage.getType());
+
+        int imageWidth = Math.min(goldenImage.getWidth(), image.getWidth());
+        int imageHeight = Math.min(goldenImage.getHeight(), image.getHeight());
+
+        // Blur the images to account for the scenarios where there are pixel
+        // differences
+        // in where a sharp edge occurs
+        // goldenImage = blur(goldenImage, 6);
+        // image = blur(image, 6);
+
+        int width = 3 * imageWidth;
+        @SuppressWarnings("UnnecessaryLocalVariable")
+        int height = imageHeight; // makes code more readable
+        BufferedImage deltaImage = new BufferedImage(width, height, TYPE_INT_ARGB);
+        Graphics g = deltaImage.getGraphics();
+
+        // Compute delta map
+        long delta = 0;
+        for (int y = 0; y < imageHeight; y++) {
+            for (int x = 0; x < imageWidth; x++) {
+                int goldenRgb = goldenImage.getRGB(x, y);
+                int rgb = image.getRGB(x, y);
+                if (goldenRgb == rgb) {
+                    deltaImage.setRGB(imageWidth + x, y, 0x00808080);
+                    continue;
+                }
+
+                // If the pixels have no opacity, don't delta colors at all
+                if (((goldenRgb & 0xFF000000) == 0) && (rgb & 0xFF000000) == 0) {
+                    deltaImage.setRGB(imageWidth + x, y, 0x00808080);
+                    continue;
+                }
+
+                int deltaR = ((rgb & 0xFF0000) >>> 16) - ((goldenRgb & 0xFF0000) >>> 16);
+                int newR = 128 + deltaR & 0xFF;
+                int deltaG = ((rgb & 0x00FF00) >>> 8) - ((goldenRgb & 0x00FF00) >>> 8);
+                int newG = 128 + deltaG & 0xFF;
+                int deltaB = (rgb & 0x0000FF) - (goldenRgb & 0x0000FF);
+                int newB = 128 + deltaB & 0xFF;
+
+                int avgAlpha = ((((goldenRgb & 0xFF000000) >>> 24)
+                        + ((rgb & 0xFF000000) >>> 24)) / 2) << 24;
+
+                int newRGB = avgAlpha | newR << 16 | newG << 8 | newB;
+                deltaImage.setRGB(imageWidth + x, y, newRGB);
+
+                delta += Math.abs(deltaR);
+                delta += Math.abs(deltaG);
+                delta += Math.abs(deltaB);
+            }
+        }
+
+        // 3 different colors, 256 color levels
+        long total = imageHeight * imageWidth * 3L * 256L;
+        float percentDifference = (float) (delta * 100 / (double) total);
+
+        String error = null;
+        String imageName = getName(relativePath);
+        if (percentDifference > maxPercentDifferent) {
+            error = String.format("Images differ (by %.1f%%)", percentDifference);
+        } else if (Math.abs(goldenImage.getWidth() - image.getWidth()) >= 2) {
+            error = "Widths differ too much for " + imageName + ": " +
+                    goldenImage.getWidth() + "x" + goldenImage.getHeight() +
+                    "vs" + image.getWidth() + "x" + image.getHeight();
+        } else if (Math.abs(goldenImage.getHeight() - image.getHeight()) >= 2) {
+            error = "Heights differ too much for " + imageName + ": " +
+                    goldenImage.getWidth() + "x" + goldenImage.getHeight() +
+                    "vs" + image.getWidth() + "x" + image.getHeight();
+        }
+
+        assertEquals(TYPE_INT_ARGB, image.getType());
+        if (error != null) {
+            // Expected on the left
+            // Golden on the right
+            g.drawImage(goldenImage, 0, 0, null);
+            g.drawImage(image, 2 * imageWidth, 0, null);
+
+            // Labels
+            if (imageWidth > 80) {
+                g.setColor(Color.RED);
+                g.drawString("Expected", 10, 20);
+                g.drawString("Actual", 2 * imageWidth + 10, 20);
+            }
+
+            File output = new File(getTempDir(), "delta-" + imageName);
+            if (output.exists()) {
+                boolean deleted = output.delete();
+                assertTrue(deleted);
+            }
+            ImageIO.write(deltaImage, "PNG", output);
+            error += " - see details in " + output.getPath() + "\n";
+            error = saveImageAndAppendMessage(image, error, relativePath);
+            System.out.println(error);
+            fail(error);
+        }
+
+        g.dispose();
+    }
+
+    /**
+     * Resize the given image
+     *
+     * @param source the image to be scaled
+     * @param xScale x scale
+     * @param yScale y scale
+     * @return the scaled image
+     */
+    @NonNull
+    public static BufferedImage scale(@NonNull BufferedImage source, double xScale, double yScale) {
+
+        int sourceWidth = source.getWidth();
+        int sourceHeight = source.getHeight();
+        int destWidth = Math.max(1, (int) (xScale * sourceWidth));
+        int destHeight = Math.max(1, (int) (yScale * sourceHeight));
+        int imageType = source.getType();
+        if (imageType == BufferedImage.TYPE_CUSTOM) {
+            imageType = BufferedImage.TYPE_INT_ARGB;
+        }
+        if (xScale > 0.5 && yScale > 0.5) {
+            BufferedImage scaled =
+                    new BufferedImage(destWidth, destHeight, imageType);
+            Graphics2D g2 = scaled.createGraphics();
+            g2.setComposite(AlphaComposite.Src);
+            g2.setColor(new Color(0, true));
+            g2.fillRect(0, 0, destWidth, destHeight);
+            if (xScale == 1 && yScale == 1) {
+                g2.drawImage(source, 0, 0, null);
+            } else {
+                setRenderingHints(g2);
+                g2.drawImage(source, 0, 0, destWidth, destHeight, 0, 0, sourceWidth, sourceHeight,
+                        null);
+            }
+            g2.dispose();
+            return scaled;
+        } else {
+            // When creating a thumbnail, using the above code doesn't work very well;
+            // you get some visible artifacts, especially for text. Instead use the
+            // technique of repeatedly scaling the image into half; this will cause
+            // proper averaging of neighboring pixels, and will typically (for the kinds
+            // of screen sizes used by this utility method in the layout editor) take
+            // about 3-4 iterations to get the result since we are logarithmically reducing
+            // the size. Besides, each successive pass in operating on much fewer pixels
+            // (a reduction of 4 in each pass).
+            //
+            // However, we may not be resizing to a size that can be reached exactly by
+            // successively diving in half. Therefore, once we're within a factor of 2 of
+            // the final size, we can do a resize to the exact target size.
+            // However, we can get even better results if we perform this final resize
+            // up front. Let's say we're going from width 1000 to a destination width of 85.
+            // The first approach would cause a resize from 1000 to 500 to 250 to 125, and
+            // then a resize from 125 to 85. That last resize can distort/blur a lot.
+            // Instead, we can start with the destination width, 85, and double it
+            // successfully until we're close to the initial size: 85, then 170,
+            // then 340, and finally 680. (The next one, 1360, is larger than 1000).
+            // So, now we *start* the thumbnail operation by resizing from width 1000 to
+            // width 680, which will preserve a lot of visual details such as text.
+            // Then we can successively resize the image in half, 680 to 340 to 170 to 85.
+            // We end up with the expected final size, but we've been doing an exact
+            // divide-in-half resizing operation at the end so there is less distortion.
+
+            int iterations = 0; // Number of halving operations to perform after the initial resize
+            int nearestWidth = destWidth; // Width closest to source width that = 2^x, x is integer
+            int nearestHeight = destHeight;
+            while (nearestWidth < sourceWidth / 2) {
+                nearestWidth *= 2;
+                nearestHeight *= 2;
+                iterations++;
+            }
+
+            BufferedImage scaled = new BufferedImage(nearestWidth, nearestHeight, imageType);
+
+            Graphics2D g2 = scaled.createGraphics();
+            setRenderingHints(g2);
+            g2.drawImage(source, 0, 0, nearestWidth, nearestHeight, 0, 0, sourceWidth, sourceHeight,
+                    null);
+            g2.dispose();
+
+            sourceWidth = nearestWidth;
+            sourceHeight = nearestHeight;
+            source = scaled;
+
+            for (int iteration = iterations - 1; iteration >= 0; iteration--) {
+                int halfWidth = sourceWidth / 2;
+                int halfHeight = sourceHeight / 2;
+                scaled = new BufferedImage(halfWidth, halfHeight, imageType);
+                g2 = scaled.createGraphics();
+                setRenderingHints(g2);
+                g2.drawImage(source, 0, 0, halfWidth, halfHeight, 0, 0, sourceWidth, sourceHeight,
+                        null);
+                g2.dispose();
+
+                sourceWidth = halfWidth;
+                sourceHeight = halfHeight;
+                source = scaled;
+                iterations--;
+            }
+            return scaled;
+        }
+    }
+
+    private static void setRenderingHints(@NonNull Graphics2D g2) {
+        g2.setRenderingHint(KEY_INTERPOLATION,VALUE_INTERPOLATION_BILINEAR);
+        g2.setRenderingHint(KEY_RENDERING, VALUE_RENDER_QUALITY);
+        g2.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
+    }
+
+    /**
+     * Temp directory where to write the thumbnails and deltas.
+     */
+    @NonNull
+    private static File getTempDir() {
+        if (System.getProperty("os.name").equals("Mac OS X")) {
+            return new File("/tmp"); //$NON-NLS-1$
+        }
+
+        return new File(System.getProperty("java.io.tmpdir")); //$NON-NLS-1$
+    }
+
+    /**
+     * Saves the generated thumbnail image and appends the info message to an initial message
+     */
+    @NonNull
+    private static String saveImageAndAppendMessage(@NonNull BufferedImage image,
+            @NonNull String initialMessage, @NonNull String relativePath) throws IOException {
+        File output = new File(getTempDir(), getName(relativePath));
+        if (output.exists()) {
+            boolean deleted = output.delete();
+            assertTrue(deleted);
+        }
+        ImageIO.write(image, "PNG", output);
+        initialMessage += "Thumbnail for current rendering stored at " + output.getPath();
+//        initialMessage += "\nRun the following command to accept the changes:\n";
+//        initialMessage += String.format("mv %1$s %2$s", output.getPath(),
+//                ImageUtils.class.getResource(relativePath).getPath());
+        // The above has been commented out, since the destination path returned is in out dir
+        // and it makes the tests pass without the code being actually checked in.
+        return initialMessage;
+    }
+
+    private static String getName(@NonNull String relativePath) {
+        return relativePath.substring(relativePath.lastIndexOf(separatorChar) + 1);
+    }
+}
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java
index a2588a6..b439b34 100644
--- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java
+++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java
@@ -39,6 +39,7 @@
 
 import java.io.File;
 import java.io.FileFilter;
+import java.io.IOException;
 import java.net.URL;
 import java.util.Arrays;
 import java.util.Comparator;
@@ -280,6 +281,12 @@
             getLogger().error(session.getResult().getException(),
                     session.getResult().getErrorMessage());
         }
+        String goldenDataDir = APP_TEST_RES + "/../../../golden/";
+        try {
+            ImageUtils.requireSimilar(goldenDataDir + "activity.png", session.getImage());
+        } catch (IOException e) {
+            getLogger().error(e, e.getMessage());
+        }
     }
 
     /**
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
index 5a979e8..7faaed9 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
@@ -152,6 +152,7 @@
         "android.graphics.Typeface#getSystemFontConfigLocation",
         "android.os.Handler#sendMessageAtTime",
         "android.os.HandlerThread#run",
+        "android.preference.Preference#getView",
         "android.text.format.DateFormat#is24HourFormat",
         "android.util.Xml#newPullParser",
         "android.view.Choreographer#getRefreshRate",
@@ -169,6 +170,7 @@
         "android.view.RenderNode#nSetElevation",
         "android.view.RenderNode#nGetElevation",
         "android.view.ViewGroup#drawChild",
+        "android.widget.TimePickerClockDelegate#getAmOrPmKeyCode",
         "com.android.internal.view.menu.MenuBuilder#createNewMenuItem",
         "com.android.internal.util.XmlUtils#convertValueToInt",
         "com.android.internal.textservice.ITextServicesManager$Stub#asInterface",
@@ -226,7 +228,6 @@
         "android.os.SystemProperties",
         "android.text.AndroidBidi",
         "android.text.StaticLayout",
-        "android.text.format.Time",
         "android.util.FloatMath",
         "android.view.Display",
         "libcore.icu.DateIntervalFormat",
@@ -272,6 +273,7 @@
 
     private final static String[] EXCLUDED_CLASSES =
         new String[] {
+            "android.preference.PreferenceActivity",
             "org.kxml2.io.KXmlParser"
         };
 
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
index cd3c39e..fa570c8 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
@@ -108,6 +108,7 @@
                         "android.graphics.drawable.*",
                         "android.content.*",
                         "android.content.res.*",
+                        "android.preference.*",
                         "org.apache.harmony.xml.*",
                         "com.android.internal.R**",
                         "android.pim.*", // for datepicker