Android 使用PhoneLookup查询电话
电话号码的查询可以用如下方式实现。
java代码:
- 01.String phoneNumber="1367890660";
- 02.Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
- 03.c=context.getContentResolver().query(uri, null,null,null,null);
复制代码 复制代码能查询到的信息共14项
java代码:
- 01.Columns
- 02.PhoneLookup
- 03.long _ID read-only Data row ID.
- 04.String NUMBER read-only Phone number.
- 05.String TYPE read-only Phone number type. See ContactsContract.CommonDataKinds.Phone.
- 06.String LABEL read-only Custom label for the phone number. See ContactsContract.CommonDataKinds.Phone.
- 07.
- 08.Columns from the Contacts table(ContactsContract.Contacts)are also available through a join.
- 09.Join with Contacts
- 10.String LOOKUP_KEY
- 11.String DISPLAY_NAME
- 12.long PHOTO_ID
- 13.int IN_VISIBLE_GROUP
- 14.int HAS_PHONE_NUMBER
- 15.int TIMES_CONTACTED
- 16.long LAST_TIME_CONTACTED
- 17.int STARRED
- 18.String CUSTOM_RINGTONE
- 19.int SEND_TO_VOICEMAIL
复制代码 复制代码注意查询到的信息项都标记为只读的。我想这里的查询应该就是调用的数据库中存储过程。从逻辑上来讲就是只读的。所以系统在这里就把标记为只读的了。 |