If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

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

Use a Backdoor Sequence

by BlackBerry Development Advisor ‎02-16-2010 02:59 PM - edited ‎09-16-2010 02:31 PM (3,177 Views)

Summary

 

This article applies to the following:

  • BlackBerry® Device Software 4.2 and later
  • BlackBerry Java™ Development Environment (JDE) 4.2 and later

Description

 

On a BlackBerry device, there are a number of backdoor sequences that can be invoked when the home screen is displayed (such as holding the ALT key and typing ESCR to show the BlackBerry device information). With JDE 4.2, this same backdoor functionality can be included in any screen via two new methods in the net.rim.device.ui.Screen class that can be overridden: openProductionBackdoor(int backdoorCode) and openDevelopmentBackdoor(int backdoorCode). The difference between the two methods is that openDevelopmentBackdoor(int backdoorCode) will only be invoked if the application is run in the simulator (but if both methods are implemented, then both methods will be invoked from within the simulator).

 

The following is an example implementation that will cause ABCD to be used as a backdoor sequence.

 

 

protected boolean openProductionBackdoor(int backdoorCode) {
    switch( backdoorCode ) {
          // BACKDOOR – converts four chars to an int via bit shifting and a
          // bitwise OR
          case ( 'A' << 24 ) | ( 'B' << 16 ) | ( 'C' << 8 ) | 'D':
            UiApplication.getUiApplication().invokeLater (new Runnable() {
                public void run()
                {
                   Dialog.inform("Backdoor sequence received");
                }
            });
            return true; // handled
        }
        return super.openProductionBackdoor(backdoorCode);
    }

 

Note: This backdoor sequence will only be executed if the screen implementing this code is in the foreground.

Contributors