Configure your development environment

After you install the BlackBerry Native Plug-in for Microsoft Visual Studio and open Microsoft Visual Studio, the BlackBerry tab is displayed. There are a few things that you need to do to configure your development environment, and the BlackBerry tab is where you start.

Register with BlackBerry

To sign and publish your completed app, you need to get a BlackBerry ID token and register with BlackBerry.

If you previously used code signing keys to register another BlackBerry 10 device on your computer, your code signing keys will remain on your computer and continue to function. You should link them to your BlackBerry ID. For more information see Link a BlackBerry ID to a signing authority account.

  1. In Microsoft Visual Studio, on the BlackBerry menu, click Signing.
  2. In the BlackBerry Signing Authority section, click Register.
  3. In the Sign in to BlackBerry ID window, complete the Username field and Password field. If you don't have a BlackBerry ID token, you can create one.
  4. Click Sign In.
  5. In the Create a BlackBerry ID Token window, complete the Password and Confirm Password fields.
  6. Click the check box that you have read and agree with the license agreement.
  7. Click Get Token.
  8. In the Registration Window, complete the Author name field. The author name appears on your app.
  9. Complete the BB ID Token Password field with the password you created for your BlackBerry ID token.
  10. Click OK.

Your BlackBerry ID token is valid for one year. When it expires, you need to create a new one. Visit Code Signing Support for help with your BlackBerry ID token.

Screen showing the Code Signing Properties window.

In the Code Signing Properties window, you can register, unregister, back up, and restore your signing keys.
  • Register: To register with BlackBerry, click Register. You must register before you can sign your app.
  • Unregister: To remove your BlackBerry ID token, click Unregister. You need to request a new token before you can sign your app.
  • Back up: To create a backup of your BlackBerry ID token or if you want to move your BlackBerry ID token from one computer to another, click Backup.
  • Restore: If you moved your BlackBerry ID token from one computer to another, click Restore to restore your BlackBerry ID token.

Choose an API level

The API level determines which APIs are available for you to use in your app. The API level corresponds to a version of the BlackBerry 10 OS (for example, 10.0, 10.1, and 10.2). When you select an API level for your project, you are choosing the version of the BlackBerry 10 OS that your app is compatible with.

The API level is backward compatible. Later API levels include all the APIs from lower API levels. For example, API level 10.2 includes all the APIs from 10.1 and 10.0. APIs are deprecated but are not removed, to ensure that existing apps can continue to use them.

The API level of your app must correspond to the API level of the device that you want to run your app on. Apps that are developed with a lower API level are supported on existing devices and can reach a broader market. However, apps that are developed with a later API level can take advantage of a richer set of APIs and features.

If your app uses APIs that were introduced in a later API level, you won't be able to install the app on a device with a lower API level. However, you can run an app with a lower API level on a device with a later API level because API levels are backward compatible.

  1. In Microsoft Visual Studio, on the BlackBerry menu, click Settings. In the BlackBerry API Levels section, in the API Level drop-down list, the current API level is displayed.
  2. To choose a different API level that you have already installed, on the drop-down menu, click the down arrow.
  3. If there is no API level listed, click Get More to see the API level options.

In the API Level window, you can see a list of currently installed APIs and a list of available APIs. Choose the API level you want and click Install. You can uninstall an API level by clicking the Uninstall button.

Screen showing the API Level window.

Update your API level

The device runtime includes the files that you need to perform debugging or profiling on a particular device. There is one device runtime for every released device build (such as 10.0.0.1024, 10.1.0.300, and so on). It is installed on your computer when you try to launch an application on a device. The device runtime corresponds to the API level, but it does not include information that is in the API level, such as headers. When there is a new device runtime, there is also a new API level. However, unlike the API level, you don't select the device runtime for a project.

When you deploy your app, the update manager automatically detects whether you have the correct API level and runtimes installed for your device. If there is a mismatch, the API Levels dialog box opens and you are prompted to install or update the runtime libraries or API level to deploy your app. If you do not install the runtime or API level, your app will not deploy.

Screen showing the API Levels dialog.

Get a simulator

You can use the BlackBerry 10 Device Simulator to test your app. You don't need a debug token or BlackBerry ID token to run apps on the BlackBerry 10 Device Simulator.

If you are testing using the BlackBerry 10 Device Simulator, you need to download a simulator that matches your SDK.

For more information about the simulator, see Using the simulator.

Before you download the simulator, you need to install VMware Player. Download and install VMware Player 3.1 or later.

  1. In Microsoft Visual Studio, on the BlackBerry menu, click Settings.
  2. Click Get More.
  3. Click Get Simulators.

    In the Simulators window, you can see a list of currently installed simulators and a list of available simulators.

  4. To see a list of simulators for that SDK, click the down arrow beside the SDK version.
  5. Choose the simulator you want and click Install.

    The simulator is installed under the bbndk_vs folder.

    You can uninstall a simulator by clicking the Uninstall button.
  6. Click Close.
Screen showing the Simulator selection window.

If you download the latest simulator for the 10.2 Gold version of the BlackBerry 10 Native SDK, you also need to download the corresponding runtime.

Set a device target

When you set a device target, you need to choose which version of the BlackBerry 10 Native SDK you are going to use. Then, you need to set either a BlackBerry Device Target or a BlackBerry Simulator Target. This target is used when you build your solution. You connect a device to Microsoft Visual Studio by using a USB connection.

  1. In Microsoft Visual Studio, on the BlackBerry menu, click Settings.
  2. Complete one of the following:
    • If you are using a physical device, under BlackBerry Device Target, in the IP Address field, enter the IP address for the BlackBerry device attached to your computer.

      You can find the IP address by navigating to Settings > Security and Privacy > Development Mode.

    • If you are using a simulator, under BlackBerry Simulator Target, in the IP Address field, enter the IP address for the simulator.

      Use the simulator IP address found in the lower-left corner of the VMware Player window. Do not use the IP addresss provided in the simulator Development Mode screen.

  3. Enter the password for your BlackBerry device or simulator.
  4. Click OK.
Screen showing the BlackBerry Settings dialog.

You can register only one device at a time.

Install a debug token

A debug token allows you to deploy unsigned apps on a device. You don't need a debug token if you are using a simulator. Before you complete these steps, make sure that you request a vendor account and set a device target.

To install a debug token:

  1. In Microsoft Visual Studio, on the BlackBerry menu, click Debug Tokens.
  2. In the Debug Tokens dialog box, click Add.
  3. Click Close.
Screen showing the Debug Tokens dialog.

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 token that's registered on the host computer. To generate a new token, in Microsoft Visual Studio, on the BlackBerry menu, click Debug Tokens and click Renew.

After you finish configuring your environment, you're ready to get started on your app!

Last modified: 2014-02-25

comments powered by Disqus