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
Regular Contributor
Posts: 86
Registered: ‎03-06-2010
My Device: 9000/9700
My Carrier: AT&T

PIM: How do you use attributes

[ Edited ]

I want to add phone numbers and email addresses to home, work, and other "profiles", which it looks like the PIM infrastructure supports.  I have code like this:

 

        if(prof.email.length() > 0)
{
matchRemoveValues(c, Contact.EMAIL, attr);
c.addString(Contact.EMAIL, attr, prof.email);
}
 

 

where prof.email is a string with an email address and attr is one of Contact.ATTR_HOME, Contact.ATTR_WORK, or Contact.ATTR_OTHER.  There is an identical snippet for mobile phone numbers.

 

When I go look in the "Contacts" address book, this is what I've added:

1700i99AD279A017DF7A5

The phone numbers themselves have gone into the right places (so do addresses; I tried that, too) but there's no Work Mobile, Work Email, Home Mobile, Home Email, etc., and the corresponding phone numbers appear to be stuck in random places, like "Pager", for which I entered nothing.  That last email should have been "Other Email", and the last "Other" should have been "Other Mobile", among "other" (no pun intended) anomalies.

 

Am I missing something here?

 

Thanks,

anw

 

TIA,
Allen
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: PIM: How do you use attributes

from one of my util classes:

blackBerryContact.addString(BlackBerryContact.EMAIL, BlackBerryContact.ATTR_NONE, newEmail);

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Regular Contributor
Posts: 86
Registered: ‎03-06-2010
My Device: 9000/9700
My Carrier: AT&T

Re: PIM: How do you use attributes

Yeah, that looks like the function call I'm using.  What happens when you use ATTR_HOME instead of ATTR_NONE?

 

Thanks for the reply!

 

TIA,
Allen
Highlighted
Regular Contributor
Posts: 86
Registered: ‎03-06-2010
My Device: 9000/9700
My Carrier: AT&T

Re: PIM: How do you use attributes

Hello?

 

In addition to the last question, does anyone know if there any difference in using the J2ME Contact vs. the BlackberryContact in this regard?

 

anw

 

TIA,
Allen