“I had the fortune of joining a number of great software development students as we embarked onto BlackBerry’s new platform, BlackBerry 10. During this term, we explored bbUI.js, BlackBerry Webworks, and the Native Development Kit. I had worked specifically on creating new Webworks community plugins. Two plugins that I had worked on were a vibration feature to allow for additional parameters accessible only through the native development kit and a barcode reading feature with Michael Delong and Tim Windsor. In the end, I had done a great deal of research and developed various approaches to tackle the barcode reading feature.
- JNext does method invocation through string matching
- Vibration falls under the BlackBerry Platform Services
- Attempted to use card invocation to support video feedback for barcode scanning
Prior to this project, I knew of base64 encoding but I had not ever used it in my own development. The ability to encode the bytes of the image in a string was an interesting idea to take advantage of the JNext bridge to carry the image from the native layer to the web layer. Unfortunately during the actual process, the encoding and decoding process can take a fairly long time and actual rendering on the canvas was not fast enough to capture a snappy mobile experience. it was an interesting usage of base64 but this was not quite the answer for the barcode scanner in its current state.
The second attempt that I had looked into was utilizing card invocation to skip the barcode reading altogether and take advantage of a cascades application to do the barcode reading for us. Card invocation is a great idea that can also be seen on other platforms such as Android. Specific functionality that another application may be able to accomplish very well, can be used as a “card”. These cards are invoked from an application which will run that portion of another application. When the card action is complete, that application is closed and the user is returned to the original invoking application. The advantage to this option was visual feedback the user would feel as if it had been built into the Webworks framework and created a fluid native feel to this highly user requested feature, as I was switching into a cascades barcode scanning application. Unfortunately with the card invocation, an application which did the barcode reading would have to exist on the device prior to launching this Webworks application. In addition to this pitfall, Webworks in its current state allows for the ability to query potential cards to handle jobs and the ability to invocate these actions, but was unable to return values. This is an issue if the developer wants to capture a QR code and use this value in their own application. I however did not look into copying the barcode into the clipboard or providing the option to do this however this extra step could be potentially approached by other developers that are fine with running a utility application and a Webworks application.
Overall the experience on BlackBerry 10 with the Webworks framework has been an enjoyable opportunity into the world of mobile web applications. With the ability to utilize open source community driven libraries, BlackBerry has helped build an environment to utilize rich web applications with the raw power of the BlackBerry 10 platform. I look forward to seeing what new applications and innovations can arise from this new way of hybrid mobile/native development.”
You can check out the growing list of BlackBerry 10 WebWorks extensions on our Github repository. The university term is wrapping up now, so our next UCOSP update will have the final thoughts from our last two students and an overview of what the students were able to do this term. If you’re interested in doing some open source coding yourself, I’m putting together some projects for the summer. Contact me through email or twitter.