Construct 2

Construct 2 includes an Export Project wizard that has the option to export your project to BlackBerry 10. The export process creates an HTML5 version of your game's project files. You can then package the files into a BlackBerry 10 app.

To package your game's project files into a BlackBerry 10 app, you need to install the BlackBerry 10 WebWorks SDK. To publish your app to the BlackBerry World storefront, you also need to register for code signing keys. The Export Project wizard requires that you have both of these in place. So, it's best that you install the BlackBerry 10 WebWorks SDK and register for the code signing keys before you start the wizard.

Install BlackBerry 10 WebWorks SDK

Download and install the BlackBerry 10 WebWorks SDK.

Request code signing keys

Before your game can run on a BlackBerry 10 device, you need to request and install code signing keys. Code signing identifies you as the game developer, and makes sure that the game files cannot be changed between signing and deployment on a user's device.

First, you need to request the code signing keys by completing this web form. Make sure to select the check box For BlackBerry PlayBook OS and BlackBerry 10 and Higher. If you are not affiliated with a company, type your full name in the Company field instead.

Remember the PIN that you provide. You need it later to install the code signing keys.

After your application is accepted, you receive two .csj registration files in separate emails:

  • client-RDK-xxxxxx.csj - This is the file that you use to sign an app and publish it to the BlackBerry World storefront.
  • client-PBDT-xxxxx.csj - This is the file that you use to generate a debug token, which lets you test an app on a device.

Save the files in the \dependencies\tools\bin folder, which is located in the BlackBerry 10 WebWorks SDK installation folder on your computer.

You use these files to install the code signing keys. You can only use them once.

Register your code signing keys

Next, you need to register with the RIM Signing Authority using the .csj registration file for app signing that you received.

At the command prompt, navigate to the folder where you saved the files.

For Windows:

cd C:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK <version>\dependencies\tools\bin

For Mac OS:

cd "/Developer/SDKs/Research In Motion/BlackBerry 10 WebWorks SDK <version>/dependencies/tools/bin"

In the installation folder, type the following command:

blackberry-signer -register -csjpin <csj pin> 
    -storepass <KeystorePassword> <client-RDK-xxxxxx.csj file> 
    <client-PBDT-xxxxx.csj file>
  • <csj pin> is the PIN you specified on the web form when you requested code signing keys
  • <KeystorePassword> is a new password that you must provide for the keystore
  • <client-RDK-xxxxxx.csj file> is the .csj file for signing your app
  • <client-PBDT-xxxxx.csj file> is the .csj file for generating a debug token

Remember the keystore password that you provide. You need to provide it to the Export Project wizard in Construct 2.

Export your Construct 2 project to BlackBerry 10

  1. Open your game file in Construct 2.
  2. Click File > Export project > BlackBerry 10.
  3. To reduce the total size of your application package, on the Export HTML5 project screen, select the Minify Script check box. Leave all other fields as their default values and click Next.Export HTML5 Project screen Construct 2
  4. On the Blackberry 10 options screen, do the following:
    1. In the Web Works install path field, type the location of your BlackBerry WebWorks SDK installation.
      For example, C:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK
    2. To ensure that you application's ID is unique, in the ID field, use a reverse domain format to create your application ID.
      For example,
    3. In the Version field, specify a version number, such as
    4. In the Supported orientations drop-down list, make the appropriate selection based on whether your application supports both portrait and landscape mode or if it needs to be restricted to one particular orientation.
    5. In the Signing password field, type the keystore password that you specified when you registered your code signing keys.
    BlackBerry 10 options screen Construct 2
  5. On the Blackberry 10 options screen, click Export.
    The following window appears:
    Construct 2 - Export HTML 5 project results window

Packaging your game for deployment

You are now ready to package your exported project files for BlackBerry 10. The result of the packaging process is a BAR file that you can test and deploy to a BlackBerry 10 simulator or device and submit to the BlackBerry World storefront. When you successfully complete the Export Project wizard in Construct 2, it creates a folder with all of your application's resources. The export process also creates two batch scripts deploy_bb10_app.bat and package_bb10_app.bat and places them in the same folder.

When you run the package script, the script creates two new folders named simulator and device, each containing a copy of the packaged and signed .bar file.

Create .bar files using the package_bb10_app script

  1. Navigate to the folder where you placed the exported project files.
    For example, in our case this is C:\Users\eoros\Desktop\Space Blaster.
  2. Double-click the package_bb10_app.bat file.
    Two new folders named simulator and device appears, each containing a .bar file.
You provide the .bar file in the device subfolder when you submit your game to BlackBerry World or when you load it on a BlackBerry device. For more information on submitting your game to BlackBerry World, see the Getting started section on the BlackBerry World site.

Deploy .bar file on your BlackBerry 10 device using the deploy_bb10_app script

  1. On your BlackBerry 10 device, complete the following steps to turn on development mode, if it is not already enabled:
    1. Swipe down from the top of the screen and tap Settings > Security and Privacy > Development Mode.
    2. Set the Use Development Mode option to On.
      If you haven't set a device password yet, this step will prompt you to set a device password.
  2. Connect your BlackBerry 10 device to your computer using a USB cable.
  3. Update the deploy_bb10_app script with your device password by completing the following steps:
    1. In a text editor, open the deploy_bb10_app.bat file. This file is located in the same folder as where Construct 2 saved your exported project files (for example, C:\Users\eoros\Desktop\Space Blaster).
    2. Locate the -password option and replace mypassword with your device password.
    3. Save the script and close the text editor.
  4. To deploy the .bar file on your BlackBerry device, run the deploy_bb10_app script.
    You can also deploy the .bar file wirelessly instead of using an USB cable by specifying the Wi-Fi IP address of your device to the -device option in the deploy_bb10_app script.

Best practices

In Construct 2, you can modify the viewport fairly easily, to create games for specific BlackBerry 10 devices. For more information on designing for different screen sizes, you can reference the screen size chart in the UI guidelines.

BlackBerry 10 supports both WebGL and 2D Context for rendering, so you can choose which one you prefer to use. You can also export your game for each API separately, so it can be deployed on a wider range of operating systems.

Last modified: 2014-03-10

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus