Testing your BBM connected app in the BlackBerry 10 Device Simulator

If you plan to use the BlackBerry 10 Device Simulator to test your BlackBerry Messenger connected app, you'll need to configure your development environment to support BBM.

To configure your development environment, start by downloading and installing the Java SE 6 update 37 or later (JDK or JRE, 32-bit or 64-bit).

The BBM server simulator does not support Java 7.

Next you'll set up Java environment variables and unlimited strength encryption.

Set up Java environment variables

  1. In Windows, open the Environment Variables dialog box.
  2. Set the JAVA_HOME system variable to the directory where you installed Java, for example: C:\Program Files\Java\jre6
    (in 64-bit Windows, the default path is C:\Program Files (x86)\Java\jre6\).
  3. In the Path environment variable, add %JAVA_HOME%\bin; to the beginning of the string.
  4. Click OK to save and close the Environment Variables dialog box.
  5. Verify that your environment variables are set correctly:
    1. Open a command prompt.
    2. Type java -version and verify that the Java version is the same as the version that you set in the environment variable:
      java version "1.6.0_38"
      Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
      Java HotSpot(TM) Client VM (build 20.13-b02, mixed mode, sharing)
      

Set up unlimited strength encryption

The Java Cryptography Extension (JCE) enables encryption using a key size of greater than 128 bits.

You must live in an eligible country to enable this functionality.

  1. Download the jce_policy-6.zip file.
  2. Extract the contents of the jce_policy-6.zip file to your computer.
  3. In the security directory of the system JRE (for example, C:\Program Files (x86)\Java\jre6\lib\security\), replace the local_policy.jar and US_export_policy.jar files with the files you extracted.

Get the tools

Before you can test your BBM connected app in the device simulator you'll need to install some software:

Download and install the device simulator

If you don't have a BlackBerry 10 Dev Alpha device, you can use the BlackBerry 10 Device Simulator to test your applications. The BBM server simulator comes bundled with the BlackBerry 10 Device Simulator.

Install and configure the simulator ›

Download and install VMware

To run the simulator, you'll need to install a virtual machine.

Set up the simulators to run BBM

To test your BBM connected app in the BlackBerry 10 Device Simulator, you'll need to create at least two installations of the device simulator in different locations on your hard drive - one for each instance of BBM. Learn more about Running multiple device simulators with BBM.

Once you've installed the device simulator and a virtual machine, you're ready to get started. The first thing you need to do is start the BBM server simulator. The BBM server simulator enables communication between instances of BBM.

You need to run only one instance of the BBM server simulator.
  1. In the directory where you installed the simulator, open the BlackBerry 10 Simulator - <version> > BBM Server Simulator directory.
  2. Double-click Run BBM Server Simulator to open the console and start the server.
Next, you'll start the device simulator.

  1. In the BlackBerry 10 Simulator - <version> directory, double-click BlackBerry 10 Simulator.
Then you'll connect the device simulator to the controller. The controller allows the device simulator to connect to the BBM server simulator.
  1. In the BlackBerry 10 Simulator - <version> directory, double-click Controller.
  2. On the Controller menu, click Connection > Connect.
  3. In the Auto Discover section, select the entry for the device simulator instance that you want to connect.

    You can identify the simulator that you want by matching the 8-digit PIN in the Auto Discover section to the PIN of the device simulator, which is displayed in the lower-right border of the simulator window.

    Screen showing the simulator PIN in the Auto Discover dialog box.
    Screen showing the simulator PIN in the lower-right border.

  4. In the IP Address drop-down list, select the IP Address of the simulator that you want to connect.
  5. Click Connect.
    Screen showing the Connect to simulator dialog box.
    "Connected to <IP Address>" appears on the status bar at the bottom of the controller window.
Now you'll connect the device simulator to the BBM server simulator.
  1. On the Controller menu, click Device > BBIO > Connect to BBM Server.
  2. In the Port section, specify port 3101 and the IP address of the computer that is running the BBM server simulator.
    The IP address cannot be 127.0.0.1 or localhost, even if the BBM server simulator is running on the same host computer as the device simulator.
    Screen shwoing the Connect to BBM Server dialog box.
  3. Click Connect. You'll see activity in the BBM server simulator console upon successful connection.
Now you're ready to launch BBM. In the device simulator, click BBM.
To shut down the BBM server simulator, in the BBM Server Simulator directory, double-click Shutdown BBM Server Simulator. Once the simulator has stopped, type exit at the command prompt to close the command window.

Running multiple device simulators with BBM

To run more than one BlackBerry 10 Device Simulator at a time, you'll need to install each simulator in a separate location on your hard drive - one for each instance of BBM.

You need to run only one instance of the BBM server simulator.

To run multiple instances of the device simulator, complete the following steps:

  1. Start VMware.
  2. Navigate to the directory where you installed the simulator and open the BlackBerry 10 Simulator - <version> directory.
  3. Select BlackBerry10Simulator.vmx and click Open to start the simulator.
  4. Open the controllers directory and run controller.exe.
  5. Change the default PIN of the simulator by using the controller.
    After you have changed the PIN, restart the simulator.
  6. On the Controller menu, click Connection > Connect.
  7. In the Auto Discover section, select the entry for the device simulator instance that you want to connect.
  8. In the IP Address drop-down list, select the IP Address of the corresponding simulator.
  9. Click Connect.

    "Connected to <IP Address>" appears on the status bar at the bottom of the controller window.

  10. On the Controller menu, click Device > BBIO > Connect to BBM Server.
  11. In the Port section, specify port 3101 and the IP address of the computer that is running the BBM server simulator.
    The IP address cannot be 127.0.0.1 or localhost, even if the BBM server simulator is running on the same host computer as the device simulator.
  12. Click Connect.

    You'll see activity in the BBM server simulator console upon successful connection.

  13. In the device simulator, click BBM.
  14. Repeat steps 1 to 13 for each additional instance of the simulator that you want to run.
For more information, see Set up the simulators to run BBM.