How to disable WIFI Auto-connect in Android
Asked Answered
M

9

29

Android saves WIFI details into WifiConfiguration class. When WIFI is ON and SSID, Pass-key details matches with WIFI network then Android auto connect with the particular WIFI Network. How to disable that auto-connect feature ? purpose behind asking this question is, I have two configured networks (already saved) and i want to connect WIFI on the button click event, but auto connect feature of android connects with the WIFI itself.

Mixie answered 22/10, 2012 at 12:14 Comment(2)
Sad there isn't an answer to this. This is such an gigantic security vulnerability.Subcritical
Not to mention someone could easily steal all your information with a wifi pinappleSubcritical
T
6

No. You cannot do this. The OS keeps track of the networks which are configured in the device. It tries to find those networks and based on the priority driven method, chooses an appropriate network and connects to it as soon as WiFi is turned on. As Arpit suggested, you can forget those networks and OS will remove it's configuration from memory.

Trout answered 22/10, 2012 at 12:51 Comment(0)
P
1

While native Android does not have this option, the MIUI ROM , does provide it. The ROM has a setting that can toggle auto connection of remembered networks.

The official MIUI ROM is available here and the unofficial international version can be found here.

Protrude answered 1/2, 2017 at 11:28 Comment(0)
I
0

If connection optimizer option does not shown in your phone then go to setting > Location access and disable the wifi and mobile network location or you can try the second method Download the wifi matic application from google play store it will prevent you from automatic wifi turning on.

Immutable answered 9/8, 2016 at 17:21 Comment(0)
G
0

My Samsung S7 can do this since the Android 7 update.

Gallopade answered 22/4, 2017 at 10:57 Comment(0)
C
0
1) Get an instance of class WifiManager by calling Context.getSystemService(Context.WIFI_SERVICE).
2) Enable or disable Wifi using wifimanager.setWifiEnabled(true); and wifimanager.setWifiEnabled(false); respectively.

public void DisableWiFi(){

        wifimanager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
        wifimanager.setWifiEnabled(false);

    }

required permissions

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
 <uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

or

To stop your Android device from auto-connecting to open networks, open the settings and go to Network & Internet > Wi-Fi > Wi-Fi preferences. Tap the button next to Connect to open networks to disable it.

Note :This is confirmed to work in Android 10 Q for Pixel, but might work in older versions of Android, too. If you don't see these specific screens, look through Settings for something like Mobile Networks or Connections.

Coracoid answered 27/3, 2019 at 12:11 Comment(0)
H
0

Since Android 11 each saved WiFi profile has an option to disable connecting automatically.

Hypaesthesia answered 1/8 at 18:27 Comment(0)
H
-3

There's a way for your android to not auto-connect. The trick is to press & hold the connected network to modify it, then enter a hexa password. I.e. a password that is hexa or either characters or 8 numbers long or a combination then save the password.

When you try to re-connect the next time it will say "authentication problem"

Halfon answered 27/8, 2013 at 16:54 Comment(2)
The trick is indeed to press & hold the WiFi network on the list. On a late-model Android a menu will pop up that has the "Manage Network Settings" option, which, when clicked, displays "Auto Reconnect" checkbox along with "Show Advanced Options". Uncheck "Auto Reconnect" and it won't auto reconnect :)Rumanian
On mine the setting isn't in the settings for each access point. Instead there's a separate list of access points specifically to enable/disable auto connect. It's at Settings->WiFi->WiFi Preferences->Advanced->Auto Connect.Nevertheless
B
-4

Go to Menu - Settings - More Settings - Mobile Networks - Connection Optimizer and uncheck Sprint Connection Optimizer.

Brownnose answered 20/6, 2015 at 2:12 Comment(0)
D
-5

You have to do one thing in your device that just go to setting -> network setting -> WiFI and just click on the network listed below and When dialog comes just click on forget.

now you will not be connected to that network automatically.

Delvecchio answered 22/10, 2012 at 12:18 Comment(1)
But then s/he will need to reconfigure it the next time s/he would like to connect to that network.Clayborne

© 2022 - 2024 — McMap. All rights reserved.