Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Notifications Made Easy

by BlackBerry Development Advisor on ‎06-09-2010 12:52 PM - edited on ‎06-09-2010 01:12 PM by Retired (9,448 Views)


Many applications require the ability to alert a BlackBerry® smartphone user that an event occurred.  This could be achieved by playing an audio alert, vibrating or flashing the LED.  Many developers attempt to manually trigger these alerts from within their application but with only a few lines of code an application is able to integrate with and appear within the Notification/Profiles application of a BlackBerry Smartphone.  This type of implementation provides a number of benefits to the developer and the end user:


  • The User can configure the alert for all applications in a central location using consistent options.
  • Default alerts are pre-configured for each profile type (For example, Set to Vibrate only for the Vibrate profile, volume level set to maximum for the Loud profile and notifications disabled for the silent profile).


It also benefits the developer in that the application does not need to implement the code to provide a GUI for the user to choose their type of alert, store their alert options or to trigger the chosen alert.




The first step in using this type of notification is to register your application with the Notification/Profiles application. 



// Long value com.samples.simpleNotification
private static final long ID = 0x749cb23a75c60e2dL;

//The toString value of this object will be displayed in the user's Profile settings.
Object theSource = new Object()
public String toString()
return "Simple Notification";

//Register the notification.
NotificationsManager.registerSource(ID, theSource, NotificationsConstants.IMPORTANT);


Once registered, an application is able to trigger the alert the user has configured.



NotificationsManager.triggerImmediateEvent(ID, 0, null, null);


A complete sample application is attached.

Users Online
Currently online: 34 members 724 guests
Please welcome our newest community members: