From 8443fad483300114f076e70e7f4f3a4186bc8fd5 Mon Sep 17 00:00:00 2001
From: Scott Rowe
TV devices offer many entertainment options for users. They have thousands of content options
from apps and related content services. At the same time, most users prefer to use TVs with the
- least amount of input possible. With the amount of choice available to users, it is important for
+ least amount of input possible. With the number of choices available to users, it is important for
app developers to provide quick and easy paths for users to discover and enjoy your content.
Your application's database class might define the columns as follows: 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.
public class VideoDatabase {
//The columns we'll include in the video database table
@@ -136,8 +134,6 @@ public class VideoDatabase {
...
private static HashMap
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
@@ -248,8 +242,6 @@ provider includes the {@code android:searchSuggestAuthority} attribute to tell t
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.
-
<provider android:name="com.example.android.tvleanback.VideoContentProvider"
android:authorities="com.example.android.tvleanback"
@@ -294,8 +286,6 @@ question mark ({@code ?}) value is replaced with the query text.
{@code searchable.xml}
file:
-
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/search_label"
@@ -320,8 +310,6 @@ intent searches the repository for columns with the given word in their values,
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:
-
...
<activity
@@ -361,8 +349,12 @@ Suggestions and mapped the {@link android.app.SearchManager#SUGGEST_COLUMN_T
{@link android.app.SearchManager#SUGGEST_COLUMN_CONTENT_TYPE}, and
{@link android.app.SearchManager#SUGGEST_COLUMN_PRODUCTION_YEAR} fields as described in
Identify Columns, a
-deep link to your content appears in the details screen that launches when the user selects a
-search result.
+deep link to a watch action for your content appears in the details screen that launches when
+the user selects a search result, as shown in figure 1.
+
+
+Figure 1. The details screen displays a deep link for the
+Videos by Google (Leanback) sample app. Sintel: © copyright Blender Foundation, www.sintel.org.
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}
--
cgit v1.1