Test a BlackBerry Java Application
9
Obfuscating a BlackBerry Java Application
The compiler for the BlackBerry® Java® Development Environment and the BlackBerry® JDE Plug-in for Eclipse™ is set to minimize
the size of the application. The compiler produces a .cod file that provides obfuscation-like services that are similar to those that
obfuscation packages provide in an effort to reduce the size of the .cod file. For example, the BlackBerry Java Development
Environment removes the following information from a .cod file:
•
all debug information
•
local variable names
•
source line numbers
•
private method and member names
It is not typically necessary for you to provide obfuscation for your applications in addition to the existing obfuscation that, by
default, the BlackBerry JDE provides. In fact, Research In Motion does not perform any additional obfuscation of its own products.
The BlackBerry JDE does not integrate support for obfuscation through third-party tools. You must include a command-line
procedure to obfuscate .cod files for use on BlackBerry devices.
Preverifying a BlackBerry Java Application
When you preverify your classes, you reduce the amount of processing that the BlackBerry® device must perform when you install
your application. To partially verify your classes before you install your application on a BlackBerry device, you can use the Preverify
tool, available with the BlackBerry® Java® Development Environment. You can use the BlackBerry® Smartphone Simulator to
preverify the .cod files.
For more information about using the BlackBerry Smartphone Simulator, see the BlackBerry Device Simulator User Guide. For
more information about using the Preverify tool, see the BlackBerry Java Development Environment Development Guide.
Testing applications on a BlackBerry Smartphone Simulator
After you develop and compile your application, you can test it on the BlackBerry® device. The most common first step is to set
the BlackBerry® Java® Development Environment to use a BlackBerry® Smartphone Simulator. The BlackBerry Smartphone
Simulator runs the same Java code as the BlackBerry devices, so the BlackBerry Smartphone Simulator provides an accurate
environment for testing how applications will function on a BlackBerry device. The BlackBerry JDE includes current versions of
the BlackBerry Smartphone Simulator. To download additional versions of the BlackBerry Smartphone Simulator, visit
www.blackberry.com/developers/index.shtml
.
Fundamentals Guide
Test a BlackBerry Java Application
40