Managing projects

When you start the Momentics IDE for BlackBerry for the first time, the Workspace Launcher dialog box prompts you for a location to store your workspace. All of your projects are stored in this folder.

After you create or import a Cascades project, you are prompted to open the project in the QML Editing perspective. The QML Editing perspective contains a number of views designed to assist with QML development, such as the Components view and the QML Properties view.

For more information about the views that you can use in the Momentics IDE, see The QML Editing perspective.

Screen showing the QML Editing perspective in the Momentics IDE.

Create a project

The first step in developing an app is creating a project for all of your source code and assets. To create a Cascades project, you can use the New BlackBerry Project wizard. The wizard has four tabs that you need to complete: Project Type, Templates, Basic Settings, and API Level.

To start the wizard, click File > New > BlackBerry Project.

Project Type

The Project Type tab on the New BlackBerry Project wizard.

The Project Type tab allows you to select whether you want to create an app (Cascades or Core Native), a library (Cascades, Static, or Shared) or a Native extension (Adobe AIR or BlackBerry WebWorks).

To continue, make sure that Application is selected, click Cascades, and then click Next.


The Templates tab in the New BlackBerry Project wizard.

The Templates tab provides project templates that you can use to create your project. Each template is a unique starting point that you can use for building your app. You should take some time to explore the different layouts and navigation models, to see what kind of UI works best for your app.

To continue, select a template from the list and click Next.

Basic Settings

The Basic Settings tab in the New BlackBerry Project wizard.

The Basic Settings tab allows you to provide a name and location for your project, and to add the project to an existing working set if required.

To continue, provide a name for your project in the Project Name field and click Next.

API Level

The API Level tab in the New BlackBerry Project wizard.

The API Level tab allows you to select the API level that you want to build your application with. Each API level corresponds to a version of the BlackBerry 10 OS (for example, 10.0, 10.1, 10.2, and 10.3) and supports a specific set of devices. For more information about API levels, see API levels.

To continue, select the API level that you want your application to support and click Finish. Your app appears in the Launch configuration drop-down list and builds. You can see the results of the build in the Console view.

Import an existing project

Sample apps and tutorial code are packaged as projects that are compatible with the Momentics IDE for BlackBerry. You can import Cascades sample apps directly from the IDE.

To import a sample app from the Welcome page:

  1. On the Welcome page, click Sample apps.
  2. Click a sample app to read more about it.
  3. Click Download and import on the sample of your choice. The project folder for the sample is added to the Project Explorer view and a launch configuration is created for this project.

You can also import existing project files from the File menu:

  1. On the File menu, click Import.
  2. Expand General and select Existing Projects into Workspace. Click Next.
  3. Select the Select root directory option and click Browse.
  4. Browse to the location of the project or projects that you want to import, and click OK.
  5. In the Projects section, select the project or projects that you want to import, and click Finish. You can see the imported project or projects in the Project Explorer view, and you can explore the source code.

For more information about importing projects, see Import and export projects.

Explore project files

Every project that you create or import into the Momentics IDE contains the following files and folders:

  • Screen showing the Project explorer in the Momentics IDE. src: This folder contains the C++ source and header files for your app.
  • arm: This folder contains binaries used for running the app on a device.
  • assets: This folder contains the assets for your app, including images, sounds, video, and QML files.
  • translations: This folder contains translation files containing localized text that the app uses to support different locales.
  • x86: This folder contains binaries used for running the app on the simulator.
  • bar-descriptor.xml: This file contains all the configuration settings that your app requires. For more details about various configuration settings, see The bar-descriptor.xml file.
  • config.pri: This autogenerated file contains build instructions for precompiled headers.
  • Makefile: This file contains build settings for your app. When you use the Momentics IDE to build and package your app, you don't typically have to modify any of these instructions. For more information, see Makefile security settings.
  • precompiled.h: This file contains a list of headers that you want your app to precompile.
  • .pro: This file contains project settings for your app. It also lists the libraries that your app links against. For more information about linking to libraries, see Link against libraries.

Create a Cascades library project

You might want to create a library of reusable code that you can share with multiple projects. You can create a library and add it to your project so that it's included in your finished app when you build it. There are three types of shared libraries: Cascades, Static, and Shared. You can create a Cascades library to reuse Qt app logic or custom QML components. You can also create a static or shared library to reuse C++ or C code. A shared library is bundled with your app and dynamically linked by your app when it starts. A static library is included in your .pro file and linked when you build a release version of your app.

To create a Cascades library, you can use the New BlackBerry Project wizard:

  1. On the File menu, click New > BlackBerry Project.
  2. In the left pane, select Library as your project type.
  3. In the right pane, select Cascades as your library type and click Next.
  4. Type a name for your project in the Project name field and click Next.
  5. Select the API level that you want your library to compile against and click Finish.

Your Cascades library project opens in the Project Explorer view and the readme.txt file opens in the editor.

Screen showing a Cascades library in the Project Explorer and the readme.txt in the Editor.

In the readme.txt file, you can learn how to do the following:

  • Link your library to your app
  • Build your app to link your library
  • Use your Cascades library as a shared or static library
  • Convert your Cascades library into a generic Qt library
  • Debug your shared library
  • Add translations for additional languages to your library

Last modified: 2014-06-24

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

comments powered by Disqus