

Stopping background applications on iOS 4 - mickdj
http://whereoscope.wordpress.com/2010/11/25/stopping-background-tasks-on-io/

======
credo
_> >But how do you stop an application from running in the background?

Delete it. Seriously, that’s the only way._

>> _If you hold down the icons until they start to wobble and then tap the red
X, you have terminated that application._ _> >But applications get restarted
when: the phone reboots_

I think this is mistaken.

I haven't verified this in code yet, but my impression is that the app will
not be restarted automatically on a reboot.

After you reboot the phone, you will be able to see previously run apps in
your list of "recently run apps" (by pressing the Home button twice). However,
this doesn't mean that the app has been restarted. You will have to tap the
app-icon to get it to start.

 _[Edit] Thanks for the clarification below about needing to call
startMonitoringSignificantLocationChanges. You may want to add this detail to
the blog post because the current wording suggests that all background apps
get restarted on a reboot._

~~~
mickdj
You have to have asked for the Significant Location Update Service.

I have verified this in code numerous times, and Apple representatives have
confirmed in the development forums.

~~~
saurik
Interesting. I was under the impression that any application marked with the
background type "voip" (such as Skype) was started by SpringBoard when it
launched.

~~~
mickdj
Yes, voip apps can also be relaunched in the background.

The focus of this article was location-based apps, but there are also
interesting behaviors with voip and audio applications.

------
jackowayed
> _Settings- >General->Location Services_

This is one of the reasons I was so glad to ditch my iPhone. They bury shit
that you want to access frequently in Settings.

Want to turn your WiFi on/off? It's 2 or 3 menus deep in settings. Same with
brightness. I change both of those several times a day.

And there's nothing you can do about it unless you jailbreak your phone.

On my HTC Droid Incredible, I have a power control widget that lets me turn on
and off wifi, GPS, and bluetooth, and lets me toggle between 3 brightness
settings. It only takes up 1/4 of a home screen. It's wonderful.

~~~
mickdj
I'm curious about this - I've seen that behavior with Android users as well.

Why specifically do you want to turn WiFi, GPS, and bluetooth on or off? I can
think of several potential reasons, but would like a user's perspective.

~~~
sjs
Sometimes WiFi is flaky and turn it off in favour of 3G (maybe the router
needs a reset, or cable internet is out).

For some unknown reason Scrabble recommends that you turn WiFi off and
BlueTooth on to play multiplayer w/ an iPad as the board. It's an odd request
but I do it anyway.

When I leave the office my iPhone can see the office base station even when
I'm kitty-corner waiting for the bus, but the signal isn't strong enough to
work so I have to turn WiFi off.

In order to check my wireless usage w/ Rogers' iPhone app they require me to
be on 3G. It's lame but that's how they roll so I have to go along with it.

Sometimes once it's off I forget about it because I have a 6G data plan which
I haven't been able to burn up even using Grooveshark for a couple of hours a
day. Then if I want to do something on a LAN at home or work I need to turn
WiFi on.

I leave 3G and BlueTooth on all the time. Some of my friends turn BT off when
they're not using it and I try not to hassle them about it. It doesn't wear
your battery down unless you're using, in my experience anyway. So less savvy
users want to do this kind of thing too, not just us nerds. :)

~~~
mickdj
Thanks for the insight!

------
snprbob86
It's pretty easy to force quit an application on iOS 4:

1) Hold the power button until the power-down slider shows up

2) Hold the home button until the application exists

~~~
clord
3) double-tap home, then hold finger on app you want to terminate. the icons
in the task switcher start to dance. click the terminate button.

~~~
snprbob86
My numbers were steps, not alternatives.

As for your approach: I've seen that fail for locked up apps. I believe that
sends a normal quit signal instead of force terminating the app.

