iOS platform: Running application on background - iphone

am new to the ios application development.
I had developed an application on iOS platform using 4.3 SDK.
When it runs on simulator or a device, if we are trying to press on the application icon again after quit the application at run time, the application is again starts its execution from the begining, not from the previous stage it has stopped.
By going throgh the documentation i came to know the multitasking facility is inbuilt for an iOS application.
Or we need to do any coding for implementing this multitasking facility.? Experts please help.
Thanks in advance.

Basically you should be able to go background and then foreground when using the simulator. remember that when running on simulator the GDB debugger is attached to the process thus you cannot terminate the app and start again but you can go background and start again. I think there is a good chance you are crashing and that's why the app starts again. Try to implement the app delegate methods "didResignActive" and "didBecomeActive" and make sure you manage the saving of the state correctly there...

Related

Are background mode location and fetch called even after the device restarted in iOS7?

I'm writing an application that uses the fetch and location background mode. I'm interested in knowing if these two event they can start the application even after a reboot in iOS7 and iOS6.
I'm going to answer myself (don't know if it could be useful to someone else), but please correct me if I say wrong. After several tests I've seen that on iOS7, even after a reboot the events are called (like if no reboot happened). On iOS6 this not happens.
The location background mode can restart the app in iOS 6 and iOS 7. In iOS 7 this will work unless the user force quit the app.
The fetch mode will only work for iOS 7. It isn't supported in iOS 6.

IPhone - Application behaving differently after some time in background

I would like you to help me here.
I'm developing an app that works in the background. It's a location-based app and I think I'm going crazy because when I'm debugging the app in the device it works perfectly, I make it sleep I wake it up and I works as expected. Then I unplug the device from the computer and I put in my pocket and whenever I open it, it sometimes works and other it doesn't, I'm talking about several hours in the background.
Are there any known issues about this? My device is running iOS 5.0 and I'm developing for iOS 4.0
Thanks
Applications in the background are handled by iOS. Therefore if iOS "thinks" that it needs memory it maybe frees some of the memory your app needs to run.
Have you tried to look into it with Instruments?

Make a call from iPhone application without quitting

Is it possible to make a call from application with out quitting application in iOS 4?
You will have to have your application remember its state. That way it can be resumed when launched again. Even with the new multitasking your suspended apps may be forcibly quit if the device needs more memory.
Apple has a guide named "Supporting Multitasking In Your Applications" which you should be able to locate.
Related SO: Does iOS 4 make “Real Multitasking” available to 3rd party developers?
However, you may not replicate core OS functionality so this is the only way to get what you want.

Persistence unnecessary in iOS 4.0?

I noticed that when the home button is pressed on the iPhone simulator to exit an app and then the app is re-entered it starts off right where it left off. Does this mean that programming persistence is no longer necessary? What if the user presses the power button on their ipod touch?
There are still several cases to mention, which should make it clear that persistence is still necessary!
The Target Device doesn't run iOS4
The Target Device runs iOS 4 but doesn't support Multitasking (like the iPhone 3G)
iOS terminates your background app when it's running out of memory
The App crashes
The Target device reboots
The User manually terminate your app via the "Task Manager"
I'm not fluent with the details, but my understanding is that the application is put to sleep. Just like closing the lib on a Macbook. Persistence is definitely required because your data is not preserved and therefore a power off or application kill will loose it.
If you double click the home button you can see the current app running in background, here you can close an app.
Hower there are some device that can't support multitasking: iPhone 3g and early iPod touch.
Last but not least don't forget that there are a lot of device that still have 3.x iOS version.

Does anyone experiencing freezing during iPhone app launching or closing?

App freezes, and the device freezes sometime during launching or closing. This happens especially to the app developed and installed using Xcode. Can anyone explain what's going on, if it's iOS 4 Gold Beta specific issue, or a generic task must be handled by a developer?
Use the Debugger, Console and NSLog() statements to track the progress of your application throughout its life. This will help you track the bug in your application.