Where are methods responsible for showing WiFi networks' options?

55 views Asked by At

I'm going to create xposed module that will add one option to the window which appears when user clicks/holds one of WiFi networks. The dialog box where are located options like "connect", "modify", "cancel".

Where do I find these methods?

1

There are 1 answers

1
Sahil Bahl On
public void connectTowifi() 
    {
        String ssid = ""// ssid of clicked network
        String pass = "" // pass of clicked network 
        WifiConfiguration wifiConfig = new WifiConfiguration();
        wifiConfig.SSID = "\"" ssid +"\"";
        wifiConfig.preSharedKey  = "\"" + OfflineUtils.generatePassword(ssid)  +  "\"";
        wifiManager.addNetwork(wifiConfig);
        List<WifiConfiguration> list = wifiManager.getConfiguredNetworks();
        for( WifiConfiguration wifiConfiguration : list ) 
        {
            if(wifiConfiguration!=null && wifiConfiguration.SSID != null && wifiConfiguration.SSID.equals(wifiConfig.SSID)) 
            {
                wifiManager.disconnect();
                wifiManager.enableNetwork(wifiConfiguration.networkId, true);
                wifiManager.reconnect();               
            }
        }

    }

Similarly for diabling network use http://developer.android.com/reference/android/net/wifi/WifiManager.html#disableNetwork(int) for forgetiing network http://developer.android.com/reference/android/net/wifi/WifiManager.html#removeNetwork(int) for disconnect connection: http://developer.android.com/reference/android/net/wifi/WifiManager.html#disconnect()

For updating netwrok http://developer.android.com/reference/android/net/wifi/WifiManager.html#updateNetwork(android.net.wifi.WifiConfiguration)

For all other methods refer to http://developer.android.com/reference/android/net/wifi/WifiManager.html