How to handle multi tasking on iPhone 4 etc?
by Warthog · in iTorque 2D · 11/29/2010 (2:43 pm) · 7 replies
Hi all,
I have been developing to an iPhone 3G and since it doesn't allow multi tasking of apps I had no idea that my app is messed up on the newer phones. I borrowed an iPhone 4 and found that when that pressing the main button doesn't quit an app. The problem I'm having is that when someone brings my app back to the front after doing this, the app is not working.
Is there a procedure for handling this? In the script, what should I be doing to suspend and resume the app?
Thanks.
I have been developing to an iPhone 3G and since it doesn't allow multi tasking of apps I had no idea that my app is messed up on the newer phones. I borrowed an iPhone 4 and found that when that pressing the main button doesn't quit an app. The problem I'm having is that when someone brings my app back to the front after doing this, the app is not working.
Is there a procedure for handling this? In the script, what should I be doing to suspend and resume the app?
Thanks.
#3
One thing I don't understand is, on old iDevices the home button quits the game. On the new devices the home button simply moves the app to the background. When you quit an app that is in the background, does anything get sent to the app so it can do things like saving the game, and can it do that while it is in the background state.
Do I need to add a quit button now?
12/01/2010 (1:14 am)
So does that take care of everything and I don't need to add anything in script? Cool!One thing I don't understand is, on old iDevices the home button quits the game. On the new devices the home button simply moves the app to the background. When you quit an app that is in the background, does anything get sent to the app so it can do things like saving the game, and can it do that while it is in the background state.
Do I need to add a quit button now?
#4
Note that the linked implementation calls some script functions, oniPhoneResignActive() etc. That is where you put your save calls.
12/01/2010 (10:27 pm)
Backgrounding simply means "prepare to quit anyway, but store state". The OS handles quitting for you.Note that the linked implementation calls some script functions, oniPhoneResignActive() etc. That is where you put your save calls.
#5
Any idea if Robert's Implementation will work in iTGB 1.2? I have an old game that I really should fix too, but I can't update to 1.4 because of the writing to disk bugs in 1.4.
Easy fix in the two upcoming games though.
Thanks to everyone for the help!
12/02/2010 (12:34 am)
Thanks, seems simple enough, after adding Robert's Implementation, I would need to execute my save game code from oniPhoneResignActive() just incase they quit rather than return my game to the foreground? Cool, easy. Any idea if Robert's Implementation will work in iTGB 1.2? I have an old game that I really should fix too, but I can't update to 1.4 because of the writing to disk bugs in 1.4.
Easy fix in the two upcoming games though.
Thanks to everyone for the help!
#6
12/02/2010 (3:09 am)
looking forward to what you create :)
#7
12/02/2010 (8:15 am)
I think it should be easy enough to make it work in iT2D 1.2, if you have that engine already compiling against the 4.x SDKs.
Torque Owner Warthog
Crude Games, LLC
I did discover though that when the user brings my app back to the foreground it does restart the app.
How should this whole multitasking thing be handled in iTGB?
Anyone?