Switch branches/tags
Nothing to show
Find file History
Pull request Compare This branch is 1243 commits behind blackberry:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Contributing A Tablet OS API

When building an API for the BlackBerry WebWorks SDK for Tablet OS, you will start by creating a sub-directory within this Tablet directory. Pick a name that suits your extension and try not to use spaces in your directory name. It just plain makes things easier.

As a recipe for building your API you can use the Locale as a good example. In your API directory you will want to create a source code directory called src where your ActionScript code will reside, and a source code directory called js where your JavaScript code will reside. You will also need to create a library.xml file at the root of this directory. More information on the library.xml can be found below in this README.

A README.md file also needs to be created at the root of your directory where you can place all the information about how to use and configure your API. The Locale is a good example of what type of information to include in your README.md file. This README.md file uses Markdown wiki formatting.

Tablet OS API Tutorial

You can find an API tutorial on creating JavaScript extensions for Tablet OS created by a member of the community.

library.xml Formatting

The below example shows what information needs to be added to your library.xml file:

<library isWhitelist="true">

  <extension id="my.fancy.api">
    <platform value="AIR">
      <target version="default" config="AIR_XHR" />

    <configuration name="AIR_XHR" version="1.0" comment="For XHR architecture">
		<src type="text/javascript" path="js/common/fancynewapi_dispatcher.js" comment="Application JS interface" />
		<src type="text/javascript" path="js/common/fancywapi_ns.js" comment="Application JS interface" />
		<src type="text/actionscript" path="src/Air/FancyNewAPI/src" comment="ActionScript implementation" />

    <feature id="fancy.new.api" version="" />


library.isWhiteListed Should be set to true. This means that your API will be injected into JavaScript when the whitelisted feature ID is used in the applications config.xml file.

library\extension.id This is the feature ID of your JavaScript extension that will be used in an app's config.xml file

library\extension\entryClass This value is the fully qualified name of the Class that implements your ActionScript extension.

library\configurations\configuration\src.path These are paths to the files that you need for your extention to run. One file is for the JS dispatcher, one is for the JS namespace and one is for your ActionScript implementation src directory

library\features\feature.id This is the feature ID of your JavaScript extension that will be used in an app's config.xml file. Yes... it is in here twice!

library\features\feature.version This attribute is required but doesn't serve any meaning. Leaving it at is all you need to do.

Testing Your API

You can test your API with an existing installed WebWorks SDK for Tablet OS by following the below steps:

  1. Locate your BlackBerry WebWorks SDK for Smartphone extensions directory using your File Explorer. Default path is C:\Program Files\Research In Motion\BlackBerry WebWorks SDK for TabletOS\bbwp\ext

  2. Create a new directory for your API in the ext directory. This should be named the same as your feature id fancy.new.api

  3. Copy your library.xml file into to your new ext\fancy.new.api directory

  4. Copy your root code src directory and your js directory to your newly created ext\fancy.new.api directory

  5. Create a WebWorks Application using your API and create a feature element specifying the ID of your API. <feature id="fancy.new.api" />

  6. Build your application using the bbwp.exe command line and test your application on the desired simulator