0

Does the Android OS manage networks so that it's connected to the most ideal one? I have an app that is hard-coded to connect to a local network that has no internet access but as soon as it connects to the network it then switches back to my home's WiFi (which has internet connection). If I make the OS 'Forget' my home network I don't get this see this issue but that isn't exactly a practical solution.

Tex Mex
  • 1
  • 3
  • Please see this: http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically – iliyaitsme Jul 19 '15 at 09:10
  • UPDATE: I think i figured why this behaviour occurs. When Wi-Fi is enabled the OS will always try and stay connected to the preferred network (chosen in settings). When the app is fired it disconnects from the main network and tries to connect to the hard-coded one HOWEVER once it disconnects the OS kicks in and tries to reconnect to the main network overriding the hardcoded one in the process (maybe because the hardcoded one takes longer to establish connection or something) – Tex Mex Jul 19 '15 at 09:23
  • @ iliyaitsme - That link just shows you how to connect to a network programmatically which I already know how to. My problem is that the OS seems to override my preference and reverts back to the network which has internet connectivity – Tex Mex Jul 19 '15 at 11:05
  • OK so digging a little deeper confirms my suspicions. Android OS will always try to reconnect to the network you chose in settings. Which is retarded if you ask me as you may want an app to connect to a local network for whatever purposes (as i am doing) and that is not possible unless you 'Forget' your current network, which means once you're done with the app you need to go back in settings and connect to the main network by entering the password again. Android is seriously limiting. I mean first no lifecycle activities for stuff like force close and now this? Get your sh*t together google! – Tex Mex Jul 19 '15 at 11:36

0 Answers0