views:

336

answers:

2

Hello I want that my api How to integrated RIM app with BlackBerry Address Book.For example:-send an SMS message by selecting a contact from BB native address, pressing the menu button, and choosing option Compose SMS via XYZ app like we have compose sms.

+3  A: 

First you need to create a class, extend net.rim.blackberry.api.menuitem.ApplicationMenuItem and override the run(Object context) method.

This method will be called when the user clicks your menu-item and the context object will be of type javax.microedition.pim.Contact, so you can get all the relevant address information of the highlighted item.

Override toString() method to give your MenuItem a name, e.g.

public String toString() {
    return "MyMenuItem";
}

Next you need to register you menu item. Create an auto-start, system-module application and call these methods:

        ApplicationMenuItemRepository.getInstance().addMenuItem(
            ApplicationMenuItemRepository.MENUITEM_ADDRESSBOOK_LIST, instanceOfYourApplicationMenuItem
        ); 
        ApplicationMenuItemRepository.getInstance().addMenuItem(
            ApplicationMenuItemRepository.MENUITEM_ADDRESSCARD_VIEW, instanceOfYourApplicationMenuItem
        );

The first call will register the menu item in the addressbook list view, the second one in the detail view (after an address has been opened).

Hope that helps!

Jan Gressmann
hello Is it possible to add option in native address book Blackberry?.For eg. Suppose my BB java app name is XYZ now i want that this XYZ option would come in the Full menu of native address book of BB..Is it possible or not? Please reply soon..
yea sure just override toString() method
Jan Gressmann
A: 

Hello Thanks!I am able to append String option in native address book menu but when i clicked on it does not open my application and on console it show starting XYZ, XYZ is already running.plz help me how to open the my app?

sonia
please don't use "Post Your Answer" button to post comments (I know it's common on other forums), please use a small link below the answer: "add comment". see updated answer in your question: http://stackoverflow.com/questions/1453164/blackberry-make-a-call-from-native-address-book
Max Gontar
and BTW, to run your application you should use run() method inside your implementation of ApplicationMenuItem.
Max Gontar