用PhoneLookup进行电话号码查询

来源:互联网 发布:matlab求矩阵中最小值 编辑:程序博客网 时间:2024/04/28 01:36
 public static final class
ContactsContract.PhoneLookup
extends Object
implements BaseColumns ContactsContract.ContactOptionsColumns ContactsContract.ContactsColumns ContactsContract.PhoneLookupColumns
java.lang.Object
        android.provider.ContactsContract.PhoneLookup
Class Overview
A table that represents the result of looking up a phone number, for example for caller ID.
To perform a lookup you must append the number you want to find to CONTENT_FILTER_URI. 
This query is highly optimized. 

电话号码的查询可以用如下方式实现。
String phoneNumber="1367890660";
Uri uri = Uri.withAppendedPath(
PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
c=context.getContentResolver().query(uri, null,null,null,null);

能查询到的信息共14项
Columns
PhoneLookup
long     _ID     read-only     Data row ID.
String     NUMBER     read-only     Phone number.
String     TYPE     read-only     Phone number type. See ContactsContract.CommonDataKinds.Phone.
String     LABEL     read-only     Custom label for the phone number. See ContactsContract.CommonDataKinds.Phone.

Columns from the Contacts table(ContactsContract.Contacts)are also available through a join.
Join with Contacts
String     LOOKUP_KEY
String     DISPLAY_NAME
long     PHOTO_ID
int     IN_VISIBLE_GROUP
int     HAS_PHONE_NUMBER
int     TIMES_CONTACTED
long     LAST_TIME_CONTACTED
int     STARRED
String     CUSTOM_RINGTONE
int     SEND_TO_VOICEMAIL
注意查询到的信息项都标记为只读的。我想这里的查询应该就是调用的数据库中存储过程。
从逻辑上来讲就是只读的。所以系统在这里就把标记为只读的了。
原创粉丝点击