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

How to buid sign and deploy from the QtSDK

[ Edited ]

I set up Qt creator to build, sign and deploy the bar file to my new playbook (thanks RIM!) over wifi! Pretty slick IMO! :smileyhappy:

There is probably a much better/elegant way to do this as I am just a rookie, however this works great for me!

I am not currently using a debug token as it was giving me some grief, so I sign my packages now which obviously means I have my tablet keys installed. I have development mode enabled on pb and am using its wifi ip.

I am running Fedora16 64bit

I have the latest native tablet SDK installed and the latest OS on my pb.

I have the latest QtSDK installed from http://qt.nokia.com/downloads

I have blackberry.tools.SDK in my /home directory as well as the latest Qt github port (which it sounds like is going to be depreciated soon if its not already).

You can get the blackberry.tools.SDK here under "Command-line tools" https://bdsc.webapps.blackberry.com/android/tool/

These instructions assume you have the same setup.

In Qt creator go to tools->options, then click on Build & Run, then the Qt Versions tab. Click the Add button and browse to your bb Qt port's qmake file (pathToPbQt/bin/qmake)

For the Version name: use "Qt 4.8.0 (qt4) playbook" or what ever you like.

Now you should see your custom Qt version in the list under "Manual". Make sure the qmake path is correct for the playbook Qt /bin dir for qmake (<pathToPbQt/bin>).





These instructions also assume you have made the necessary changes to your pro file and added an appropriate blackberry-tablet.xml as explained here: http://wiki.qt-project.org/QNX

Now open your favorite pb Qt project by clicking the Qt Welcome button on the top left. 

Go to the Projects button (on left of the Qt main screen) under the Build settings you should be able to see your pb version. (It may be labeled Desktop in the floating bar on top, you may need to click the + button to find it too), you can tell if its correct by looking at the Qt Version under the General heading, select Manage if necessary to select your playbook Qt version. I had no success with shadow build so uncheck the box and dont worry about the Tool Chain either.





Now under Build Steps select the Add Build Step button then Make from the drop down menu, go to Details and under Make arguments enter the name of your bar file, it must match the name of the package described in your blackberry-tablet.xml.





Now click the Add Build Step button again only this time select Custom Process Step, click the Enable box and under Command browse to "blackberry.tools.SDK/bin/batchbar-signer"  If it says it cant run the file then you may have to adjust the file permissions so it can be "executed as a program" (with fedora you just right click the file and go to properties->permissions and check the box). 

Then under Command arguments you need to setup the path to your installed keys

<pathToProject> <pathToauthor.p12>

 

, I put my keystore.p12 in the bin folder of the bb tools SDK so my command looks like this:

/home/jon/projects/playBook/E-Calc /home/jon/blackberry.tools.SDK/bin/author.p12 keyPassword





OK, almost done! :smileyvery-happy:

Now click the Add Build Step button one last time and select Custom Process Step again, click the Enable box and under Command browse to "blackberry.tools.SDK/bin/blackberry-deploy"

Then under Command arguments you need to setup the deploy to your pb, the ip can be your pb's wifi (or usb if connected with cable)

-installApp -device <device IP> -package <pathToYourSigned app.bar> -password <pbPassword>





OK, thats it!

Now just click the hammer button and if all went well it should build the bar file and deploy it to your pb! Click the button "(4) Compile Output" at the bottom of the creator screen to see whats going on. If you Dont want to deploy or sign each time just uncheck the "enable custom process step"  box next to the sign and deploy steps.  :smileyhappy:



I hope that these instructions may help those having trouble with Momentics and whom dislike the CLI!

If anybody can offer any advice for a better way to do this please pay it forward!

I hope we have some debugging tools from creator soon...

Well hopefully all of the above is legible!

Good Luck!

Cheers,

Jon









Developer
iravelo
Posts: 61
Registered: ‎06-28-2011
My Device: 9700+PB

Re: How to buid sign and deploy from the QtSDK

images do not print;

could you just use some other image server than this forum's ?

 

---------<={##}=>---------
I.Ravelo; Renault S.A.S. Corporate BBOS Java Apps Lead Conceptor/Coder; Qt learner
Developer
iravelo
Posts: 61
Registered: ‎06-28-2011
My Device: 9700+PB

Re: How to buid sign and deploy from the QtSDK

[ Edited ]

Now images are ok, thanks a lot,
But alas, this great tuto is kinda not very usefull for us not using fedora or linux.
My win qt sdk does not even have qmake for now...

:Oops:

---------<={##}=>---------
I.Ravelo; Renault S.A.S. Corporate BBOS Java Apps Lead Conceptor/Coder; Qt learner
Developer
jheron
Posts: 188
Registered: ‎01-27-2012
My Device: playbook

Re: How to buid sign and deploy from the QtSDK

[ Edited ]

Is anyone else experiencing problems with the pics? The script from this website to load images from my hard drive is not working, so I uploaded the images to mediafire and linked to them...

"But alas, this great tuto is kinda not very usefull for us not using fedora or linux.
My win qt sdk does not even have qmake for now..."

I dont have windows so there is nothing I can do about that.

There is a qmake in your sdk, there should be a few. The qmake you want though is found in your QT bb port...

The configuration of Qt is the same in windows however, the command line tools and commands are likely different than whats used in linux...

Use google, I am sure there must be windows command line tools for the playbook?

Cheers,

Jon

Developer
iravelo
Posts: 61
Registered: ‎06-28-2011
My Device: 9700+PB

Re: How to buid sign and deploy from the QtSDK

[ Edited ]

Jon,

as I am not able to build Qt for BB on windows,

I've deployed a port that was built on linux.

If qmake is an executable to be run on my dev platform then I need a qmake.exe; of course there are no qmake.exe in the port built on linux...

 

Correct me if I'm wrong,

I already have difficulties understanding even what "configure" does....

Tks

 

---------<={##}=>---------
I.Ravelo; Renault S.A.S. Corporate BBOS Java Apps Lead Conceptor/Coder; Qt learner
Developer
jheron
Posts: 188
Registered: ‎01-27-2012
My Device: playbook

Re: How to buid sign and deploy from the QtSDK


iravelo wrote:

Jon,

as I am not able to build Qt for BB on windows,

I've deployed a port that was built on linux.

If qmake is an executable to be run on my dev platform then I need a qmake.exe; of course there are no qmake.exe in the port built on linux...

 

Correct me if I'm wrong,

I already have difficulties understanding even what "configure" does....

Tks

 


Yes, it will need to be an exe for windows. As explained by BGmot in the other thread though, any qmake should work, so just copy a qmake.exe into the bin folder on the bb Qt port and give that a whirl. I am not an expert in qmake, or in anything programming related for that matter (I am an electrician by trade) so your mileage with my advice may vary! :smileyhappy: I am simply posting what has worked for me.

Here is the manual for qmake: http://qt-project.org/doc/qt-4.8/qmake-manual.html

Good luck!

Jon

Developer
iravelo
Posts: 61
Registered: ‎06-28-2011
My Device: 9700+PB

Re: How to buid sign and deploy from the QtSDK

Ok. Jon,

Will try that :

Copy a qmake from elsewhere to the qt port folder imported from linux...

Tks

 

---------<={##}=>---------
I.Ravelo; Renault S.A.S. Corporate BBOS Java Apps Lead Conceptor/Coder; Qt learner
Contributor
jsprenger
Posts: 12
Registered: ‎03-12-2012
My Device: playbook

Re: How to buid sign and deploy from the QtSDK

Jon,

 

I've got Qt Creator IDE running and working on Linux. And I've gotten the helloworld (HEC Geek) app also built, installed and working on my tablet.

 

But when I build and deploy my simple working app to the pb, it installs correctly with splashscreen and icon, but immediately exits right after I run it on the pb. Something's missing, but I get no error messages on the PB. The app uses some simple widgets with stylesheet properties. I'm using a debug token, and that seems to work fine for the helloworld app.

 

Have you, perhaps, run into this problem with the apps that you've developed?

 

Here are the contents of my blackberry-tablet.xml file.

 

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
    <id>org.demo.someapp</id>
    <filename>SomeMobileApp</filename>
    <name>Qt Button Example</name>
    <versionNumber>1.0.0</versionNumber>
    <description>Some Mobile Qt App</description>
    <copyright>jsprenger</copyright>

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

    <publisher>myapps.com</publisher>
    <permission system="true">run_native</permission>
    <category>core.games</category>
    <icon><image>res/icon.png</image></icon>
    <splashscreen>res/splashscreen.png</splashscreen>
    <env var="QT_DEBUG_PLUGINS" value="1" />
    <env var="LD_LIBRARY_PATH" value="app/native/lib" />
    <env var="QT_QPA_FONTDIR" value="/usr/fonts/font_repository/liberation" />
    <env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/lib/platforms" />
</qnx>

 

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

Re: How to buid sign and deploy from the QtSDK

I had the same thing happen to me in the beginning. I tried signing the package instead and the problem went away. I suspect it was something to do with the debug token on the pb I borrowed...
I didn't spend any time looking into it though as it worked fine for me once I signed the bar.
Good luck
Jon
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: How to buid sign and deploy from the QtSDK

you should have somethng in log saying why it fails.