Creating PlayBook apps with Flex and QNX UI Components

I got some requests about how to use both Flex and QNX UI components for building PlayBook apps. In this post I will show you how to do it.

Here are the basic steps.

1. Create a Flex mobile project. Make sure that you enable the project for BlackBerry Tablet OS development.

2. Edit project properties to include the QNX libraries in the project build path (right-click on the project name > Properties). Select BlackBerry Tablet OS section and then select the Include BlackBerry Tablet OS Libraries in Build Path option.

Once you apply these changes your project should be ready for QNX components. Of course you have to add QNX components using ActionScript code; you can’t use QNX components as MXML tags.

You have to remember that the QNX UI components don’t inherit or extend the Flex base UI components. And because of this you can’t add them, for example, directly to a View Flex class using view.addElement(QNX-UI-component); instead you can use an instance of Flex UIComponent as a wrapper. Here is a code snippet that illustrates this technique:

Here is screencast that walks you through the setup and shows a sample app:

Download

You can download the project code from here.

4 thoughts on “Creating PlayBook apps with Flex and QNX UI Components

  1. I am not able to run above code on my flash builder.
    I am getting below error:

    Description Resource Path Location Type
    1067: Implicit coercion of a value of type spark.events:ViewNavigatorEvent to an unrelated type mx.events:FlexEvent. sandeepHomeView.mxml /sandeep/src/views line 4 Flex Problem

    Please suggest me. What i need to do to fix that issue.

    Thanks
    Brij Kishor

  2. Just change the event type of the listener. Something like this:

    private function viewActivateHandler(event:Event):void {

  3. I have been looking for hours for this solution. With your solution it was so easy to integrate qnx in flex mobile projects. Great thanks for tutorial. Now it will be cooler to generate date picker with flex mobile for blackberry.

    Thanks also from Europe:)

  4. Thank you for the answer to Brij’s question as well Mihai! Was running into the exact same problem and was driving me nuts! It had been working prior to software reinstallation then it stopped. :(
    Now I can work on my apps again instead of configurations. :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>