Scott Main | 50992e8 | 2009-08-29 13:08:18 -0700 | [diff] [blame] | 1 | <p>A sample application that demonstrates Android's search framework.</p> |
| 2 | |
Scott Main | beca3af | 2010-03-25 17:37:25 -0700 | [diff] [blame] | 3 | <p>This application includes a dictionary of words. By invoking the Android search dialog inside the |
| 4 | app (via the device search button or Menu > Search), you can perform a search |
Scott Main | 50992e8 | 2009-08-29 13:08:18 -0700 | [diff] [blame] | 5 | across the dictionary. As you type, suggestions will appear, which you can select |
Scott Main | beca3af | 2010-03-25 17:37:25 -0700 | [diff] [blame] | 6 | to view the complete definition. You can also execute the search to view all word definitions |
Scott Main | 05bd673 | 2010-04-22 11:01:17 -0700 | [diff] [blame] | 7 | that match the entered text. The application also allows Quick Search Box (Android's system-wide |
| 8 | search) to provide dictionary suggestions.</p> |
Scott Main | beca3af | 2010-03-25 17:37:25 -0700 | [diff] [blame] | 9 | |
| 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 Main | 05bd673 | 2010-04-22 11:01:17 -0700 | [diff] [blame] | 14 | <li>Create an SQLite database and an FTS3 table for full-text searches</li> |
Scott Main | 9efea49 | 2010-12-08 09:26:56 -0800 | [diff] [blame] | 15 | <li>Create a <a href="../../../guide/topics/providers/content-providers.html">content |
Scott Main | 05bd673 | 2010-04-22 11:01:17 -0700 | [diff] [blame] | 16 | provider</a> to perform all search and suggestion queries</li> |
| 17 | <li>Use <code><a |
| 18 | href="../../../reference/android/widget/SimpleCursorAdapter.html">SimpleCursorAdapter</a></code> to |
| 19 | bind data from a Cursor to a ListView.</li> |
Scott Main | beca3af | 2010-03-25 17:37:25 -0700 | [diff] [blame] | 20 | </ul> |
| 21 | |
Scott Main | 235371e | 2011-02-07 09:44:02 -0800 | [diff] [blame] | 22 | <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 |
| 25 | Bar</a> and the <code><a |
| 26 | href="../../../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 Main | 50992e8 | 2009-08-29 13:08:18 -0700 | [diff] [blame] | 30 | <p>See also:</p> |
| 31 | <ul> |
Scott Main | beca3af | 2010-03-25 17:37:25 -0700 | [diff] [blame] | 32 | <li><a href="../../../guide/topics/search/index.html">Search Developer Guide</a></li> |
Scott Main | 50992e8 | 2009-08-29 13:08:18 -0700 | [diff] [blame] | 33 | </ul> |
| 34 | |
Scott Main | 05bd673 | 2010-04-22 11:01:17 -0700 | [diff] [blame] | 35 | <p class="note"><strong>Note:</strong> For the original version of Searchable Dictionary, which |
| 36 | reads words from a file instead of a database and uses a custom <code><a |
| 37 | href="../../../reference/android/widget/BaseAdapter.html">BaseAdapter</a></code>, see the SDK |
| 38 | samples included with the platforms for API Level 4-6.</p> |
| 39 | |
Scott Main | beca3af | 2010-03-25 17:37:25 -0700 | [diff] [blame] | 40 | |
Scott Main | 50992e8 | 2009-08-29 13:08:18 -0700 | [diff] [blame] | 41 | <img src="../images/SearchableDictionary1.png" /> |
Scott Main | 05bd673 | 2010-04-22 11:01:17 -0700 | [diff] [blame] | 42 | <img src="../images/SearchableDictionary2.png" /> |