Managing application switching? (iOS)

Hi everybody,

I'm doing some device testing and I have encountered a slight snag. Does anybody know how iOS interprets a 4-finger "application switch" in regards to Corona? Is this considered an EXIT from the application?

Right now, I am using "applicationSuspend" in the system events API to pause my game (i.e. user receives a phone call, game pauses). This works perfectly well, tested and true! But when I switch to another application (think ALT-TAB or Command-Tab on a computer), this "restarts" my game.

So, is this normal? Does an application switch basically constitute an application exit? If so, is there any realistic way to save the current game status in Corona, i.e. pause it using my functioning pause routine AND keep it running in background memory so the user can return to it later? Or, by basic design of mobile devices, is this considered an "application exit" and automatic restart of the game?

Hope this description makes sense... any insight is appreciated!

Brent Sorrentino
Ignis Design

> If so, is there any realistic way to save the current game status
> in Corona, i.e. pause it using my functioning pause routine AND
> keep it running in background memory so the user can return to
> it later? Or, by basic design of mobile devices, is this
> considered an "application exit" and automatic restart of the game?

It's worth noting that an application exit does not have to result in an automatic restart of the game. Just add the following in your build.settings file:

1
2
3
4
5
6
7
8
9
10
settings =  {
    [...snip...]
 
    iphone = {
        plist = {
            UIApplicationExitsOnSuspend = false,        
        },
    },
 
}

what is a 4 finger application switch? Its hard for me to get 4 fingers on the phone at once.

Hi Rob,

These 4-finger "switches" are far more useful on the big iPad screen, but apparently they also work on iPhone (and maybe iPod Touch, but I can't vouch for that). You might also need to enable them in your phone settings.

A 4-finger slide to the left or right should switch between apps (as in Command-TAB). A 4-finger slide UP should display a little taskbar of recently opened apps on the bottom of the screen (while pausing the app you're currently using), allowing another way to switch back and forth.

But as you say, it's hard to get 4 fingers on the phone, so how "useful" this entire thing is, well that's questionable. I wish they'd do make these actions accessible with 3 fingers instead of 4, but apparently 3 fingers is used for something else like scrolling around within an app. I'm actually unclear on alot of this... it would be great in a future version of iOS if they let you customize exactly what gestures and what motions you wanted to use (and how) for your own device.

Anyway, here's a video...

http://www.engadget.com/2011/01/20/ios-4-3-beta-mulitasking-gestures-demonstrated-on-iphone-look-l/

Brent

views:1309 update:2011/9/29 9:22:17
corona forums © 2003-2011