Tips & Tricks

Get quick info and shortcuts - in this issue, learn How To do a lot, especially when it comes to:

  • How To - Remove the default "Close" or "Hide" MenuItems from a Screen

    By default, a Close menu item, and possibly a Hide menu item, are added to the menu of a MainScreen or any other screen that uses the DEFAULT_CLOSE and DEFAULT_MENU styles. The Hide menu item appears on BlackBerry wireless devices with BlackBerry® Device Software v4.0 Service Pack 2 and earlier. It is possible for your screen to prevent these menu items from being displayed in your menu. To do so, you can override the makeMenu method of the Screen class. The following code sample creates a menu that contains the default menu items (for example, Copy, Paste, Change Option) for the field that has focus, but does not display the Close or Hide menu items. For more examples, please see the sample applications included with the BlackBerry Java™ Development Environment.

    Note: It is not possible to remove the Close menu item from a MIDlet.

    Get the full code.

  • How To - Use Javaloader to take a screen shot

    The Javaloader utility that ships with the BlackBerry JDE was updated in version 4.0.2 to allow a user to connect a BlackBerry wireless device to a personal computer that currently has the BlackBerry USB drivers installed and to take a snap shot of the information displayed on a BlackBerry device screen.Type the following command from a DOS command prompt:

    Javaloader -u screenshot .bmp

    The device-screen-shot.bat file can run the command automatically. Place the batch file in the bin directory of the BlackBerry JDE or JDE Component Package.

    Full JDE installation: C:\Program Files\Research In Motion\BlackBerry JDE 4.1.0\bin
    Component Package installation only: C:\Program Files\Research In Motion\BlackBerry JDE Component Package 4.1.0\bin

    Note: Once you place the batch file in the correct bin folder, double-click it from within Windows®. The tool will then create a screenshot.bmp in the above directory.

Questions? Comments? Suggestions? Share them with us!

Research In Motion Ltd.
295 Philip Street Waterloo, Ontario Canada N2L 3W8

© 2006 Research In Motion Limited. All rights reserved. The BlackBerry and RIM families of related marks, images and symbols are the exclusive properties and trademarks of Research In Motion Limited. RIM, Research In Motion, 'Always On, Always Connected' and BlackBerry are registered with the U.S. Patent and Trademark Office and may be pending or registered in other countries. All other brands, product names, company names, trademarks and service marks are the properties of their respective owners. The specifications and features contained in this document are subject to change without notice. All other brands, product names, company names, trademarks and service marks are the properties of their respective owners. Prices subject to change without notice. Research In Motion Limited presents information about third party products and services on BlackBerry Connection for your information. However, since Research In Motion Limited relies on information provided by outside sources, it makes no warranty or guarantee concerning the features, reliability or pricing of third party products or services, or their compatibility with any Research In Motion Limited products.

Developer Newsletter