| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Copyright 2013 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. |
| --> |
| <sample> |
| <name>BasicContactables</name> |
| <group>Content</group> |
| <package>com.example.android.basiccontactables</package> |
| |
| <!-- change minSdk if needed--> |
| <minSdk>18</minSdk> |
| <targetSdkVersion>22</targetSdkVersion> |
| |
| <strings> |
| <intro> |
| <![CDATA[ |
| This sample demonstrates how to use the Contactables table to search for contacts. |
| \n\nQuery strings sent to the Contactables table will match both contact names and phone numbers, |
| reducing the number of queries your application needs to use when searching the contacts database! |
| ]]> |
| </intro> |
| </strings> |
| |
| <template src="base"/> |
| <common src="logger"/> |
| |
| <metadata> |
| <status>PUBLISHED</status> |
| <categories>Content</categories> |
| <technologies>Android</technologies> |
| <languages>Java</languages> |
| <solutions>Mobile</solutions> |
| <level>INTERMEDIATE</level> |
| <icon>screenshots/icon-web.png</icon> |
| <screenshots> |
| <img>screenshots/1-main.png</img> |
| <img>screenshots/2-search.png</img> |
| <img>screenshots/3-results.png</img> |
| </screenshots> |
| <api_refs> |
| <android>android.app.SearchManager</android> |
| <android>android.widget.SearchView</android> |
| <android>android.app.LoaderManager</android> |
| <android>android.content.CursorLoader</android> |
| <android>android.provider.ContactsContract.CommonDataKinds</android> |
| </api_refs> |
| |
| <description> |
| <![CDATA[ |
| This sample shows how to search for contacts, displaying a SearchView in the Action Bar for user input and implementing a query Cursor with CommonDataKinds.Contactables. |
| ]]> |
| </description> |
| |
| <intro> |
| <![CDATA[ |
| This sample displays a [SearchView][1] in the Action Bar when the search icon is clicked. It then implements the [LoaderManager.LoaderCallbacks][2] interface to query the contacts table, using a [CursorLoader][3]. |
| |
| For details on how to implement the [SearchView][1], refer to the training guide [Setting up the search interface][4]. |
| |
| For details on how to implement the [LoaderManager.LoaderCallbacks][2] interface, refer to the [Using the LoaderManager Callbacks][5] guide. |
| |
| For details on how to query the contacts provider, refer to the [Contacts Provider Access][6] guide. |
| |
| [1]: http://developer.android.com/reference/android/widget/SearchView.html |
| [2]: http://developer.android.com/reference/android/app/LoaderManager.LoaderCallbacks.html |
| [3]: http://developer.android.com/reference/android/content/CursorLoader.html |
| [4]: http://developer.android.com/training/search/setup.html |
| [5]: http://developer.android.com/guide/components/loaders.html#callback |
| [6]: http://developer.android.com/guide/topics/providers/contacts-provider.html#Access |
| ]]> |
| </intro> |
| </metadata> |
| |
| </sample> |