Opinions expressed are solely my own and do not express the views or opinions of my employer.

Friday, June 15, 2012

HowTo: Use BlackBerry 10 Cascades UI framework on PlayBook

Research in Motion published the SDK for their future operating system BlackBerry 10 a little over a month ago. This new OS features a great new look called Cascades, the new user interface framework BB10 will use.
This new UI framework looks really great and fortunately RIM also announced that the BlackBerry PlayBook will also be updated to BB10. Unfortunately did they also announce that this update will become available for the PlayBook sometime after the launch of the first BB10 devices. Personally I'm hoping that this won't be true and the update will be released simultaneously or at least only as little as one week later.
Now people are expecting RIM to release the first BB10 devices later this year, most likely in autumn. That a pretty long time to wait for such an update – especially for developers who want to release an updated version of their with this launch. I guess RIM will be smart enough to provide us developers with a beta update and SDK but that could also take a while.
This is why I searched the internet for some useful port of Cascades for the PlayBook and I was lucky. Some people also can't wait to see Cascades apps on the PlayBook and posted something like a guide on CrackBerry. Unfortunately this guide is not working any more so I had to try another approach.

Enough talk! Here's how you get the Cascades UI framework to run on the PlayBook.

At first you have to setup your BB10 dev environment. I'm not going to tell you how to do it but point you to the download instead.
After you installed everything, open the BlackBerry Native SDK IDE (QNX Momentics IDE) and create a new BB10 Cascades app. I prefere using a declarative approach to develop the UI so I chose to use QML.
Next, create a lib directory in you project (same hierarchy as src directory and bar-descriptor.xml) and add it as an asset to the bar-descriptor.xml:
<asset path="lib">lib</asset>
Next, locate your BB10 SDK install directory and open target/qnx6/armle-v7/usr/lib/qt4/lib (this only works if you're testing the app on an actual PlayBook device; for the simulator you have to use the libs in the x86 folder). From this directory copy all shared library files with the extension .so.4 to the lib directory in you project. Now do the same with the shared libraries libQtCascades.so and libbb.so.0 which are located in target/qnx6/armle-v7/usr/lib.
Now only one library is missing: libheimdall.so. You won't find this file included in the BB10 SDK but you need it in order to get the BB10 app running on a PlayBook. Fortunately I found this file online and you can download it from this post on Crackberry (you can safely ignore the build instructions in the post). It's included in the bar archive. Just unpack it, open the native/lib directory and copy it to you project's lib directory. All the other libraries will also be in this bar but they wouldn't work on my PlayBook.
Before you can build it you have to change the platformVersion in your bar-descriptor.xml to (or whatever the rich editor in the IDE will allow you to select).

That was it. Try some sample app provided by RIM or develop you own app, build it and launch it using you BlackBerry PlayBook. It won't look that good because Cascade seems to be optimized for the DevAlpha device but at least we know that Cascades will work on the PlayBook ;)
Here are also two screenshots of the Cascades Cookbook app running on my PlayBook. As you can see, the font and especially the ActionBar is too big and when clicking on labels I encountered the problem that the keyboard pops up.

Hope you enjoyed this quick how to and let's hope RIM will soon provide us with a beta of this awesome Cascades framework for the PlayBook!