Integrate (RIM java app) with BB address book

I want my api. As an integrated RIM application with the BlackBerry address book. For example: - send an SMS by selecting a contact from the internal BB address, pressing the menu button and choosing an option. Compose SMS via XYZ app as we created sms.

+2


source to share


1 answer


First you need to create a class, extend net.rim.blackberry.api.menuitem.ApplicationMenuItem

and override the method run(Object context)

.

This method will be called when the user clicks on 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 selected item.

Override the toString () method to give your MenuItem a name, eg.

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

      



Then you need to register your menu item. Create an autorun application, system module and call the following 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 address book list view, the second in the detail view (after the address has been opened).

Hope it helps!

+3


source







All Articles