µ±Ç°Î»Ö㺠´úÂëÃÔ >> Android >> Android ֮ȥͨѶ¼ÖÐÌí¼ÓÊý¾ÝºÍ²éѯÊý¾Ý¡¾×ª¡¿
  Ïêϸ½â¾ö·½°¸

Android ֮ȥͨѶ¼ÖÐÌí¼ÓÊý¾ÝºÍ²éѯÊý¾Ý¡¾×ª¡¿

Èȶȣº162   ·¢²¼Ê±¼ä£º2016-05-01 17:03:39.0
Android Ö®ÍùͨѶ¼ÖÐÌí¼ÓÊý¾ÝºÍ²éѯÊý¾Ý¡¾×ª¡¿

http://blog.csdn.net/hosterZhu/archive/2011/01/20/6154461.aspx

?

?Ê×ÏÈ ÎÒÃÇÒªÔÚE:\android-sdk-windows\platforms\android-8\sources\ContactsProvider? ÕÒµ½Ô´Âë £¡

?ÒòΪandroid×Ô´øµÄͨѶ¼ҲÊÇͨ¹ýContentProvider¶ÔÍâ¹²ÏíÊý¾Ý¡£

?ÌùµãÔ´Â룺

?URI? ÕâÊÇContactsProvider2.java

?

view plaincopy to clipboardprint?
  1. static?{??
  2. ????????//?Contacts?URI?matching?table??
  3. ????????final?UriMatcher?matcher?=?sUriMatcher;??
  4. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts",?CONTACTS);??
  5. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/#",?CONTACTS_ID);??
  6. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/#/data",?CONTACTS_DATA);??
  7. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/#/suggestions",??
  8. ????????????????AGGREGATION_SUGGESTIONS);??
  9. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/#/suggestions/*",??
  10. ????????????????AGGREGATION_SUGGESTIONS);??
  11. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/#/photo",?CONTACTS_PHOTO);??
  12. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/filter/*",?CONTACTS_FILTER);??
  13. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/lookup/*",?CONTACTS_LOOKUP);??
  14. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/lookup/*/#",?CONTACTS_LOOKUP_ID);??
  15. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/as_vcard/*",?CONTACTS_AS_VCARD);??
  16. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/as_multi_vcard/*",??
  17. ????????????????CONTACTS_AS_MULTI_VCARD);??
  18. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/strequent/",?CONTACTS_STREQUENT);??
  19. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/strequent/filter/*",??
  20. ????????????????CONTACTS_STREQUENT_FILTER);??
  21. ????????matcher.addURI(ContactsContract.AUTHORITY,?"contacts/group/*",?CONTACTS_GROUP);??
  22. ????????matcher.addURI(ContactsContract.AUTHORITY,?"raw_contacts",?RAW_CONTACTS);??
  23. ????????matcher.addURI(ContactsContract.AUTHORITY,?"raw_contacts/#",?RAW_CONTACTS_ID);??
  24. ????????matcher.addURI(ContactsContract.AUTHORITY,?"raw_contacts/#/data",?RAW_CONTACTS_DATA);??
  25. ????????matcher.addURI(ContactsContract.AUTHORITY,?"raw_contacts/#/entity",?RAW_CONTACT_ENTITY_ID);??
  26. ????????matcher.addURI(ContactsContract.AUTHORITY,?"raw_contact_entities",?RAW_CONTACT_ENTITIES);??
  27. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data",?DATA);??
  28. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/#",?DATA_ID);??
  29. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/phones",?PHONES);??
  30. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/phones/#",?PHONES_ID);??
  31. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/phones/filter",?PHONES_FILTER);??
  32. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/phones/filter/*",?PHONES_FILTER);??
  33. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/emails",?EMAILS);??
  34. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/emails/#",?EMAILS_ID);??
  35. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/emails/lookup/*",?EMAILS_LOOKUP);??
  36. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/emails/filter",?EMAILS_FILTER);??
  37. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/emails/filter/*",?EMAILS_FILTER);??
  38. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/postals",?POSTALS);??
  39. ????????matcher.addURI(ContactsContract.AUTHORITY,?"data/postals/#",?POSTALS_ID);??
  40. ????????matcher.addURI(ContactsContract.AUTHORITY,?"groups",?GROUPS);??
  41. ????????matcher.addURI(ContactsContract.AUTHORITY,?"groups/#",?GROUPS_ID);??
  42. ????????matcher.addURI(ContactsContract.AUTHORITY,?"groups_summary",?GROUPS_SUMMARY);??
  43. ????????matcher.addURI(ContactsContract.AUTHORITY,?SyncStateContentProviderHelper.PATH,?SYNCSTATE);??
  44. ????????matcher.addURI(ContactsContract.AUTHORITY,?SyncStateContentProviderHelper.PATH?+?"/#",??
  45. ????????????????SYNCSTATE_ID);??
  46. ????????matcher.addURI(ContactsContract.AUTHORITY,?"phone_lookup/*",?PHONE_LOOKUP);??
  47. ????????matcher.addURI(ContactsContract.AUTHORITY,?"aggregation_exceptions",??
  48. ????????????????AGGREGATION_EXCEPTIONS);??
  49. ????????matcher.addURI(ContactsContract.AUTHORITY,?"aggregation_exceptions/*",??
  50. ????????????????AGGREGATION_EXCEPTION_ID);??
  51. ????????matcher.addURI(ContactsContract.AUTHORITY,?"settings",?SETTINGS);??
  52. ????????matcher.addURI(ContactsContract.AUTHORITY,?"status_updates",?STATUS_UPDATES);??
  53. ????????matcher.addURI(ContactsContract.AUTHORITY,?"status_updates/#",?STATUS_UPDATES_ID);??
  54. ????????matcher.addURI(ContactsContract.AUTHORITY,?SearchManager.SUGGEST_URI_PATH_QUERY,??
  55. ????????????????SEARCH_SUGGESTIONS);??
  56. ????????matcher.addURI(ContactsContract.AUTHORITY,?SearchManager.SUGGEST_URI_PATH_QUERY?+?"/*",??
  57. ????????????????SEARCH_SUGGESTIONS);??
  58. ????????matcher.addURI(ContactsContract.AUTHORITY,?SearchManager.SUGGEST_URI_PATH_SHORTCUT?+?"/*",??
  59. ????????????????SEARCH_SHORTCUT);??
  60. ????????matcher.addURI(ContactsContract.AUTHORITY,?"live_folders/contacts",??
  61. ????????????????LIVE_FOLDERS_CONTACTS);??
  62. ????????matcher.addURI(ContactsContract.AUTHORITY,?"live_folders/contacts/*",??
  63. ????????????????LIVE_FOLDERS_CONTACTS_GROUP_NAME);??
  64. ????????matcher.addURI(ContactsContract.AUTHORITY,?"live_folders/contacts_with_phones",??
  65. ????????????????LIVE_FOLDERS_CONTACTS_WITH_PHONES);??
  66. ????????matcher.addURI(ContactsContract.AUTHORITY,?"live_folders/favorites",??
  67. ????????????????LIVE_FOLDERS_CONTACTS_FAVORITES);??
  68. ????????matcher.addURI(ContactsContract.AUTHORITY,?"provider_status",?PROVIDER_STATUS);??
  69. ????}??

?

ÏîÄ¿Çåµ¥ÎļþÖÐ ÓÐContactsProvider2µÄÅäÖÃ

?

view plaincopy to clipboardprint?
  1. <provider?android:name="ContactsProvider2"?android:authorities="contacts;com.android.contacts"?android:label="@string/provider_label"?android:multiprocess="false"?android:readPermission="android.permission.READ_CONTACTS"?android:writePermission="android.permission.WRITE_CONTACTS">??
  2. ??<path-permission?android:pathPrefix="/search_suggest_query"?android:readPermission="android.permission.GLOBAL_SEARCH"?/>???
  3. padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px
  Ïà¹Ø½â¾ö·½°¸