Development Environment

Note: These instructions are applicable to the 2.0 branch. For the 1.0.x branch, see this page.

Tools

The first step is to download and install the following tools:

  • RIM BlackBerry JDE
    • Download "BlackBerry Java Development Environment v4.1"
  • BlackBerry JDE Plug-In for Eclipse
    • Download the plug-in. If you don't already have Eclipse installed, I think the plug-in comes with it.
  • BlackBerry Simulators
    • The JDE comes with simulators for older BlackBerry devices, and the Plug-In comes with simulators for the 8120 and 8130. If you want a simulator for any other BlackBerry device, you can download it from the above link.
  • Subversion
    • Download the main command-line client from the above web page, as other tools may need it.
    • I also recommend TortoiseSVN for general use in Windows.

Configuration

  • Check out the LogicMail sources from the repository
    • Using a standalone Subversion client, such as TortoiseSVN or the command-line "svn", check out the sources from the following path:
    • The checkout should be done into a new directory, which I name "LogicMail" for convenience.
    • The sources will include the following subdirectories:
      • "LogicMail" - Main program sources
      • "LogicMailTests" - Unit test sources
      • "lib" - Build support files

Setting up the Eclipse IDE

  • Start Eclipse
    • Choose the new directory used above for the checkout for your "workspace" directory
  • Go to Window --> Preferences
    • Select: Java --> Build Path --> User Libraries --> New
    • Enter in "BlackBerry 4.1"
    • C:\Program Files\Research In Motion\BlackBerry JDE 4.1.0\lib\net_rim_api.jar
    • Click Javadoc location --> Edit --> Browse --> file:/C:/Program Files/Research In Motion/BlackBerry JDE 4.1.0/docs/api/
    • Save/Close
  • Go to File --> Import --> General --> Existing Project into Workspace
    • Browse by the selection for the root directory
    • Choose the directory we checked out LogicMail into, and make sure both projects get selected
    • Finish
  • In the LogicMail project
    • Edit the project.properties file and chenge the following three properties to these values below:
      • jde.home=C:/Program Files/Research In Motion/BlackBerry JDE 4.1.0
      • simulator.home=C:/Program Files/Eclipse/plugins/net.rim.eide.componentpack4.3.0_4.3.0.8/components/simulator
      • simulator.exec=8120.bat
    • Save your changes to the project.properties file

Building and Debugging in Eclipse

Note: Make sure that javac is in your PATH environment variable (i.e. C:\Program Files\Java\jdk1.6.0_03\bin)

  • Go to Window --> Show View -> Ant
  • Drag the two build.xml files from each of the LogicMail projects into the Ant window
  • In the Ant window, open the LogicMail project and double-click the load-simulator target
    • Note: this will build the code and copy the output to the simulator directory
  • Setup the debugger as follows:
    • Click the little triangle drop-down next to the Debug "bug" button, or just click "Run --> Open Debug Dialog"
    • Select "BlackBerry Simulator" and then click the "new launch configuration" icon in the upper left part of the debug dialog window
    • Type in the name of this simulator configuration; we are using "BlackBerry Simulator"
    • Click on the Source tab --> Add --> Java Project, select both LogicMail and LogicMailTests, and click OK
    • Click Apply
    • Click Debug
  • If you would like to set breakpoints and do some debugging, try Window --> Show View --> Debug