With the latest simulators and BlackBerry® Java Plug-in or BlackBerry® Web Plug-in, it’s possible to change your code and publish it to a running simulator without a reset. This new feature will greatly improve your development experience and is particularly valuable for those little UI tweaks when you’re working on getting something just perfect.
The hot swap feature is integrated right into the debugging process, so all you really need to change about your existing workflow is to stop closing the BlackBerry® Simulator. After you’ve launched the simulator and need to make a change to the code, just jump back to your code and make the change without closing your app or the simulator. When you’ve completed the change, run the debugging configuration that you ran before.
In the background, the tools will:
- Rebuild your code.
- Unload the modules from the running simulator.
- Load the new version to the simulator.
- Reconnect the debugger.
- Return to the application that was in the foreground.
So if you left your application in the foreground, you’ll see your changes without even launching the application again, and all this takes only a few seconds. Watch the video above to see an example of hot swap in action.
Added to the improvements is the simulator startup time; it’s faster and easier than ever to get developing on the simulators, and you still benefit from the simulators running the same Java code as the BlackBerry® smartphone does for outstanding accuracy.
If you upgraded from the BlackBerry® Java Plug-in for Eclipse® v1.1.1, make sure you are using the new JRE by following these steps:
- Manually select the upgraded BlackBerry JRE by navigating to Windows > Preferences > Java > Installed JREs.
- Select the old BlackBerry 5.0.0 JRE and click Edit.
- Change the Definition File by navigating to the new BlackBerry JRE (with the File button).
- In the components folder, select the BlackBerry.ee file and click Finish
- Your Definition File path should look like this:
Have you tried out the hot swap feature yet? Leave us a comment and let us know how it worked out for you!