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.
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!
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?