Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
jheron
Posts: 188
Registered: ‎01-27-2012
My Device: playbook
Accepted Solution

Any success deploying Qt to OS 2.0 Beta?

[ Edited ]

OOPS! this has not been solved, clicked button by mistake and cant seem to remove solved message....

Hello All,

I am a Qt developer with experience deploying to Symbian and Android.

I am working on a linux box and have successfully built the bb port from git hub and installed the 2.0beta NDK. My buddy has the playbook with OS2.0 on it.

Using the guide for deploying to the 1.0 NDK here http://wiki.qt-project.org/QNX

I have managed to get a simple hello world widget based app compiled and a bar file built utilizing a debug token. The contents of the bar file look proper as does the rest. It deploys to the playbook and the icon displays properly on the desktop.

Once you try to execute it though, a white window appears for a few seconds then just closes...  The log file thats in $ cat /accounts/1000/appdata/<application>/logs/log is completely empty....

Has anyone had any success running Qt apps on OS2.0?

Is there any way to log what might be happening at run time?

Any guidance would be appreciated!

Cheers,

Jon

Contributor
azazello
Posts: 40
Registered: ‎01-15-2012
My Device: Playbook Tablet

Re: Any success deploying Qt to OS 2.0 Beta?

- Qt apps wokrs well on OS2 (btw - binary files identical NDK1/OS1) (Tower of Hanoi in AppWorld is Qt4+QML app sample)

- try to build release configuration - is it work correctly?

/rgds
Andrey Yaromenok aka azazello
New Contributor
macberryman
Posts: 8
Registered: ‎11-12-2011
My Device: playbook

Re: Any success deploying Qt to OS 2.0 Beta?

QT works on 1.0. debug and release both. It took me some effort to get the pieces working.

Suggest first try the app on the simulator rather than the pb dierctly.

 

The following can help your analysis

1. start the app from the command iine to check if there are lib dependency problems. A simple stdout print in main can help with this.

 

2. I found i had to set the following env vars in the bar xml: LD_LIBRARY_PATH, QT_QPA_PLATFORM_PLUGIN_PATH, QT_QPA_FONTDIR

 

3. use blackberry-deploy command's debug option to debug if your app actually starts properly.

 

4. Also check this page (i used this when i tried out qt):

http://hecgeek.blogspot.com/2011/10/qt-for-blackberry-playbook.html

 

Hope this helps!

 

Developer
jheron
Posts: 188
Registered: ‎01-27-2012
My Device: playbook

Re: Any success deploying Qt to OS 2.0 Beta?

Thanks folks!

[quote]- try to build release configuration - is it work correctly?[/quote]

I will look into this, is it possible to test on playbook without submitting it to bb for signing? Do I just need to remove the -devMode switch and the debugToken.bar? Currently I am building from the command line with the Qt code drop from git hub.

I am new to the world of playbook development and blackberry development in general.

 

[quote]2. I found i had to set the following env vars in the bar xml: LD_LIBRARY_PATH, QT_QPA_PLATFORM_PLUGIN_PATH, QT_QPA_FONTDIR[/quote]

I assume you are talking about the blackberry-tablet.xml file here? Can you elaborate on what you set the variables to?

Here is what my current blackberry-tablet.xml file looks like:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
    <id>com.snappyappz.test_bb</id>
    <filename>test</filename>
    <name>test</name>
    <versionNumber>1.0.0</versionNumber>
    <description>Testing....</description>
    <copyright>2011</copyright>

    <initialWindow>
        <systemChrome>none</systemChrome>
        <transparent>false</transparent>
        <autoOrients>true</autoOrients>
        <aspectRatio>landscape</aspectRatio>
    </initialWindow>

    <publisher>snappyappz.com</publisher>
    <permission system="true">run_native</permission>
    <category>core.games</category>
    <icon><image>res/test.png</image></icon>
</qnx>

 

Thanks for the input, I will look into building in release configuration and post back the results.

Cheers,

Jon

 

Developer
jheron
Posts: 188
Registered: ‎01-27-2012
My Device: playbook

Re: Any success deploying Qt to OS 2.0 Beta?

I forgot to mention that the simulator is not an option for me.

The lame solution of using vmPlayer for the sim makes it a non option for me as vmPlayer wont run from my Fedora16 machine...

It seems like a very bad descission to use vmPlayer to host the sim, not only because of compatibility issues but its also a third party paid application for those using mac...

Cheers,

Jon

New Contributor
macberryman
Posts: 8
Registered: ‎11-12-2011
My Device: playbook

Re: Any success deploying Qt to OS 2.0 Beta?

 

I added these to the bar xml just before the end: </qnx> tag

 

    <env var="LD_LIBRARY_PATH" value="app/native/lib/qt4/lib:app/native/lib/qt4/plugins/platforms" />
    <env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/native/lib/qt4/plugins/platforms" />
    <env var="QT_QPA_FONTDIR" value="app/native/lib/qt4/lib/fonts" />

 

If you run from the command line, just to test the lib dependencies work, then these paths must be manually set and then the bin must be run.

 

Yes. dependency on vmware was a pain as i was using mac too. Initially used a 1 month eval version. But if i remember right, the image worked on linux too. dont remember which version of vmware i had used.

 

You dont have to get auth from Blackberry to run your still-in-development debug/release version binaries. Have your debug token installed in playbook(this is what requires signing from BB). After that release/debug, create the bar with -devMode and test away.

The only drawback is the debug token expires after 30days i think. So better to create the private key and use that to sign your app.

This is the reason why a simulator helps a lot. Try to find a sweet spot to get it to work. I had tried with win/lin and mac. Then seeing there were issues(solution from BB in my orig post) with qt/simulator, directly went on to use the playbook.

 

Also suggest stick on to Debug until the app starts up because qt is like a dinosaur..takes ages to compile

 

Contributor
azazello
Posts: 40
Registered: ‎01-15-2012
My Device: Playbook Tablet

Re: Any success deploying Qt to OS 2.0 Beta?

[ Edited ]

simulator on vmware workd well on linux (opensuse 12.1 for me, but it use the same kernel/x11 as your fedora16) - but you need to apply some patches to VmWare drivers(I guess, it's a kernel 3.x related) before install.

did you sign a app with blackberry-signercmd tool before deploy? (without it you will get a error 8 for HelloWorld app (didn't test it on Qt w/o signing - maybe it's just not displayed) - even on simulator)

 

upd: >>Once you try to execute it though, a white window appears for a few seconds then just closes... 

if you will get in Eclipse/Console something like "Failed to load platform plugin "". Available platforms are:
"

add to Run Confuguration> Arguments  "-platform blackberry -platformpluginpath app/native/lib/platforms" (and<asset path="${QNX_TARGET}/../target-override/armle-v7/usr/lib/qt4/plugins/platforms/libblackberry.so" type="Qnx/Elf">lib/platforms/libblackberry.so</asset> should be at assets list in bar-description.xml )

/rgds
Andrey Yaromenok aka azazello
Developer
jheron
Posts: 188
Registered: ‎01-27-2012
My Device: playbook

Re: Any success deploying Qt to OS 2.0 Beta?

Thanks for all the comments!

I borrowed a playbook today and a signed app fires right up! It must have been a problem with the debug token on my buddies playbook? The Qt apps look plain and need some styling but they run smooth, scale nicely and the controls all work well, what a nice surprise!

I have a couple widget based Qt apps I will release to the app store in the next couple of days, then I am going to figure out how to port the Qt qml components over to the playbook and publish a few more! :Clap:

Has anyone done any playing around with the qml components yet? I managed to get a couple qml component apps published to android marketplace using Necessitas. I think the same approach should work with the playbook, will just have to compile the components for the playbook proc....

Cheers,

Jon

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Any success deploying Qt to OS 2.0 Beta?

I would start new thread about Qt/QML for Playbook.

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Any success deploying Qt to OS 2.0 Beta?

Decided to give it a try - Momentics 2.0 beta 3, Simulator 2.0 and I have weird issue with the latest QT library codedrop. Enter key is not recognized any more. When I hit enter nothing happens (both real and virtual keyboards).

If I do not change anything in the envoronment just replace QT libraries deployed to old codedrop libraries Enter starts working again which is telling me that this is not a problem with my code...

Really puzzled...