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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
tompson
Posts: 20
Registered: ‎08-12-2008

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.

Please use plain text.
New Contributor
randesco
Posts: 9
Registered: ‎03-02-2011

Re: using Contact.NICKNAME

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

Please use plain text.
Regular Contributor
gollapallysrinivas
Posts: 94
Registered: ‎08-07-2010

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();
        }

Please use plain text.
New Contributor
randesco
Posts: 9
Registered: ‎03-02-2011

Re: using Contact.NICKNAME

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

Please use plain text.