Check Out Our WebWorks Community APIs

Community

webwork APIs
You may not be aware, but we have a repository with several open source extensions for WebWorks app development.  These have been contributed by a mix of BlackBerry staff, students, and community developers.

The extensions are posted in GitHub, but we’ve set it up so you don’t have to use Git or do any of the packaging yourself. GitHub allows you to download the entire repository as a zip file. Then each extension is organized so there is an ‘ext’ directory which contains the full extension ready to be included in your SDK. Just copy the contents of that directory into your own <WebWorksSDK>/Framework/ext directory.

Using the extension in your app is easy because each one also includes a sample application that shows how to include the API feature, and how to call the functions it makes available. If you want to try it out before putting the API into your application, you can build and run the sample application and test it out.

And before you even look at the sample, you can see what APIs are available and what they do by just checking the GitHub site. Within the BB10 directory, it will show the extensions and the major APIs that they expose, while each extension’s readme file will explain the methods that are included.

Finally, these are the additional APIs that are available today:

Prevent Sleep – control the backlight and prevent the screen from dimming while your app is in the foreground.

LED – Flash the LED and control its colour.

Thumbnail – scale images at native speed

Unzip – unzip a file to a given directory on the device.

Vibration – make the phone vibrate for variable times and intensities

Barcode Scanner – Scan and interpret barcodes, both 1-D and 2-D.

Screen Display – get physical information about the device screen, such as pixels per mm

DeviceInfo – get the model number (‘Z10’), and carrier country and network codes from the phone.

GseCrypto – generate Hashes, encryption keys, and random numbers, plus encrypt and decrypt information.

Those are some pretty great features to take advantage of. I used the DeviceInfo extension in my app to great effect. Check them out on GitHub, and see what you can do with them in your own app.

About Tim W.

Tim works on the Developer Relations team at BlackBerry, focusing on WebWorks, HTML5, and Open Source.

Join the conversation

Show comments Hide comments
+ -
blog comments powered by Disqus