Creating a WebWorks project
You can use the BlackBerry WebWorks SDK or CLI to create a new project.
Once created, the new project includes a default app with all the basic resources required to function as a complete app. The folder structure of your new project includes a /www folder. This folder is the working directory for your application. All of your project resource files should be stored in your project's /www folder, or in the appropriate subfolder. See Folder structure of a WebWorks project for the complete folder structure of a WebWorks project.
By default, your app has no access to any of the core Cordova or WebWorks APIs. After you create a project, you need to add plugins to access the functionality your app needs. For more information about plugins and how to add them, see Working with plugins.
Create a new WebWorks project using the SDK web tool
To create a new BlackBerry WebWorks project using the BlackBerry WebWorks SDK web tool:
- On the Start menu, click BlackBerry WebWorks 220.127.116.11. A new browser window opens, displaying the BlackBerry WebWorks SDK tool.
- Click [+] beside the Projects heading the the navigation panel.
- Enter your application's name in the Project Name field.
- Enter your desired project path in the Project Path field.
- Click Create.
Create a new WebWorks project from the command line
To create a new WebWorks project:
- On the command line, navigate to the folder where you installed the BlackBerry WebWorks SDK.
- Run the following command to create a new
webworks create <path> [<app-id>] [<app-name>]
webworks create c:\webworks-apps\MyApp com.mycompany.myapp "My App"
Check the table below for parameter details:
Specifies the home folder for your project. The tool creates this folder for you and does not overwrite an existing folder; if you specify a folder that already exists, the project is not created.
Specifies a unique identifier for the app. If provided, this value is used to populate the <id> element in the config.xml file.
Unless you are repackaging an app from another platform, you should use a reverse DNS format for all platforms, for example, id="com.somedomain.HelloWorld".
This parameter is optional.
Specifies the name for the app. To specify a name with spaces in it, enclose the value in quoation marks ("). If provided, this value is used to populate the <name> element in the config.xml file.
This parameter is optional.
You may also need to modify the /www/config.xml file to set general configuration information for your app, for example, to specifiy a particular orientation or background color.
Folder structure of a WebWorks project
When you create a new project, the BlackBerry WebWorks SDK creates the following folder structure within the project's root folder:
The merges folder contains any resources that are platform-specific. The merges directory can contain subfolders for each of the platforms you are creating your app for, and within each of those folders you duplicate the folder structure of the www directory. When you run the build command (or the run or emulate commands) and specify a specific platform, the files in the appropriate merges subfolders replace files of the same name found in the /www subfolders. If you do not specify a platform it will merge all subfolders.
This folder is used by the SDK to maintain platform-specific versions of your project. By default, when you create a new project using the BlackBerry WebWorks SDK, a BlackBerry folder is automatically created within this folder. You can also add additional platforms, such as Android or iOS. Every time you build your app for a specific platform, the contents of your /www folder is automatically copied to the appropriate subfolder.
|plugins/||This folder contains any plug-ins you add to your project using the webworks plugin add command. For more information on plug-ins, see Working with plugins. By default, this folder is empty.|
|.cordova/||This folder contains Cordova project configuration files.|
Last modified: 2014-02-06