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. For more information about applying for an account, see Managing vendor portal accounts.

If you want to apply for and use restricted permissions, you must have a vendor account. To learn about permissions, see App permissions.

When you are a member of the vendor portal, you can also simulate purchasing and downloading your app using a sandbox test user account. 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.

If you have a media card inserted into your device, you must turn off mass storage mode to connect your device to the IDE. Navigate to Settings > Storage and Access and set the USB Mass Storage toggle button to Off.

Download and install the IDE and SDK

Now you can download the Momentics IDE with the right 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 faster, 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 released. 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. Using the tabs, you can select a Gold or beta version of the SDK.

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, start the Momentics IDE by using the shortcut created by the setup application.
  • In Mac OS, start the Momentics IDE by using the shortcut on the Launchpad or by navigating to the Momentics IDE application in a Finder window.
  • 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 not connected correctly, you can use the Device Properties dialog box to troubleshoot your connection. To open the Device Properties dialog box, click Momentics IDE edit icon beside the Launch target drop-down list.

    If your device is connected to your computer, you can download a version of the BlackBerry 10 Native SDK that matches your device. Follow the steps in the wizard to download and install an SDK version.

  2. On the toolbar, you can select an action using the Launch mode drop-down list. By default, the launch mode is set to Debug.

    Screen showing the toolbar in the 2.1 version of the Momentics IDE.

    You can create or select a launch configuration in the Launch configuration drop-down list. By default, a launch configuration is created for every project that you create and usually you don't need to create a launch configuration manually.

    You can also create or select a target for your launch configuration (a device or simulator) using the Launch target drop-down list.

  3. If you are connecting to a new BlackBerry 10 device, click Add New Target in the Launch target drop-down list. Click the Devices tab and 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 for 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 BlackBerry ID that's registered on your computer.

  4. If you are testing using the BlackBerry 10 Device Simulator, click Add New Target in the Launch target drop-down list. Click the Simulators tab and follow the instructions in the wizard to set up the simulator.

    You don't need a debug token or BlackBerry ID token to run apps on the 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.

Now you are ready to build an application!

Build an application

Let's walk through creating, building, and running a new project in Cascades and core.

Create a standard empty project for Cascades

  1. In the Momentics IDE, on the File menu, click 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. To run the Hello World application, select Run from the Launch mode drop-down list, and make sure that your project appears as the active launch configuration. Click Momentics IDE Launch 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 run your app on a device. The Vertical Split Mode and Horizontal Split Mode buttons let you preview the source code area side-by-side with the preview area.

Create a simple OpenGL ES project for core

  1. In the Momentics IDE, on the File menu, click New > BlackBerry Project.
  2. On the Project Type page, select Application > Core Native and click Next.
  3. On the Templates page, click OpenGL ES 1.1 and click Next.
  4. On the Basic Settings page, in the Project Name field, provide a name for your project (for example, MyFirstApp) and 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 C/C++ perspective, click Yes.
  7. To run the application, select Run from the Launch mode drop-down list, and make sure that your project appears as the active launch configuration. Click Momentics IDE Launch button..

What's next?

Celebrate! You've set up your environment and built your first application. Now you can explore the documentation or the sample apps.

To explore the sample apps, click Sample apps on the Welcome page and select a sample app. Click Download and import on the sample to add it to the Active Project drop-down list and the Project Explorer view.

To get started building an app from the ground up, try out these tutorials:

To learn more about using the Momentics IDE, including how to test, debug, and profile your app, see Build, test, and deploy your app and Using the Momentics IDE.

Last modified: 2014-09-29



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

comments powered by Disqus