📜 ⬆️ ⬇️

How to quickly start developing on Qt / QML for the BlackBerry PlayBook and make everyone jealous

The BlackBerry PlayBook is becoming an increasingly attractive platform for Qt developers. Everything goes to the fact that Qt will be included in the standard set of tablet libraries. Due to this, the PlayBook platform (and the BlackBerry 10 platform after it) is of interest to Qt-developers. So in this little note I’d like to tell you how you can start developing Qt for the BlackBerry PlayBook right now. The process of setting up a development environment from zero to the state where you can start writing applications will be described. In fact, I have been asked similar questions several times, which prompted me to write this publication.

In order to start developing Qt for the PlayBook, we will do the following steps together:In order not to overload the publication with all the details and nuances, I will not tell everything in detail, and sometimes I will refer to documentation and other resources.

Since I am developing in a Linux environment, I will describe everything with reference to it. But in a similar or similar way, you can develop in Windows and Mac OS X. Native SDK development tools (NDK) are available for all three systems. If you have any difficulties, you can consult on the developer forum ( English + Russian ).
')

Installing the Native SDK


Before we proceed directly to installing NDK, it is worth explaining the situation with the versions of the PlayBook OS. At the moment, officially released version of the BlackBerry PlayBook OS 2.0 , but the Native SDK 2.0 development tools are still available as a beta version. But do not be afraid of the beta version, I think that the release will appear soon. Perhaps when you read this, NDK 2.0 will be released.

Download the Native SDK 2.0 and the simulator for your operating system by clicking on the link . There is nothing complicated in the NDK installation, you only need to select the directory where to install. The Native SDK is a QNX Momentics (i.e. based on Eclipse ) supplemented with BlackBerry tools. Simulator is a virtual machine image for VMWare.

Getting the keys and everything necessary for signing applications


First you need to get the keys. To do this, click on the link and fill out the form. Make sure you select the keys for the PlayBook in the "Select a Key" field. After some time you will receive the keys to the specified e-mail address. Save them in the ~ / .rim directory (for Linux).

After the keys are received, you must register them. Run the following commands:

$ /path/to/ndk/bbndk-env.sh $ blackberry-signer -register -storepass <> -csjpin <PIN> client-RDK-<XXXXX>.csj client-PBDT-<XXXX>.csj 

Here < password > is the password you chose; and < PIN > is the tablet PIN that you provided in the key request form.

You can also make a debug key (debug token) and install it on the PlayBook (for a simulator this is not required). However, if we are going to work in the IDE, the development environment itself will inform you that a key is required, will help to generate and install it on the device. If you're wondering how this can be done using command line utilities, then read the Getting Started with Qt on Blackberry manual.

Build Qt for PlayBook


The Qt libraries are not included in the standard set of components of the PlayBook firmware, let's hope that this will be fixed soon, because Work is underway to transfer Qt for the PlayBook from GitHub to the main Qt repository . In the meantime, we need to independently download the Qt source code, compile it for the PlayBook and install it on the instrumental system.

Download the qt-qnx-preview.tar.gz archive from GitHub , unpack and run the following commands:

 $ /path/to/ndk/bbndk-env.sh $ ./configure-qnx 

Do not hesitate to look inside the configure-qnx script . There you can add the Qt build options you need. Personally, I changed the script a bit so that Qt is installed not into the current directory, but into the target directory in NDK:

 #!/bin/sh ./configure -opensource -confirm-license -qpa -shared -release \ -xplatform unsupported/blackberry-armv7le-qcc -little-endian -arch arm \ -iconv -largefile -nomake examples -xmlpatterns -no-webkit -no-neon -no-rpath -opengl es2 \ -prefix-install -prefix ${QNX_TARGET}/../target-override/armle-v7/usr/lib/qt4 \ -headerdir ${QNX_TARGET}/../target-override/usr/include/qt4 

Now you can do it with a clear conscience:

 $ make -j12 $ make install 

That's all. Perhaps more on the Qt build theme for the PlayBook will not be distributed. For a quick start, the story will suffice.

Setting up a project in the NDK for a Qt application


Launch NDK for BlackBerry and create a project for the BlackBerry Tablet OS C / C ++ Project.
BlackBerry Tablet OS C/C++  Native SDK
Specify the paths to the header files of the modules to be used. For example, QtGui and QtDeclarative:

BlackBerry Native SDK:     Qt

Select QCC Linker -> Libraries, in the Library Paths list, add the path to the Qt libraries and the libraries themselves to the Libraries list:

BlackBerry Native SDK:    Qt

Open the bar-descriptor.xml file and in the Assets column add links to the Qt modules that the application will use:

BlackBerry Native SDK:  Qt

Basically, that's all. Now you can develop an application on Qt or QML, check its work in the simulator or on the PlayBook, create signed BAR-files and place them in App World. An example of the QML application compiled for the PlayBook can be found here .

Another feature that can save your time. Do not forget to insert the first line in the main () function of your program:

  QCoreApplication::addLibraryPath("app/native/lib"); 

This specifies the path by which the application will search for Qt libraries.

Instead of conclusion


The PlayBook platform presents great opportunities for developers and, ultimately, for users. The platform is based on the QNX RTOS , which provides POSIX support, and the Native SDK development tools allow you to not only develop virtually anything, but also use previously developed libraries or open source libraries . An example is DjView , a DjVu viewer compiled for the PlayBook.

DjView  BlackBerry PlayBook

The article did not describe all the features and features of Qt development for the PlayBook. For example, I didn’t talk about the QNX plugin for Qt Creator, which is available on GitHub . Also recommend trying. It is reported that the plugin will be included in version 2.5.

If you are interested in QNX technologies, including the use of Qt on QNX and PlayBook, then do not forget to attend the XII international conference “QNX-Russia 2012” . Information on the conference and materials from previous conferences are available on the site qnx-russia.ru . Get information about the reports of specialists of SVD Embedded Systems and suggest topics for reports and workshops on the SVD AF forum .

Source: https://habr.com/ru/post/138379/


All Articles