You'll learn how
to create and debug a "Hello World" HTML5 app.
Note: You're free to use any text editor or development environment you're
comfortable with to create your HTML5 app. Although there's no limitation on what you
can use, we discourage the use of WYSIWYG editors, because these tend to generate
code that's difficult to maintain and often causes performance problems.
A WebWorks app is a standalone app, which means you're not required to point to a remote
server to load a web page or app because the app lives on the device. The app is
essentially an arrangement of web assets that are packaged into a container that can be
viewed by a headless browser (the WebKit engine container). When you create your
"Hello World" app, you'll take advantage of the standard HTML5 web technology
to build it.
To create your first "Hello World" HTML5 app web file, you'll:
- Create a WebWorks
configuration document file Create a WebWorks configuration document file
(config.xml) that contains data about your "Hello
World" app. Every WebWorks app contains a config.xml
file that specifies configuration information. Any APIs required by your WebWorks
app must be specified in the config.xml file. The
config.xml file specifies: the app namespace, the name of
the app, app permissions, the start page (typically
index.html), icons to use for the app, and elements to define
general information, such as an author and a description.
- Create an
index.html file that is the entry point (main
start page) of your app.
- Copy the webworks.js file from the WebWorks archive (in
<Install_Location>/Framework/clientFiles/webworks.<version>.js)
to each WebWorks project you plan to package.
- Run your app
with the Ripple emulator. For more information, see Getting started with the Ripple emulator.
- Package your app (make sure
that you install the BlackBerry WebWorks SDK first).
- Deploy your app to
a device.
Note that at a minimum, your app will require the following files:
config.xml, index.html, ands
webworks.js.
Now, you are ready to start creating your first "Hello World" app.
Note:
Before you continue, if you haven't already installed the required software, see
Getting Started Guide.
For this example, a Windows 7 development host was used.