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 2.0.0.7971 (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!

Labels: , , , , , , ,

10 Comments:

At June 26, 2012 at 5:37 AM , Blogger Doctoru said...

My test Hello Cascades app installs on the PB, launches (the background with the BlackBerry text is shown), and after a few seconds it quits.

 
At June 26, 2012 at 2:48 PM , Blogger Dustin Steiner said...

Please check the output in your Momentics IDE. It should tell you why it crashed. For further help please consider using this thread in the official BB10 Cascades forum - it's easier for me (and other developers) to help: http://supportforums.blackberry.com/t5/Native-Development/Cascades-only-for-BB10-and-not-for-Playbook/td-p/1695309
But I don't guarantee that you will receive help - it's just for testing purposes so don't expect anything to work ;)

 
At January 8, 2013 at 1:53 AM , Anonymous Anonymous said...

I guess this no longer works?
I tried this but the cascades lib files mentioned above no longer exist in the ndk...
Cheers,
Jon

 
At January 8, 2013 at 9:10 AM , Blogger Dustin Steiner said...

Sorry, the next beta removed the possibility of this and I didn't have time to check out a new "solution". Now that BB10 is almost ready, I doubt (or HOPE!!!) that it will take long until an update will be released for the PlayBook :)

 
At January 11, 2013 at 4:43 PM , Anonymous Joy said...

i am a beginner to blackberry app dev .. i am having problem with UI designing .. I am not able to click on the Design mode .. its grayed out.. pls help

 
At January 13, 2013 at 10:18 AM , Blogger Dustin Steiner said...

Please check the BlackBerry developer forums for that.

 
At February 8, 2013 at 5:07 PM , Anonymous jeroen said...

if the Design mode is grayed out, than your graphics card doesnt support OpenGL 2.0

 
At February 8, 2013 at 9:06 PM , Blogger Dustin Steiner said...

After also encountering the problem I can tell you some possible problems: you're using a wrong version of Java (the designer mode only supports Java 32-bit) or as jeroen mentioned, the graphics card isn't supported.

 
At February 8, 2013 at 10:25 PM , Blogger jeroen kemna said...

this method no longer works ? i only can select 10.0.9.xxx as platform version. when i change it to 2.1.0.1314 i get a 821 error when i try to install the app.

also, after i've added all the lib files, how do i have to repackage the app ? in QNX Momentics IDE ?

 
At February 10, 2013 at 9:21 PM , Blogger Dustin Steiner said...

No, this doesn't work anymore, but BlackBerry already announced that in 3-4 months they will officially release BB10 for the PlayBook ;)

 

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home