12-11-2013 04:39 PM - edited 06-04-2014 01:47 PM
Now available as a KB:
Hello all, this is intended as an update to the information available here:
This will be converted to a KB soon and subsequently the information at the URL above will be updated. But for the time being I wanted to make this information available here as well.
If any errors are found or questions arise, please feel free to comment on this thread or contact email@example.com directly.
The information within assumes familiarity with Construct 2; up to the point that you are able to develop your application and are now ready to export your project for various platforms.
BlackBerry 10 WebWorks SDK
You can download the most recent version of the BlackBerry 10 WebWorks SDK here:
This will enable a number of command-line (CLI) tools that you can leverage to register your code signing keys and make available the webworks command via CLI, enabling you to create new projects, deploy to devices, and build release versions of your application.
For those familiar with phonegap, webworks is another Cordova-based variation. The benefit of using the BlackBerry 10 WebWorks SDK directly is that your environment is automatically configured to build for BlackBerry 10 without the need for any additional configuration. Both Cordova and Phonegap are valid tools, though you will need to follow the corresponding platform guides to configure your development environment.
Code Signing Keys
If you have already registered your BlackBerry Code Signing keys, you do not need to take any action. In the future, BlackBerry Code Signing will be completely BBID-based, so if you have not yet made the transition you are encouraged to do so (though not required at this time.)
If you have not yet registered any BlackBerry Code Signing keys, you will need to do so.
In either case, instructions can be found here:
Exporting For BlackBerry 10
At this point, there are three assumptions. You have:
Now, you are at the point of exporting your Construct 2 application for the BlackBerry 10 platform. To do so, we will need to begin in the command-line. On your PC, open a command-line terminal and navigate to the folder where you would like to create your project. For this example, we will be using c:\webworks.
C:\>cd webworks C:\webworks>
From here, we want to create a new webworks project that will house our Construct 2 application. For this, we use the webworks create command. We'll then want to navigate into our newly created folder.
C:\webworks>webworks create C2Sample
This will generate a pre-populated sample folder structure for your application. We'll want to navigate to the following sub-folder and delete everything except config.xml. Only config.xml should remain.
Next, let's switch over to the Construct 2 IDE. From the Construct 2 IDE, we'll want to click through the following.
File > Export Project... > Web (HTML5 Website)
The export option for Mobile (BlackBerry 10) refers to the legacy BlackBerry 10 WebWorks SDK 1.0.
In the Export Options dialog, for Export Files To, choose the www sub-folder of your WebWorks project; the same folder where we previously deleted the files.
The remaining items can remain as they are. Do not enable Minify Script as it may interfere if you are using certain plugins. Once configured, click Next.
In the HTML Export Options dialog, you can choose which best fits your project. If you are unsure, choose Embed Style. Once configured, click Export.
This should generate your Construct 2 application within your BlackBerry 10 WebWorks project folder; specifically the www sub-folder.
Before you can build your project, we will need to make a few changes to the config.xml file in our root www folder. Example:
You can open this file with any standard text editor. The default values that will need to be changed are highlighted in blue below.
<?xml version='1.0' encoding='utf-8'?> <widget id="webworks.default" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>WebWorks Application</name> <description> A sample Apache Cordova application that responds to the deviceready event. </description> <author email="firstname.lastname@example.org" href="http://cordova.io"> Apache Cordova Team </author> <content src="index.html" /> <access origin="*" /> <preference name="fullscreen" value="true" /> <preference name="webviewbounce" value="true" /> </widget>
Also, take note of the <access> element. If your application is loading resources from external locations, you will need to white-list those URLs. For more information on <access> and various config.xml elements, please check the following documentation.
Building and Deploying a Debug Version
To test your newly exported project on a BlackBerry 10 device:
You should be prompted for your Device Password, after which the WebWorks SDK will create and deploy a debug token, uninstall any previous versions of the application, and install the current project in debug mode; enabling Web Inspector automatically.
Building a Release Version
To release an application through the BlackBerry World storefront; it must be fully signed. To do so, execute the following command from the root folder of your WebWorks project, using the CLI.
C:\webworks\C2Sample>webworks build --release --keystorepass 123456 --buildId 25
Where 123456 should be replaced with your own Code Signing password, and the buildId should reflect the current version of your application. Most developers will begin at 1 and increment with each new release.
The buildId is combined with the version specified in your config.xml. For example, if your config.xml version is 1.0.0 and your buildId is 25, the full version of your application will be 184.108.40.206. When submitting to BlackBerry World, new releases must have a higher version than the previous release. You can achieve this by either increasing the version in config.xml, or by incrementing your buildId.
Note that 220.127.116.11 is a higher version number than 18.104.22.168.
12-11-2013 05:06 PM
12-13-2013 09:13 AM
I wanted to add that you can also use "webworkd build release -k yourkey -b builid"
Littlebit less to type, you can also skip the -k yourkey and you will get a prompt for typing your key
01-02-2014 05:40 PM