How does the iPhone handle connection priority?
Suppose I'm in the range of a wifi network and I check my email on my iPhone.
Will it try to use the wifi network first and only if that fails attempt to connect to 3G? Or will it always use 3G (with the charges that carries) regardless of other mediums?
Is it automatic? Do I have to manually disable 3G connection if I want it to use wifi?
Solution 1:
The iPhone will always try to connect to the wifi if it is in range. If it already knows how to connect it will do so automatically. If it does not know it will notify you that there are wifi networks available.
But to come back to the situation you described:
If it is already connected to the wifi it will use that for all data even if it is also connected to a 3G network.
Solution 2:
Wifi is always preferred over radio (3G/EDGE/GPRS) so if you want to force cellular data, you have to turn off wifi or un-join whatever networks are in range and/or disable auto-join. There is no failover, so if you get connected to a wifi that has no route to the Internet, the phone won't figure that out and use the cell data. You have to manually get off that wifi before the data will flow over the cellular network..
I often turn off WiFi when I know 3G is faster than certain busy times at coffee shops or when my home ISP is overloaded.
When traveling I've heard anecdotes that even with a wifi connection, some data was billable over cell connection as a roaming charge but can't say if that is still true or was a bug or was user error. Use the switch to disable data roaming if you want to be totally sure only wifi is used.