Development Guide

Local Navigation

Testing a BlackBerry device application with the BlackBerry Smartphone Simulator

Testing a BlackBerry device application that uses an HTTP connection

You can test applications that require an HTTP connection (for example, email) by using the BlackBerry® MDS Connection Service.

Back To Top

Start the BlackBerry MDS Connection Service when you start the BlackBerry Smartphone Simulator

  1. In Eclipse®, on the Run menu, click Debug Configurations or Run Configurations.
  2. Expand the BlackBerry Simulator item.
  3. Complete one of the following tasks:
    • To work with an existing launch configuration, under BlackBerry Simulator, click a launch configuration.
    • To create a new launch configuration, right-click BlackBerry Simulator, select New.
  4. Click the Simulator tab.
  5. Click the General tab.
  6. Select the Launch Mobile Data System Connection Service (MDS-CS) with simulator check box.
  7. Click Apply.
Back To Top

Open a web site in the BlackBerry Browser when the BlackBerry Smartphone Simulator starts

  1. In Eclipse®, on the Run menu, click Debug Configurations or Run Configurations.
  2. Expand the BlackBerry Simulator item.
  3. Perform one of the following tasks:
    • To work with an existing launch configuration, under BlackBerry Simulator, click a launch configuration.
    • To create a new launch configuration, right-click BlackBerry Simulator, select New.
  4. Click the Simulator tab.
  5. Click the General tab.
  6. Select the Launch Mobile Data System Connection Service (MDS-CS) with simulator check box.
  7. In the Launch app or URL on startup field, type the web address.
  8. Click Close.
  9. Click Yes.
Back To Top

Start a BlackBerry device application when the BlackBerry Smartphone Simulator starts

  1. In Eclipse®, on the Run menu, click Debug Configurations or Run Configurations.
  2. Perform one of the following tasks:
    • To work with an existing launch configuration, under BlackBerry Simulator, click a launch configuration.
    • To create a new launch configuration, right-click BlackBerry Simulator, select New.
  3. Click the Simulator tab.
  4. Click the General tab.
  5. In the Launch app or URL on startup field, type the name of the .cod file of the application.
  6. Click Close.
  7. Click Yes.
Back To Top

View output from the BlackBerry Smartphone Simulator

  1. In Eclipse®, on the Window menu, click Show View > Console.
  2. In the Console view, select Display Selected Console.
  3. From the console drop-down list, click BlackBerry Simulator Console Output.
Back To Top

Add a BlackBerry device application to the BlackBerry Smartphone Simulator launch configuration

  1. On the Run menu, click Debug Configurations or Run Configurations.
  2. Expand the BlackBerry Simulator item.
  3. Perform one of the following tasks:
    • To work with an existing configuration, under BlackBerry Simulator, click a configuration.
    • To create a new configuration, right-click BlackBerry Simulator, and click New.
  4. Click the Projects tab.
  5. Click the BlackBerry® device application that you want to add.
  6. Click Close.
  7. Click Yes.
Back To Top

Debug a BlackBerry device application on a BlackBerry Smartphone Simulator that is running

  1. On the Run menu, click Debug Configurations.
  2. Right-click Running BlackBerry Simulator, and click New.
  3. In the Name field, type a name.
  4. Click Debug.
Back To Top

Add a .jar file, that was created without using RAPC, to the BlackBerry Smartphone Simulator or a BlackBerry device

When your BlackBerry® application project imports a .jar file that was created without using RAPC, you can add the .class files to your BlackBerry application project and install the .class files in the BlackBerry® Smartphone Simulator or on a BlackBerry device.
  1. In the Package Explorer view, right-click a BlackBerry application project.
  2. Click Properties.
  3. Click Java Build Path.
  4. On the Libraries tab, click Add JARs or Add External JARs.
  5. Navigate to the .jar file that you want to add, and click Open.
  6. On the Order and Export tab, select the .jar file and click OK.
  7. Package the BlackBerry application project and run the application on the BlackBerry Smartphone Simulator or theBlackBerry device. The .class files are zipped into the .cod file of the BlackBerry application project and installed on the BlackBerry Smartphone Simulator or on a BlackBerry device.
Back To Top

Run a MIDlet application in the BlackBerry Smartphone Simulator

You can import a MIDlet .jar file into a BlackBerry® application project and run the MIDlet application in the BlackBerry® Smartphone Simulator. You can import only one MIDlet .jar file into the BlackBerry application project. You must manually add any dependent library (.cod) files to the BlackBerry Smartphone Simulator.
Before you begin:

You must have a .jad and .jar file pair to add to the BlackBerry application project.

  1. Create a new BlackBerry application project, and add the .jad and .jar files to the project. Do not place the files in a source folder.
  2. In the Package Explorer view, right-click the BlackBerry application project.
  3. Click Properties.
  4. Click Java Build Path.
  5. On the Libraries tab, click Add JARs or Add External JARs.
  6. Navigate to the MIDlet .jar file that you want to add and click Open.
  7. On the Order and Export tab, select the MIDlet .jar file and click OK.
  8. Package the BlackBerry application project and run the application in the BlackBerry Smartphone Simulator. The .class files are zipped into the .cod file of the BlackBerry application project and added to the BlackBerry Smartphone Simulator.
Back To Top

Hot-swap a BlackBerry device application

Before you begin:

You must install the BlackBerry® Java® SDK 5.0 or later on your computer.

  1. In Eclipse® right-click a BlackBerry application project.
  2. Complete one of the following tasks:
    • Click Run As > BlackBerry Simulator.
    • Click Debug As > BlackBerry Simulator.
  3. In the BlackBerry® Smartphone Simulator, click the icon to run the application.
  4. In Eclipse, make changes to the application that is running. Save the changes.
  5. Complete one of the following tasks:
    • On the Run menu, click Run As > BlackBerry Simulator.
    • On the Run menu, click Debug As > BlackBerry Simulator.
    The changes to the BlackBerry device application appear in the BlackBerry Smartphone Simulator.
Back To Top

Restore the default settings for the BlackBerry Smartphone Simulator

  1. On the BlackBerry menu, click Clean Simulator.
  2. Expand the BlackBerry® JRE™ that you want to restore the default settings for.
  3. Select the appropriate check boxes.
  4. Click OK.
Back To Top

Set preferences for running a BlackBerry device application in debug mode

  1. On the Window menu, click Preferences.
  2. Expand BlackBerry Java Plug-in.
  3. Click Debug.
  4. In the Warning section, select the Prompt for missing debug files check box if you want to be notified about missing files.
  5. Click Apply.
  6. Click OK.
Back To Top

Was this information helpful? Send us your comments.