Suspend / Resume

Anyone knows how to test suspend / resume using the Nokia 7210 and other emulators?

Thanks…

If you mean pausing a MIDlet, as in pauseApp and resumeRequest, you need to know that Nokia’s phones never use them. I.e. pauseApp will never get called, and (presumably) resumeRequest does nothing.

In Series 40 phones (e.g. 7210), MIDlets are paused and resumed simply by suspending and resuming the whole MIDP JVM, so all that will happen is that the system clock will appear to jump forward when the MIDlet is resumed. Typically the MIDlet/JVM will have been suspended because something else is using the screen, so at least MIDlets using Canvas can detect this by overriding showNotify.

In Series 60 phones (e.g. 6600), MIDlets aren’t paused even if some other application takes over the screen - Symbian OS is a multi-tasking OS, so the MIDlet gets to keep running. MIDlets using Canvas or GameCanvas can detect this by overriding hideNotify and showNotify, and all MIDlets can detect this by periodically calling method isShown on their current displayable.

hi! at 7210 emulator u can test it pressing any number key (of keyborard) during the game. A screen call will appear and then delete de number and it will back to the game.

That’s some cool information… :smiley:

Thanks…
;D

[quote]If you mean pausing a MIDlet, as in pauseApp and resumeRequest, you need to know that Nokia’s phones never use them. I.e. pauseApp will never get called, and (presumably) resumeRequest does nothing.

In Series 40 phones (e.g. 7210), MIDlets are paused and resumed simply by suspending and resuming the whole MIDP JVM, so all that will happen is that the system clock will appear to jump forward when the MIDlet is resumed. Typically the MIDlet/JVM will have been suspended because something else is using the screen, so at least MIDlets using Canvas can detect this by overriding showNotify.

In Series 60 phones (e.g. 6600), MIDlets aren’t paused even if some other application takes over the screen - Symbian OS is a multi-tasking OS, so the MIDlet gets to keep running. MIDlets using Canvas or GameCanvas can detect this by overriding hideNotify and showNotify, and all MIDlets can detect this by periodically calling method isShown on their current displayable.
[/quote]

It did not work…The keys 2/4/5/6/8 are mapped to arrow keys too…

Could you clarify?

I am running 7210 and I hit all kinds of keys without success…

Thanks…

[quote]hi! at 7210 emulator u can test it pressing any number key (of keyborard) during the game. A screen call will appear and then delete de number and it will back to the game.
[/quote]

Btw, I noticed that on a real series40, while playing my game, if there is an incoming call, there is an alert to show information about the call, then the game resumed like nothing happened and one can still continue to talk and play at the same time… ???

Kind of strange…

Is there a way to detect that there was an incoming call? Ie. I need to cleanup some resources like closing down the HTTP connections, timers and such…

Thanks…

[quote]If you mean pausing a MIDlet, as in pauseApp and resumeRequest, you need to know that Nokia’s phones never use them. I.e. pauseApp will never get called, and (presumably) resumeRequest does nothing.

In Series 40 phones (e.g. 7210), MIDlets are paused and resumed simply by suspending and resuming the whole MIDP JVM, so all that will happen is that the system clock will appear to jump forward when the MIDlet is resumed. Typically the MIDlet/JVM will have been suspended because something else is using the screen, so at least MIDlets using Canvas can detect this by overriding showNotify.

In Series 60 phones (e.g. 6600), MIDlets aren’t paused even if some other application takes over the screen - Symbian OS is a multi-tasking OS, so the MIDlet gets to keep running. MIDlets using Canvas or GameCanvas can detect this by overriding hideNotify and showNotify, and all MIDlets can detect this by periodically calling method isShown on their current displayable.
[/quote]

When the “Incoming call” alert shows up the hideNotify() method of the current canvas is displayed. That’s how you catch it.

shmoove

Sorry for bugging you again, but after the initinal alert/hideNotify(), the phone resumes the game…while the call is still going on…

In other words, my feeling is that there is no reliable way to pause the app upon a call and resume if and only if the call has ended using system events ONLY.

My strategy has been to pause the app and resume based on user action explicitly…

Does that sound right? ???

Thanks,

[quote]When the “Incoming call” alert shows up the hideNotify() method of the current canvas is displayed. That’s how you catch it.

shmoove
[/quote]

Exactly. hideNotify() puts the game in “Paused, press some key to continue”-type mode. You don’t unpause it yourself, but let the user take care of that when he’s done with the call. If you check out almost any of the popular games, you’ll see that’s what they all do.

shmoove

[quote]It did not work…The keys 2/4/5/6/8 are mapped to arrow keys too…

Could you clarify?

I am running 7210 and I hit all kinds of keys without success…

Thanks…
[/quote]
If u press directly in the emulator with the mouse or a number of the numeric keyboard it will no work, only work pressing a number of the alphanumeric keyboard.
At least it work in Nokia 7210 MIDP SDK v1.0

The key “W” and some of the numbers at the top of the keyboard work!!!

;D

Thanks…