Down the Rabbit Hole: Extensions for BlackBerry WebWorks


In the interest of full disclosure, I admit that the BlackBerry 10 WebWorks extensions scared me a little when I first looked at them. It’s been a long time since I really wrote C++ code. We won’t dwell on how long it’s been, but let’s say it’s been long enough. And, when I looked at the memory sample, it didn’t get me to the point of being really confident in how to approach extensions. Though we called it a template, it was more accurately a small example. That said, the potential of extensions, and the cool native APIs that we could be accessing in WebWorks apps kept me thinking about ways to get better at them, and make it easier. Now, after consulting with the experts in the WebWorks team, and studying the source of many core extensions, I’m quite happy to say that we have a new template for WebWorks Extensions.

Now the template is designed as a real starting point for creating extensions, with examples for all the most common ways that the JavaScript layer needs to talk to the native layer. We haven’t changed the fact that you will be writing C, C++, or Qt code on the other end, but we have made it much easier to get right to that code instead of learning about what’s in the middle. Here’s what the template provides:

  • Synchronous and Asynchronous method templates
  • Sending and receiving text and numeric values
  • Sending and receiving JSON values
  • Starting and stopping native threads
  • Receiving ongoing callback events from native
  • Defining a custom property in the extension
  • Ant Build Script for packaging and installation in the WebWorks SDK

The results from the developers who have used the new template are superb – not only do we have some new extensions being built and contributed, but developers have confidence in what they need to do and the possibilities unlocked are immediately visible in their faces when they get coding. And, when you can focus on the code, it turns out that native code isn’t so bad after all: The rabbit hole turns out to be an underground railway with free WiFi. So, give it a shot and let’s create some cool extensions for BlackBerry 10 WebWorks.

Join the conversation

Show comments Hide comments
+ -