Log in / Register
Home arrow Computer Science arrow Learn BlackBerry 10 App Development
< Prev   CONTENTS   Next >

Build Configurations

There are four build configurations to consider when creating Cascades application:

n Simulator debug

n Device debug

n Device profile

n Device release

A build configuration defines a set of rules and settings for building your application for a given processor or target (for example, the “Simulator debug” configuration will build your project with debug symbols enabled for a Simulator target, whereas “Device release” will build a release version of your project for a physical device with an ARM processor). At any point, you can set the active build configuration, as explained in the following paragraph.

To build the project for the simulator, select HelloCascades in Project Explorer, and then

set Project ➤ Build Configurations ➤ Set Active ➤ Simulator-Debug from the Momentics main menu. Next, select Project ➤ Build Project. The build starts immediately and the build output is displayed in the Console View.

When the build finishes, a new folder called x86/o-g containing the build results will be created under your project's root folder.

Note that another extremely convenient way of selecting a build configuration is by using the BlackBerry Toolbar, as shown in Figure 1-9 (you will also see in the next section how to use the BlackBerry Toolbar to set up targets). To build the project, select Debug for the build type and then click the Hammer button.

Figure 1-9. BlackBerry Toolbar


Before testing HelloCascades, you need to define a deployment target. On the BlackBerry Toolbar, select the Manage Devices… option located in the Active Device drop-down (this will display the Device Manager wizard; see Figure 1-10 and Figure 1-11).

Figure 1-10. Manage devices

Figure 1-11. Device Manager (figure also shows installed simulators)


To configure a new simulator using the Device Manager wizard, follow these steps:

1. Click Install a New Simulator. Choose the most recent simulator from the list and install it (see Figure 1-12). (Note that if you are developing for a specific API level, you can select a different simulator. I will tell you more about API levels at the end of this Chapter.)

Figure 1-12. Simulator versions

2. As soon as you have selected the simulator, the Device Manager wizard will start its download.

3. When the download has completed, the simulator will be launched and the final step will be to pair Momentics with the simulator (see Figure 1-13).

Figure 1-13. Simulator pairing

4. The simulator will now appear in the Device Manager's list of simulators and you can connect to it (see Figure 1-11). (Note that you might need to restart Momentics for the new simulator to appear in the BlackBerry Toolbar's Active Device list.)

You can now try to launch HelloCascades on the simulator using the green Debug button on the BlackBerry Toolbar (if you haven't built the project previously, click the Hammer button; see Figure 1-9).


Configuring a new physical device for testing purposes is accomplished by pairing the device with Momentics. You will also have to generate a debug token, which will be saved on the device by Momentics. Once again, the BlackBerry Toolbar streamlines the process:

1. Make sure to turn on Development Mode on your device using Settings ➤ Security and Privacy ➤ Development Mode.

2. Connect your device to your computer with the USB cable provided by BlackBerry.

3. Just like for the simulator, launch the Device Manager wizard from the BlackBerry Toolbar. This time, select the Devices tab and click Set Up New BlackBerry 10 Device (see Figure 1-14).

Figure 1-14. Set up new BlackBerry 10 device

4. You will have to pair your device during the first step of the configuration.

To pair your device, you can either use the USB cable or a Wi-Fi connection. Select Pair Using USB and then click Next. (Note that if your device is protected by a password, enter it in the password field; see Figure 1-15.)

Figure 1-15. Pair device using USB

5. If you have already generated your BlackBerry ID token as explained in the SDK configuration section, the wizard will skip the second step; otherwise, follow the wizard's instructions.

6. On the next wizard page, select Create Debug Token and click Finish. You will finally be asked to provide the password used to create your BlackBerry ID token (see Figure 1-5) before a new debug token is deployed on your device (see Figure 1-16).

Figure 1-16. Create Debug Token

This time, you can try to launch HelloCascades on the device by selecting it as the Active Device on the BlackBerry Toolbar.

Found a mistake? Please highlight the word and press Shift + Enter  
< Prev   CONTENTS   Next >
Business & Finance
Computer Science
Language & Literature
Political science