From e2b44f86b9ff32cc5fec04c10d09d639fd1f45f2 Mon Sep 17 00:00:00 2001 From: Scott Rowe Date: Thu, 13 Nov 2014 10:33:33 -0800 Subject: docs: Making TV Apps Searchable - new training Change-Id: I188c14789c9ba36a35d0c2d07b349ac301837a48 --- docs/html/guide/topics/search/searchable-config.jd | 96 +++++++++++----------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'docs/html/guide/topics') 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 @@ Android uses the filename as the resource ID.
 <?xml version="1.0" encoding="utf-8"?>
 <searchable xmlns:android="http://schemas.android.com/apk/res/android"
-    android:label="string resource"
-    android:hint="string resource"
-    android:searchMode=["queryRewriteFromData" | "queryRewriteFromText"]
-    android:searchButtonText="string resource"
-    android:inputType="{@link android.R.attr#inputType}"
-    android:imeOptions="{@link android.R.attr#imeOptions}"
-    android:searchSuggestAuthority="string"
-    android:searchSuggestPath="string"
-    android:searchSuggestSelection="string"
-    android:searchSuggestIntentAction="string"
-    android:searchSuggestIntentData="string"
-    android:searchSuggestThreshold="int"
-    android:includeInGlobalSearch=["true" | "false"]
-    android:searchSettingsDescription="string resource"
-    android:queryAfterZeroResults=["true" | "false"]
-    android:voiceSearchMode=["showVoiceSearchButton" | "launchWebSearch" | "launchRecognizer"]
-    android:voiceLanguageModel=["free-form" | "web_search"]
-    android:voicePromptText="string resource"
-    android:voiceLanguage="string"
-    android:voiceMaxResults="int"
+    android:label="string resource"
+    android:hint="string resource"
+    android:searchMode=["queryRewriteFromData" | "queryRewriteFromText"]
+    android:searchButtonText="string resource"
+    android:inputType="{@link android.R.attr#inputType}"
+    android:imeOptions="{@link android.R.attr#imeOptions}"
+    android:searchSuggestAuthority="string"
+    android:searchSuggestPath="string"
+    android:searchSuggestSelection="string"
+    android:searchSuggestIntentAction="string"
+    android:searchSuggestIntentData="string"
+    android:searchSuggestThreshold="int"
+    android:includeInGlobalSearch=["true" | "false"]
+    android:searchSettingsDescription="string resource"
+    android:queryAfterZeroResults=["true" | "false"]
+    android:voiceSearchMode=["showVoiceSearchButton" | "launchWebSearch" | "launchRecognizer"]
+    android:voiceLanguageModel=["free-form" | "web_search"]
+    android:voicePromptText="string resource"
+    android:voiceLanguage="string"
+    android:voiceMaxResults="int"
     >
     <actionkey
         android:keycode="{@link android.view.KeyEvent KEYCODE}"
@@ -69,7 +69,7 @@ Android uses the filename as the resource ID.
   
Defines all search configurations used by the Android system to provide assisted search.

attributes:

-
android:label
+
android:label
String resource. (Required.) The name of your application. It should be the same as the name applied to the {@code android:label} attribute of your {@code <activity>} or @@ -78,14 +78,14 @@ href="{@docRoot}guide/topics/manifest/activity-element.html#label">{@code <ac android:includeInGlobalSearch to "true", in which case, this label is used to identify your application as a searchable item in the system's search settings.
-
android:hint
+
android:hint
String resource. (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 <content-or-product>". For example, "Search songs and artists" or "Search YouTube".
-
android:searchMode
+
android:searchMode
Keyword. 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 @@ inspection and editing, typically HTTP URI's. href="adding-custom-suggestions.html#RewritingQueryText">Adding Custom Suggestions.

-
android:searchButtonText
+
android:searchButtonText
String resource. 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).
-
android:inputType
+
android:inputType
Keyword. 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.
-
android:imeOptions
+
android:imeOptions
Keyword. 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 @@ for this attribute. {@code <searchable>} attributes:


-
android:searchSuggestAuthority
+
android:searchSuggestAuthority
String. (Required to provide search suggestions.) This value must match the authority string provided in the {@code android:authorities} attribute of the Android manifest {@code <provider>} element.
-
android:searchSuggestPath
+
android:searchSuggestPath
String. 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 @@ the standard suggestions path. of suggestions (such as for different data types) and you need a way to disambiguate the suggestions queries when you receive them.
-
android:searchSuggestSelection
+
android:searchSuggestSelection
String. 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 @@ actual query string that has been typed by the user (for example, {@code "query= 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).
-
android:searchSuggestIntentAction
+
android:searchSuggestIntentAction
String. 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.
-
android:searchSuggestIntentData
+
android:searchSuggestIntentData
String. 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.
-
android:searchSuggestThreshold
+
android:searchSuggestThreshold
Integer. 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.
@@ -192,20 +192,20 @@ android.app.SearchManager#SUGGEST_COLUMN_INTENT_DATA} column), this value is following {@code <searchable>} attributes:


-
android:includeInGlobalSearch
+
android:includeInGlobalSearch
Boolean. (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.
-
android:searchSettingsDescription
+
android:searchSettingsDescription
String. 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.
-
android:queryAfterZeroResults
+
android:queryAfterZeroResults
Boolean. 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 @@ content provider again). The default value is false.
following {@code <searchable>} attributes:


-
android:voiceSearchMode
+
android:voiceSearchMode
Keyword. (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 @@ then either {@code "launchWebSearch"} or {@code "launchRecognizer"} must also be
-
android:voiceLanguageModel
+
android:voiceLanguageModel
Keyword. The language model that should be used by the voice recognition system. The following values are accepted: @@ -268,20 +268,20 @@ optimized for English. This is the default. available in more languages than "free_form".
-

Also see +

Also see {@link android.speech.RecognizerIntent#EXTRA_LANGUAGE_MODEL} for more information.

-
android:voicePromptText
+
android:voicePromptText
String. An additional message to display in the voice input dialog.
-
android:voiceLanguage
+
android:voiceLanguage
String. 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()}.
-
android:voiceMaxResults
+
android:voiceMaxResults
Integer. 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 @@ keys are not generally discoverable, so you should not provide them as a core us other three attributes in order to define the search action.

attributes:

-
android:keycode
+
android:keycode
String. (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 @@ android.view.KeyEvent} that represents the action key keys are supported for a search action, as many of them are used for typing, navigation, or system functions.
-
android:queryActionMsg
+
android:queryActionMsg
String. 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 @@ user is entering query text. This is added to the {@link android.content.Intent#getStringExtra getStringExtra(SearchManager.ACTION_MSG)}.
-
android:suggestActionMsg
+
android:suggestActionMsg
String. 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.
-
android:suggestActionMsgColumn
+
android:suggestActionMsgColumn
String. 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 -- cgit v1.1