Set up your environment

Before you start developing for BlackBerry 10, there are a few things that you need to do.

Request a vendor account

If you want to offer your app on the BlackBerry World storefront, the first thing you need to do is request a vendor account on the BlackBerry World vendor portal. When you are a member of the vendor portal, you can use your primary user account to make your app and its digital goods available for sale. You can also simulate purchasing and downloading your app using a sandbox test user account.

For more information about applying for an account, see Managing vendor portal accounts.

To learn how to simulate the purchase process, see Testing apps with a sandbox user account.

Set up your device

To develop apps for your BlackBerry 10 device using the Momentics IDE for BlackBerry, you must enable Development Mode on your device. This mode allows you to remotely install and launch apps. If you don't intend to do development activities, disable Development Mode for increased security. Development Mode expires automatically in ten days. If you restart your device, Development Mode is disabled automatically.

To enable Development Mode on your device:

  1. On the home screen, swipe down from the top of the screen or find the Settings app on your home screen.
  2. Navigate to Settings > Security and Privacy > Development Mode.
  3. Set the Development Mode toggle button to On.
  4. If you are prompted, enter the password for your device, and tap OK.

You can connect your device to the IDE using Wi-Fi or with a USB cable. Navigate to Settings > Storage and Access and make sure that the USB Connection option is set to Autodetect or to the target platform.

Download and install the IDE and SDK

Now you can download the Momentics IDE with the correct version for your operating system. Windows, Mac OS, and Linux are supported. The IDE contains the tools that you need to develop apps for BlackBerry 10 devices. To make this download fast and easy, the BlackBerry 10 Native SDK is installed separately.

When you start the Momentics IDE, you can download and install the BlackBerry 10 Native SDK from within the IDE. The IDE provides a wizard that helps you select an SDK that matches the connected device. You can also install a previous version of the SDK to develop your app for device OS versions that are already in market. Versions of the SDK are referred to as API levels. To learn more about API levels, see API levels.

If you already have a version of the IDE installed or you’re using an old workspace, you need to update your SDK after you start the IDE. To get a new version of the SDK, click Help > Update API Levels. You can select a Gold version of the SDK or a beta version of the SDK using the tabs.

Set up the IDE and connect your device or simulator

Now you can set up the Momentics IDE for BlackBerry.

Let's get started!

To start the Momentics IDE:

  • In Windows and Mac OS, start the Momentics IDE by using the shortcut created by the setup application.
  • In Linux, start the Momentics IDE by running the qde executable in the IDE installation folder.
If you are prompted, choose a workspace or create a workspace, and click OK. A workspace is a folder where you keep your projects.

  1. The IDE automatically tries to find a device that is connected to your computer. If your device is connected to your computer, you can pair your device with the IDE and download the matching BlackBerry 10 Native SDK. Follow the steps in the wizard to download and install an SDK version for your development environment.

  2. In the toolbar, you can run, debug, or profile an app using the Active Device drop-down list. You can select a project to build in the Active Project drop-down list. Or you can select and configure a device or install a simulator using the Active Device drop-down list.

    Animation showing the Action, Active Project, and Active Device drop-down lists in the Momentics IDE toolbar.

  3. If you are connecting to a BlackBerry 10 device, select the option to configure a connected device in the Active Device drop-down list. Follow the instructions in the wizard to pair your device with the IDE, get your BlackBerry ID token, and create or import a debug token to your device.

    You need debug tokens to test your app on a device. You also need a BlackBerry ID token to sign and publish your completed app. In the Active Device drop-down list, click Manage Devices to pair a device, set up a BlackBerry ID token, and create and upload a debug token to your device.

    When you create a debug token, you specify the PIN for each device on which the token can be used. You can distribute the debug tokens that you create to developers to install on those devices, or install them yourself. Make sure that you remember your registration PIN. You need this PIN later in the signing registration process.

    Debug tokens are valid for 30 days. When a debug token expires, the device no longer allows unsigned apps that rely on that token to run. When a debug token expires, you can generate a new one from the host computer's registered BlackBerry ID token.

  4. If you are testing using the BlackBerry 10 Device Simulator, select the option to download a simulator that matches your SDK in the Active Device drop-down list. Follow the instructions in the wizard to pair the simulator with the IDE.

    You don't need a debug token or a BlackBerry ID token to run apps on a BlackBerry 10 Device Simulator.

For more details about signing and publishing your completed app, see Signing and publishing. If you need help getting a BlackBerry ID token, visit Code Signing Support.

You can also start the BlackBerry Deployment Setup Wizard manually anytime:

  1. In Windows and Linux, click Window > Preferences. In Mac OS, click Momentics > Preferences.
  2. Click BlackBerry.
  3. Click BlackBerry Deployment Setup Wizard.

Now you are ready to build an application!

Build an application

Let's walk through creating, building, and running a standard empty project.

  1. In the Momentics IDE, in the Active Project drop-down list, click Create New BlackBerry Project.
  2. On the Project Type page, select Application > Cascades and click Next.
  3. On the Templates page, click Standard empty project and click Next.
  4. On the Basic Settings page, in the Project Name field, provide a name for your project (for example, MyFirstApp). Click Next.
  5. On the API Level page, select the API level that you want to use and click Finish. To learn more about API levels, see API levels.
  6. If you're prompted to open the QML Editing perspective, click Yes.
  7. Your project builds automatically. To run the Hello World application, click Momentics IDE Run button..

Momentics IDE QML Preview buttons.To preview the UI of your project, open the main.qml file for the project (located in the assets folder). At the top of the edit area, there are five buttons. Click the second button (Design Mode) to preview how your UI looks before you deploy it. The Vertical Split Mode and Horizontal Split Mode buttons let you preview the source code area side-by-side with the preview area.

Celebrate! You've set up your environment and built your first Hello World application. Now you can explore the documentation or the Cascades sample apps. Click Sample apps on the Welcome page and select one of our legendary sample apps. Click Download and import on the sample of your choice and it is added to the Active Project drop-down list and the Project Explorer view.

Last modified: 2014-01-23

comments powered by Disqus