BlackBerry WebWorks application development provides APIs that help take your application to a new level. WebWorks APIs provide you access to compelling technology that you can leverage to create engaging and visually stunning new apps that seamlessly connect to system-level functionallity on both BlackBerry smartphone and PlayBook tablet devices.

Start exploring the APIs and find out how you can interact with the BlackBerry ecosystem: from built-in features such as GPS and the camera and video recorder, to push services on smartphones and the BlackBerry Enterprise Server.

Download the latest BlackBerry WebWorks SDK for Smartphones and Tablet OS

Learn more


Emulating BlackBerry WebWorks APIs

BlackBerry WebWorks applications can be emulated and tested without the use of a device Simulator for the majority of WebWorks APIs. This is accomplished by the use of the BETA Ripple emulator which is currently implemented as a Chrome plug-in. As this BETA product evolves it will eventually move away from its current implementation as a Chrome plug-in and grow into something even more powerful. Be sure to follow the BlackBerry Developer Blog for further updates surrounding the Ripple tooling.


Preparing Your Environment

Before packaging your first BlackBerry WebWorks application, you will need to ensure that you have your environment properly configured. You can follow the Getting Started Guide for BlackBerry Smartphones on Windows, and the Getting Started Guides for WebWorks on Tablet OS for either Mac OS X or Windows.

You can download the BlackBerry WebWorks SDK for Smartphones and for Tablet OS from the BlackBerry Developer Zone


Building Your First App Using BlackBerry WebWorks APIs

Creating your first WebWorks application that utilizes BlackBerry specific APIs is quite simple. The steps below will demonstrate the pattern to use when create an application using a WebWorks API. Make sure you follow the "Preparing Your Environment" instructions right above this topic first before attempting the following steps.

NOTE: The steps outlined below are the same for Windows and Mac OS X. However, the path examples given are sample Windows paths.

1.
Create the main HTML file for your BlackBerry WebWorks application by creating a directory that includes an index.html file.

C:\MyDirectory\index.html

Then add a simple BlackBerry specific API to your application's source code:

<html>
  <head>
    <meta name="viewport" id="viewport" content="height=device-height,width=device-width,user-scalable=no" />
    <script type="text/javascript" >
      function doAlert() {
        alert('The name of my app is: ' + blackberry.app.name);
      }
    </script>
  </head>
  <body onload="doAlert()" >
    <h1>Hello World</h1>
  </body>
</html>

2.
Now create a config.xml file for your app:

C:\MyDirectory\config.xml

Edit your config.xml file to include a <feature> declaration for your desired API:

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0" rim:header="RIM-Widget:rim/widget">
  <name>My App</name>
  <author>Me</author>
  <content src="index.html" />
  <feature id="blackberry.app" />
</widget>

3.
Add your index.html and config.xml to a ZIP file (myapp.zip):

myapp.zip
  |- index.html
  |- config.xml

Both files should be at the root of the ZIP archive
4.
Open a command prompt and change directories to the root of the WebWorks SDK install folder. If you find the bbwp application you will know you are in the root folder of the SDK.

Now run the command line utility to build up your application and place the output in the "C:\OutputDirectory"

bbwp "C:\myapp.zip" -o "C:\OutputDirectory"

>>[INFO]            Parsing command line options
>>[INFO]            Parsing bbwp.properties
>>[INFO]            Validating WebWorks archive
>>[INFO]            Parsing config.xml
>>[INFO]            Populating WebWorks source
>>[INFO]            Compiling WebWorks app
>>[INFO]            Generating output files
>>[INFO]            WebWorks packaging complete
5.
You now have an installable application for either a BlackBerry Smartphone or a BlackBerry PlayBook located in your specified output directory

C:\OutputDirectory\bin

For more detailed information please refer to the WebWorks SDK documentation for Tablet OS and BlackBerry Smartphones