Block a site in android using a Wi-Fi SSID

How can I block a website in android that is controlled by a blacklist widi SSID, I mean, when I block facebook for the specified SSID, then it should block facebook only for that SSID.

My requirement is to block the website using the SSID filter for various Wi-Fi. for example, if a person in the office needs to block entertainment sites, but when it comes to another ssid that already has a blacklist for websites, he should block these sites.

+3
source share
1 answer
List<WifiConfiguration> configuredNetworks = wifiManager.getConfiguredNetworks(); 
if(configuredNetworks != null)
{ 
    for(WifiConfiguration wifiConfiguration : configuredNetworks)
    { 
       if(wifiConfiguration.status == WifiConfiguration.Status.ENABLED || 
          wifiConfiguration.status == WifiConfiguration.Status.CURRENT)
          { 
              ScanResult scan = map.get(wifiConfiguration.SSID);
              if(scan != null)
              { 
                 // Here you have the current connected WiFi
                 String wifiName = scan.SSID;
              }
          }
    }
}
+1
source

All Articles