Sonia
Sonia

Reputation:

integrate (RIM java)app with BB address book

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.

Upvotes: 2

Views: 835

Answers (1)

Jan Gressmann
Jan Gressmann

Reputation: 5541

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!

Upvotes: 3

Related Questions