1

Should my Android phone automatically select wi-fi if available, if not then go to the next data service etc. If I use

connectivity.setNetworkPreference(ConnectivityManager.TYPE_WIFI);

will that ensure the same result or confine it to using wi-fi only.

ron
  • 5,219
  • 8
  • 39
  • 44

4 Answers4

1

If the Device is connected to a WIFI network will Android use that because it has 1. priority. And you will almost always prefer using WIFI to your network operations. So you dont really have to worry about this.

Finn Larsen
  • 2,201
  • 17
  • 26
1

Yes. By default android chooses WiFi network and if WiFi network is not available then it switches to mobile carrier network. To implement switch form WiFi to mobile network you can follow my answer over here: How to handle WiFi to Mobile network switch programatically?

Community
  • 1
  • 1
Balaji Khadake
  • 3,449
  • 4
  • 24
  • 38
0

I could see on my different devices (all HTC I have to say), under Android 2.1 and 2.2: when both 3G and Wifi are both enabled and available, the system switches down the 3G to prefer the Wi-fi.

Shlublu
  • 10,917
  • 4
  • 51
  • 70
0

The documentation says "When active, all data traffic will use this connection by default. " Whichever you set as your network preference, that will be made the default connection. The system default must be Wifi itself.

Ron
  • 24,175
  • 8
  • 56
  • 97