I'm implementing a BlackBerry 10 Cascade application. It uses a QTimer class and has the following code.
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
This is working and calling to update() function according to the given time period. It works when the application in foreground (application takes the entire screen) and also when the application is running as an active frame (application is in thumbnail state).
I have given following permission also in bar-descriptor.xml.
<permission>run_when_backgrounded</permission>
But when a user press the cross mark (☓) the whole process stop. According to the BB10 Cascade Documentation
When an app has permission to run in the background, there is no Stopped state
What I want to know,
1.) Is there a way that we can programmatically eliminate the cross mark (☓) when it is in active frame ?
If Not
2.) How can I run a QTimer even if the application is stopped? Simply How can I run a background process without a UI when my cascade app is stopped.
3.) Is it enough providing run_when_backgrounded permission in the bar-descriptor.xml to run an application in background?
In the same documentation page under Managing application states, there is invisible()
state. But the example given there cannot implement in a cascade application class which include following
#include <bb/cascades/Application>
Is that only for #include <bb/Application>
?