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).
Next you'll set up Java environment variables and unlimited strength encryption.
Set up Java environment variables
- In Windows, open the Environment Variables dialog box.
- 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\).
- In the Path environment variable, add %JAVA_HOME%\bin; to the beginning of the string.
- Click OK to save and close the Environment Variables dialog box.
- Verify that your environment variables are set correctly:
- Open a command prompt.
- 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.
-
Download the jce_policy-6.zip file.
-
Extract the contents of the jce_policy-6.zip file to your computer.
-
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.
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.
- In the directory where you installed the simulator, open the BlackBerry 10 Simulator - <version> > BBM Server Simulator directory.
- Double-click Run BBM Server Simulator to open the console and start the server.
- In the BlackBerry 10 Simulator - <version> directory, double-click BlackBerry 10 Simulator.
- In the BlackBerry 10 Simulator - <version> directory, double-click Controller.
- On the Controller menu, click Connection > Connect.
- 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.
- In the IP Address drop-down list, select the IP Address of the simulator that you want to connect.
- Click Connect.
"Connected to <IP Address>" appears on the status bar at the bottom of the controller window.
- On the Controller menu, click Device > BBIO > Connect to BBM Server.
- 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.

- Click Connect. You'll see activity in the BBM server simulator console upon successful connection.
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.
To run multiple instances of the device simulator, complete the following steps:
- Start VMware.
- Navigate to the directory where you installed the simulator and open the BlackBerry 10 Simulator - <version> directory.
- Select BlackBerry10Simulator.vmx and click Open to start the simulator.
- Open the controllers directory and run controller.exe.
- Change the default PIN of the simulator by using the controller.After you have changed the PIN, restart the simulator.
- On the Controller menu, click Connection > Connect.
- In the Auto Discover section, select the entry for the device simulator instance that you want to connect.
- In the IP Address drop-down list, select the IP Address of the corresponding simulator.
- Click Connect.
"Connected to <IP Address>" appears on the status bar at the bottom of the controller window.
- On the Controller menu, click Device > BBIO > Connect to BBM Server.
- 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.
- Click Connect.
You'll see activity in the BBM server simulator console upon successful connection.
- In the device simulator, click BBM.
- Repeat steps 1 to 13 for each additional instance of the simulator that you want to run.

