1

I am using Android to develop an application.

I connected to hotspot, after then, I sent http request to the "http://www.google.com" web page using HttpURLConnection or HttpClient. It should not response, because the connection is not made yet, so it will be redirected to authentication page ot the hotspot.

I wish to get the authentication page html data. But the code throws IOException. The error message is "IOException: Socket is not connected". It connected to the hotspot. I know, it can not be connected to the google.

How can I get the html data???? Anyone know, please let me also know. Thanks in advance.

animuson
  • 53,861
  • 28
  • 137
  • 147
mooongcle
  • 3,987
  • 5
  • 33
  • 42
  • It should respond, if you're talking about some sort of public wifi hotspot. The redirection to a WLAN login page is normally done via an HTTP redirect. So the HTTP/TCP connections should not be failing. – Christopher Orr Sep 28 '10 at 15:10
  • but it is failed. Everytime, throws IOException. If you have any code, please attach for me. – mooongcle Sep 28 '10 at 16:38
  • Not likely with a non-root device. See http://stackoverflow.com/questions/23150207/captive-portal-on-android-device – thundertrick Apr 06 '16 at 02:38

0 Answers0