How to Call the Address Book Application in BlackBerry

final ContactList contactList = (ContactList) PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.WRITE_ONLY);

final Contact contact = contactList.createContact();

final String[] names = new String[contactList.stringArraySize(Contact.NAME)];

names[Contact.NAME_GIVEN] = "Fernando";
names[Contact.NAME_FAMILY] = "Ribeiro";

contact.addStringArray(Contact.NAME, PIMItem.ATTR_NONE, names);

contact.addString(Contact.TEL, Contact.ATTR_MOBILE, "(11) 0000.0000");

contact.addString(Contact.EMAIL, PIMItem.ATTR_NONE, "postmaster@localhost");

contact.addDate(Contact.BIRTHDAY, PIMItem.ATTR_NONE, new Date().getTime());

Invoke.invokeApplication(Invoke.APP_TYPE_ADDRESSBOOK, new AddressBookArguments(AddressBookArguments.ARG_NEW, contact));

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s