Google has some URLs designed for special purposes, such as:
http://www.google.com/blank.html
and
http://clients3.google.com/generate_204
These are designed to facilitate detection of 'captive portals': that is, when you sign on to a wifi network at a hotel or airport, you (or an automated process) can go check these pages. If they return anything other than the intended result (i.e. if 'blank.html' contains anything other than a blank page) then the process that's checking it knows that something is intercepting your web requests -- most likely a portal page demanding payment.
Example of its use, (WifiWatchdogStateMachine.java):
private static final String DEFAULT_WALLED_GARDEN_URL =
"http://clients3.google.com/generate_204";
/**
* DNS based detection techniques do not work at all hotspots. The one sure
* way to check a walled garden is to see if a URL fetch on a known address
* fetches the data we expect
*/
private boolean isWalledGardenConnection() {
HttpURLConnection urlConnection = null;
try {
URL url = new URL(mWalledGardenUrl);
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setInstanceFollowRedirects(false);
urlConnection.setConnectTimeout(WALLED_GARDEN_SOCKET_TIMEOUT_MS);
urlConnection.setReadTimeout(WALLED_GARDEN_SOCKET_TIMEOUT_MS);
urlConnection.setUseCaches(false);
urlConnection.getInputStream();
// We got a valid response, but not from the real google
return urlConnection.getResponseCode() != 204;
} catch (IOException e) {
if (DBG) {
log("Walled garden check - probably not a portal: exception " + e);
}
return false;
} finally {
if (urlConnection != null) {
urlConnection.disconnect();
}
}
}
Further discussion about this can be found on this thread.