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 need to configure your development environment to support BBM.

Install Java

The first thing you need to do is download and install 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 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, in the 32-bit version of Windows, C:\Program Files\Java\jre6.
    (In the 64-bit version of Windows, the default path for 32-bit Java 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 by using a key size of greater than 128 bits.

You must live in an eligible country to enable this functionality. You can find more information in the readme.txt file contained in the following .zip file.

  1. Download the jce_policy-6.zip file from the Oracle website.
  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 need to install some software.

If you don't have a BlackBerry 10 device, you can download and install the BlackBerry 10 Device Simulator to test your applications. The BBM server simulator is bundled with the BlackBerry 10 Device Simulator.

Set up the simulators to run BBM

To test your BBM connected app in the BlackBerry 10 Device Simulator, you need to install at least two instances of the device simulator in different locations on your hard disk, one for each instance of BBM. Learn more about how to Run multiple device simulators with BBM.

After you install 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 directory.
  2. Double-click the Run BBM Server Simulator shortcut to open the console and start the server.

Next, start the device simulator: in the BlackBerry 10 Simulator - <version> directory, double-click the BlackBerry 10 Simulator shortcut.

Then, connect the device simulator to the controller. The controller allows the device simulator to connect to the BBM server simulator.

Now, connect the device simulator to the BBM server simulator.

  1. On the Controller menu, click BBIO.
  2. In the IP address field, specify the IP of the computer that hosts the BBM server simulator. In the Port field, port 3101 is automatically specified.

    The IP address cannot be 127.0.0.1 or localhost, even if the BBM server simulator is running on the same computer that hosts the device simulator.


    Screen shot showing the simulator controller.

  3. Click Connect. You can see activity in the BBM server simulator console when the connection is successful.

Now you're ready to connect your app to BBM!

To shut down the BBM server simulator when you finish testing, in the BBM Server Simulator directory, double-click the Shutdown BBM Server Simulator shortcut. After the simulator stops, type exit at the command prompt to close the command window.

Run multiple device simulators with BBM

If you want to run more than one BlackBerry 10 Device Simulator at a time, you need to install each simulator in a separate location on your hard disk, one for each instance of BBM.

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

  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 following the instructions in Configuring the simulator.

    After you change 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 IP address field, specify the IP of the computer that is running the BBM server simulator. In the Port field, port 3101 is automatically specified..

    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 when the connection is successful.

  13. In the device simulator, click the app that you want to run.
  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.

Last modified: 2013-12-21

comments powered by Disqus