I'm not sure if you can access its state programmatically, but Android already does detection: the WiFi status icon is green if the system can make a connection to Google's servers, and grey otherwise.
IPv[46] have nothing to do with it. "Captive portal" pages are meant to prevent you from getting to the larger Internet, until you do whatever magic is required to dismiss them.
"the WiFi status icon is green if the system can make a connection to Google's servers, and grey otherwise."
That's interesting. How does it detect it's at Google's servers?
I've often had occasions on my non-rooted, gingerbread, nexus one, where the phone believes it is on the net, on wifi, and shunts all activity to wifi, and yet, it's really stuck on one of those captive portal pages.
It even happens if I am just driving down the road.
I had thought that perhaps a small bit of technology would fix that, perhaps by turning the wifi off, or by automatically checking in on starbuck's router, but I am beginning to see I may just have a sick-making sense of entitlement.
Without being terribly cognizant of the RFCs I am surprised these portal captures are within spec.
IPv[46] have nothing to do with it. "Captive portal" pages are meant to prevent you from getting to the larger Internet, until you do whatever magic is required to dismiss them.