Creating your first app

This tutorial will guide you through creating a simple "Hello World" app, and help you verify that you successfully installed and configured the tools.

You will learn to:

  • Set up your project
  • View your app on a simulator
  • View your app on a device

Before you start, make sure you have the necessary tools installed. For more information, see Setting up your tools.

Set up your project

To create your project:

  1. Open BlackBerry WebWorks <version>. A new browser window opens, displaying the BlackBerry 10 WebWorks SDK web tool.
  2. Click [+] beside the Projects heading in the navigation panel.
  3. Enter Hello World in the Project Name field.
  4. Enter C:\TestApps in the Project Path field.
  5. Click Save.

The default app project includes all the necessary artifacts to function as a complete app.

View the app on a simulator

Verify the following on your BlackBerry 10 Device Simulator:
  • Device Password is enabled (Settings > Security and Privacy > Device Password)
  • Development Mode is enabled (Settings > Security and Privacy > Development Mode)

To build your app and deploy it to a simulator:

  1. In the BlackBerry 10 WebWorks SDK web tool, under your project's name in the navigation panel, click Build.
  2. Select Debug Mode.
  3. Select Simulator.
  4. Click Build & Install.

The tool packages your app into a .bar file, installs and launches it on your simulator.

View the app on a device

Verify the following on your BlackBerry 10 device:
  • Development Mode is enabled (Settings > Security and Privacy > Development Mode)
  • Debug token is installed and valid
  1. In the BlackBerry 10 WebWorks SDK web tool, under your project's name in the navigation panel, click Build.
  2. Select Debug Mode.
  3. Select Device.
  4. Enter your device password.
  5. Enter your keystore password, which you defined when you registered your BlackBerry ID token. If you have not yet registered your BlackBerry ID token, see Set up your computer for testing and signing.
  6. Click Build & Install.

Once the app successfully installs on your device and before the app starts for the first time, a dialog box appears. Click OK on this dialog box to permit the app to access various resources on your device. Also, each time the app opens, a dialog box appers to inform you that Web Inspector is enabled.

Importing a WebWorks 2.0 project into the SDK web tool

There are instances where an existing WebWorks project is not available from within the WebWorks SDK web tool. For example, projects that you create from the command line are not displayed in the web tool. In additions, all WebWorks project content that appears in the tool is stored in browser cookies; deleting these cookies removes the project data from the web tool.

You can import a WebWorks 2.0 project into the web tool at any time. To import an existing project into the web tool:

  1. On the Start menu, click BlackBerry >BlackBerry WebWorks <version>. A new browser window opens, displaying the BlackBerry 10 WebWorks SDK web tool.
  2. In the navigation panel, click the arrow icon beside the Projects heading.
  3. In the Project Path field, enter the complete path to the project.
  4. Click Open.

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus