Before you begin

You should have the following things ready:

  • The BlackBerry Native SDK for Tablet OS
  • Your BlackBerry PlayBook tablet
  • A basic understanding of the C language and some experience running applications with the BlackBerry Native SDK for Tablet OS

If you need more information, the following topics in the Getting Started with the NDK might help:

Create your project

To get the Falling Blocks application up and running, you just need to create the appropriate project:

  1. In the QNX Momentics IDE, on the File menu, click New > Project.
  2. Expand Examples and click BlackBerry Tablet OS Example Project. Click Next.
  3. Select BlackBerry Tablet OS Example Falling Blocks Project. Click Next.
  4. Verify that you'd like to create the project in the default location, or clear the Use default location check box and select a different location for the project.
  5. Click Finish.

The project appears in the Project Explorer window in the IDE. To see the source files in the project, you can expand the project folder and then the src folder.

After you've created the Falling Blocks project, it should be ready to be compiled and linked. You can go ahead and compile and run the application now to see what it looks like in action.

Using the application

In the Falling Blocks example application, users controls the number of colored blocks that appear on the screen, as well as the direction of travel of the blocks. Users can interact with the application on the tablet in several ways:



Tap the screen with one or more fingers.

Add one or more blocks to the screen. The blocks start falling immediately.

Adjust the pitch and orientation of the tablet.

Alter the direction of travel of the blocks. The blocks always fall from the relative top of the screen to the relative bottom, depending on the pitch and orientation of the tablet.

Swipe down from the top of the bezel.

Clear all blocks from the screen.