How to implement headless app with BlackBerry 10.2 OS

887 views Asked by At

I want to get an idea of how to implement a long running headless application with BlackBerry 10.2 OS. I don't need any complex function to happen in the background. I need only to print a Console out-put.

I have used the QTimer class and at this moment it prints a console out put when the application in foreground and in thumbnail mode.

connect(timer, SIGNAL(timeout()), this, SLOT(update()));

But when I exit from the application, the whole application destroyed. The above code and the update() function is in a separate C++ class that is not interacting with a UI.

I have given following permissions in the bar-descriptor.xml file too.

<permission>run_when_backgrounded</permission>
<permission system="true">_sys_run_headless</permission>
<permission system="true">_sys_headless_nostop</permission>

How to make this app run in background even when the application destroyed?

Thanks

2

There are 2 answers

1
Konrad Lindenbach On

See this: http://developer.blackberry.com/native/documentation/cascades/device_platform/headless_apps/

The long and short of it is that what you're trying to do (have an application run indefinitely) requires analysis and approval by BlackBerry.

If on the other hand, it is acceptable to have your application triggered in response to a system event (e.g. E-mail received) then this is possible.

2
gonztirado On

There is a Push Enabled Headless App Example, in Github Cascades Samples but I couldn't make it works.

On the other hand, there is a pretty Tic-Tac-Toe Headless App Example and it works fine for me:

I just had to add reference the project 'Xandosdroid' to the project 'Xandos'. Before it giving me this error when packaging and deploying 'Xandos' project to the device:

Packaging failed: 1 Error: Invalid asset path "../xandosdroid/arm/o.le-v7-g/xandosdroid"