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
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.