How to check for unrestricted Internet access? (captive portal detection)
For reference, here is the ‘official’ method from the Android 4.0.1 AOSP code base: WifiWatchdogStateMachine.isWalledGardenConnection(). I am including the code below just in case the link breaks in the future. private static final String mWalledGardenUrl = “http://clients3.google.com/generate_204”; private static final int WALLED_GARDEN_SOCKET_TIMEOUT_MS = 10000; private boolean isWalledGardenConnection() { HttpURLConnection urlConnection = null; try { URL … Read more