Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 20
Registered: ‎08-12-2008
My Device: Bold

using Contact.NICKNAME

[ Edited ]

I am trying to read out the Nickname of a Contact in a BlackBerry Java app but the method call

 

getPIMList().isSupportedField(BlackBerryContact.NICKNAME)

 

always tells me that the Field is not supported.

 

Am I doing something wrong or is it really not supported? Because the devices I am testing on allow me to add a Nickname field in the address book.

Highlighted
New Contributor
Posts: 9
Registered: ‎03-02-2011
My Device: Torch 9800

Re: using Contact.NICKNAME

Confirming it. Could not read nor write BlackBerryContack.NICKNAME. Although can enter it through "Contacts" phone/simulator application.

Regular Contributor
Posts: 94
Registered: ‎08-07-2010
My Device: 9550

Re: using Contact.NICKNAME

Hai,

 

u can read name from contact as,

 

 

try {
            BlackBerryContactList berryContactList = (BlackBerryContactList)    PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
            Enumeration items =  berryContactList.items(BlackBerryContactList.SEARCH_CONTACTS|BlackBerryContactList.SEARCH_GROUPS);
            while(items.hasMoreElements())
            {
                BlackBerryContact contact =(BlackBerryContact) items.nextElement();
                String[] name = contact.getStringArray(BlackBerryContact.NAME, 0);
                String firstName = name[Contact.NAME_GIVEN];
                String lastName = name[Contact.NAME_FAMILY];
            }
            
        } catch (PIMException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

New Contributor
Posts: 9
Registered: ‎03-02-2011
My Device: Torch 9800

Re: using Contact.NICKNAME

Yes, I can read name. But, as Subj suggests, we speak about NICKNAME.