blob: 1e929be8281b6a293c1fc2e6f3f11f0529952982 [file] [log] [blame]
Scott Main50992e82009-08-29 13:08:18 -07001<p>A sample application that demonstrates Android's search framework.</p>
2
Scott Mainbeca3af2010-03-25 17:37:25 -07003<p>This application includes a dictionary of words. By invoking the Android search dialog inside the
4app (via the device search button or Menu > Search), you can perform a search
Scott Main50992e82009-08-29 13:08:18 -07005across the dictionary. As you type, suggestions will appear, which you can select
Scott Mainbeca3af2010-03-25 17:37:25 -07006to view the complete definition. You can also execute the search to view all word definitions
Scott Main05bd6732010-04-22 11:01:17 -07007that match the entered text. The application also allows Quick Search Box (Android's system-wide
8search) to provide dictionary suggestions.</p>
Scott Mainbeca3af2010-03-25 17:37:25 -07009
10<p>The code in this application demonstrates how to:</p>
11<ul>
12 <li>Implement a search interface using Android's search framework</li>
13 <li>Provide custom search suggestions and offer them in Quick Search Box</li>
Scott Main05bd6732010-04-22 11:01:17 -070014 <li>Create an SQLite database and an FTS3 table for full-text searches</li>
Scott Main9efea492010-12-08 09:26:56 -080015 <li>Create a <a href="../../../guide/topics/providers/content-providers.html">content
Scott Main05bd6732010-04-22 11:01:17 -070016provider</a> to perform all search and suggestion queries</li>
17 <li>Use <code><a
18href="../../../reference/android/widget/SimpleCursorAdapter.html">SimpleCursorAdapter</a></code> to
19bind data from a Cursor to a ListView.</li>
Scott Mainbeca3af2010-03-25 17:37:25 -070020</ul>
21
Scott Main235371e2011-02-07 09:44:02 -080022<p><b>Revisions:</b></p>
23<ul>
24 <li>Updated for Android 3.0 to use the <a href="../../../guide/topics/ui/actionbar.html">Action
25Bar</a> and the <code><a
26href="../../../reference/android/widget/SearchView.html">SearchView</a></code> widget as an action item.
27(Available in the <em>Samples for SDK API 11</em>.)</li>
28</ul>
29
Scott Main50992e82009-08-29 13:08:18 -070030<p>See also:</p>
31<ul>
Scott Mainbeca3af2010-03-25 17:37:25 -070032 <li><a href="../../../guide/topics/search/index.html">Search Developer Guide</a></li>
Scott Main50992e82009-08-29 13:08:18 -070033</ul>
34
Scott Main05bd6732010-04-22 11:01:17 -070035<p class="note"><strong>Note:</strong> For the original version of Searchable Dictionary, which
36reads words from a file instead of a database and uses a custom <code><a
37href="../../../reference/android/widget/BaseAdapter.html">BaseAdapter</a></code>, see the SDK
38samples included with the platforms for API Level 4-6.</p>
39
Scott Mainbeca3af2010-03-25 17:37:25 -070040
Scott Main50992e82009-08-29 13:08:18 -070041<img src="../images/SearchableDictionary1.png" />
Scott Main05bd6732010-04-22 11:01:17 -070042<img src="../images/SearchableDictionary2.png" />