Screensaver app restarts every 30 sec | developer.brewmp.com Screensaver app restarts every 30 sec | developer.brewmp.com

Developer

Screensaver app restarts every 30 sec

Forums:

I developed simple screen saver application. During tests I was very surprised by fact that BREW environment restarts my application every 30 seconds or so... I saw the same behaviour on target device and in emulator. IOW the cycles are something like

1) phone is 30 sec in idle state
2) screensaver application is being started, load resources, update screen
3) application works OK about 30 sec
4) application receive EVT_APP_STOP and will shutdown (free resources, etc)
5) the cicle being started again from #2

I not found anything about such behaviour during my search on BREW forums. Is the behaviour described above a intent behaviour by design or I just miss something? If yes (intent behaviour) - I don't see ANY LOGICAL REASON why BREW environment needs to restart screensaver application periodically - can everyone explain this please?

I've never done a screensaver, but I'm just wondering if you're being sent any other events - e.g. EVT_APP_NO_SLEEP or EVT_APP_NO_CLOSE?

I've never done a screensaver, but I'm just wondering if you're being sent any other events - e.g. EVT_APP_NO_SLEEP or EVT_APP_NO_CLOSE?

Just checked this again with emulator - seems like I never got EVT_APP_NO_SLEEP nor EVT_APP_NO_CLOSE for screensaver application.
I must do something wrong, I don't think this is expected OS behaviour.

Just checked this again with emulator - seems like I never got EVT_APP_NO_SLEEP nor EVT_APP_NO_CLOSE for screensaver application.
I must do something wrong, I don't think this is expected OS behaviour.

I was under the impression that if you return false out of the event handler the app won't close... am I totally off base? I don't have time to look it up now, but that was my recollection

I was under the impression that if you return false out of the event handler the app won't close... am I totally off base? I don't have time to look it up now, but that was my recollection

case EVT_BUSY
is not helping as well(!) as BREW posted in thier web site
https://brewx.qualcomm.com/brew/sdk/download.jsp
Also tried checking if app is working through this command
ISHELL_ActiveApplet()
and got 0 instead of the working applet number
The only thing worked is
case EVT_APP_NO_SLEEP:
return true;
you should try it again

case EVT_BUSY
is not helping as well(!) as BREW posted in thier web site
https://brewx.qualcomm.com/brew/sdk/download.jsp
Also tried checking if app is working through this command
ISHELL_ActiveApplet()
and got 0 instead of the working applet number
The only thing worked is
case EVT_APP_NO_SLEEP:
return true;
you should try it again

markdude wrote:
The only thing worked is
case EVT_APP_NO_SLEEP:
return true;
you should try it again
Thanks markdude. But - I think
EVT_APP_NO_SLEEP:
return TRUE
is a really bad solution - phone is not able to go in power-saving mode in this case. With code above my device live arround 1,5 days, without this code - 4 days. The difference is not bad, right?
I have resolved this by other way -
1) Changed my screensaver application to normal application (removed screensaver flag in mif)
2) Created small "controller" application that starts during phone startup procedure. This controller application watch user and phone activity, and if no activity was found for given time period - then conntroller application will launch screensaver application.
This structure works well till now - so my problem is resolved.
But the question is open - I still don't see ANY LOGICAL REASON why BREW environment needs to restart screensaver application periodically
I found other screensaver applications - for example one from SophiaFramework 4.1.7 - the behaviour still the same - BREW environment restart screensaver every 30 sec

markdude wrote:
The only thing worked is
case EVT_APP_NO_SLEEP:
return true;
you should try it again
Thanks markdude. But - I think
EVT_APP_NO_SLEEP:
return TRUE
is a really bad solution - phone is not able to go in power-saving mode in this case. With code above my device live arround 1,5 days, without this code - 4 days. The difference is not bad, right?
I have resolved this by other way -
1) Changed my screensaver application to normal application (removed screensaver flag in mif)
2) Created small "controller" application that starts during phone startup procedure. This controller application watch user and phone activity, and if no activity was found for given time period - then conntroller application will launch screensaver application.
This structure works well till now - so my problem is resolved.
But the question is open - I still don't see ANY LOGICAL REASON why BREW environment needs to restart screensaver application periodically
I found other screensaver applications - for example one from SophiaFramework 4.1.7 - the behaviour still the same - BREW environment restart screensaver every 30 sec