Android的如何阅读Android通讯录和SIM卡通讯录? [英] Android How to read android Contacts and SIM Contacts?

查看:252
本文介绍了Android的如何阅读Android通讯录和SIM卡通讯录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前得到只读Android通讯录,下面是code我使用的是:

I am currently getting read only android contacts, below is the code I'm using:

String[] projecao = new String[] { Contacts._ID,
    Contacts.LOOKUP_KEY, Contacts.DISPLAY_NAME };
String selecao = Contacts.HAS_PHONE_NUMBER + " = 1";
Cursor contatos = contexto.getContentResolver().query(
    ContactsContract.Contacts.CONTENT_URI, projecao, selecao, null, null);

和获取电话号码:

Cursor phones = contexto.getContentResolver().query(
                Phone.CONTENT_URI,
                new String[] { Phone.NUMBER },
                Phone.CONTACT_ID + " = ?",
                new String[] { contatos.getString(contatos
                        .getColumnIndex(Contacts._ID)) }, null);

我要保持与数字的所有联系人的数据库。

I want to maintain a database of all contacts with numbers.

我什么GET SIM卡联系人做呢?

What I'm to do for get SIM card Contacts too?

感谢您的时间。

推荐答案

要获得手机通讯录,你可以访问这个链接

To get phone contacts you can visit this link

和于SIM卡联系人点击这里

and for sim contacts click here

这篇关于Android的如何阅读Android通讯录和SIM卡通讯录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆