how to set app background running time in iPhone 4? - iphone

I am developing a navigation app, that needs to run in the background. I want to know how can I set background running time of app? And is this time fix by iOS?

Here you have the UIBackgroundModes
http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html
Scroll down and you will see that you can enable location in your info.plist
Good Luck with that one

Related

How to turn Off iPhone application when enters in background?

I have made an iPhone application.
When my application enters in background.
I want to turn off fully my iPhone application,and when i again start my iPhone application it should starts from the starting page,it should not start from where i left.
I have used exit(0),but i think it is not recommended by Apple.
Please provide some suitable solution soon.
You can achieve it by modifying your info.plist file.
add this Key "Application does not run in background" and set its value to "YES"
This should get you going!
Let me know if it solves:)

IOS Default.png show every time when my app enter foreground from background [duplicate]

This question already has answers here:
Prevent Splash Screen from showing after returning from background
(5 answers)
Closed 5 years ago.
I'm new to IOS development.
I set a Default.png file, and it is shown every time when the app enter foreground from background, but I just want Default.png is shown once when the app launch.
I observed that whenever application is resumed from background, iOS 5.0 simulator showed the default image or launch image, whereas iOS 4.3 simulator showed the screenshot of the application, when it was entering background.
For those seeking answer, it might be a case that your app didn't finish a task you set up to do when it enters background. It will finish it and resume, or if you will wait long enough in background the task will be completed and app will enter foreground as expected.
Go to your Info.plist file in your project and look for this key:
UIApplicationExitsOnSuspend
make sure it is set to FALSE, or, in plist speak, <false/>
And here's a list of keys for UIKit on Apple's site, which includes the one I just referred you to.
The Default.png is only used when your App is launched, not when your App is resumed and put into the foreground. The moments when your app is "foregrounded" iOS will use a screenshot it makes automatically when backgrounding your app as launch image.
If you see Default.png even when you multitask between your App and some other App there is something wrong. Maybe you opted out on the multitasking thing with the UIApplicationExitsOnSuspend key in your plist or your App is crashing when going to the background/using too much memory to be backgrounded.
If you debug your App in XCode it should give you some hints in the console about memory warnings and it's easy to see if your App is killed.
Default.png is also visible in scenario when your app is waiting for a response and you enter back ground, in that case your delegates will also not get called, after you receive response the delegates are called and the default.png is removed.
Kelvin:
I have this problem too,now I had solve it.The reason is you did too much things in applicationDidEnterBackground ,try to decrease .
Your app may have been terminated while it was in the background and is being started from the beginning. That would show the default screen again.

How to disable fast application switching (multitasking) on iOS 4?

In iOS 4, when a user presses the Home button, the running app will save the current state and go to background. However I'm developing an app and I don't want it to go to the background. I want it to kill itself, just like in iOS 3 and before. How can I do it? Thanks.
See "Opting Out of Background Execution" in the iOS Application Programming Guide:
"...you can explicitly opt out of the
background execution model by adding
the UIApplicationExitsOnSuspend key to
your application’s Info.plist file and
setting its value to YES."

Why does my iphone app does not zoom-in every time I launch the app in the application manager?

It's weird that my app does not zoom in when running in the application manager of the iphone like the other apps do. Do you think the problem is related to the simulator? Or have I done something wrong in the settings of the project?
If the background of your window is black, and you have no Default.png image in your bundle, then the zoom effect may be unnoticeable. It's even worse if you don't have a status bar.

Setting iPhone wallpaper (locked screen background) programmatically?

I have an app which could benefit from the user being able to choose to set an image as the wallpaper (the background image on the "slide to unlock" screen).
Is there a way for non-jailbreak third-party apps to do this? A search for "wallpaper" in the iPhone documentation returns nothing.
There is no way to do this with the current SDK, if you want to do it you should file a bug.
If you're writing a jailbreak application you can write to /var/mobile/Library/LockBackground.jpg and then kill the Springboard.