如何访问黑莓手机中的SIM卡联系人 [英] How to access SIM contacts in Blackberry

查看:214
本文介绍了如何访问黑莓手机中的SIM卡联系人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要访问黑莓的联系人列表,我下面令状code要做到这一点:

I need to access contact list in blackberry, I writ following code to do that:

private void readContacts() {
        try {
            PIM pim;
            pim = PIM.getInstance();
            String lists[] = pim.listPIMLists(PIM.CONTACT_LIST);

            for (int i = 0; i < lists.length ; i++) {
                clist = (ContactList) pim.openPIMList(PIM.CONTACT_LIST,
                        PIM.READ_ONLY, lists[i]);

                Enumeration cenum = clist.items();
                while (cenum.hasMoreElements()) {
                    Contact c = (Contact) cenum.nextElement();
                    ContactDTO contact = new ContactDTO();
                    parseContactInfo(c, contact);
                    contacts.addElement(contact);
                }
                clist.close();
            }

        } catch (Exception e) {
        }
    }

在J2ME这个code访问都SIM卡和手机中的联系人,但在黑莓它是只访问手机通讯录。

In j2me this code access both sim and phone contacts but in blackberry it is accessing only phone contacts.

String lists[] = pim.listPIMLists(PIM.CONTACT_LIST);

lists.length 收益1

我怎么能在黑莓手机访问SIM卡联系人?
先谢谢了。

How I can access sim contacts in blackberry?? Thanks in advance.

推荐答案

据<一个href=\"http://supportforums.blackberry.com/t5/Java-Development/how-to-get-Sim-contacts-and-phone-contacts/td-p/1147369\"相对=nofollow>此帖来自西蒙海恩,你不能

您不能访问从SIM卡联系人AFAIK。从触头
  通讯录可以与PIM API访问,请检查
  <一href=\"http://www.blackberry.com/developers/docs/6.0.0api/net/rim/blackberry/api/pdap/BlackBerryContactList.html\" rel=\"nofollow\">http://www.blackberry.com/developers/docs/6.0.0api/net/rim/blackberry/api/pdap/BlackBerryContactList.html

you cannot access contacts from the sim card afaik. contacts from the addressbook can be accessed with the PIM API, check http://www.blackberry.com/developers/docs/6.0.0api/net/rim/blackberry/api/pdap/BlackBerryContactList.html

这答案是大约OS 6.0,所以也许东西,我不知道在OS 7得到补充的(?)

That answer was circa OS 6.0, so perhaps something that I'm not aware of got added in OS 7 (?)

这篇关于如何访问黑莓手机中的SIM卡联系人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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