Other Checking for Internet connection

LucaMs

Expert
Licensed User
Longtime User
To check if there is an Internet connection available, my app uses the common hint: try to download www.google.com.

Today my app does not want to connect to my server, although my device navigates using a browser.

Well, I found the problem: if Google Search is nervous :D, it sends to you a "captcha" and your "connection test" fails.

So, check if you downloaded a page which contains a "sorry" and if so try to download a different page. No, it seems that you will get an error before the "captcha" page, so Successful will be False.


[P.S. I don't really need to download a page to check for an Internet connection, because I have to connect to my server, but I used a my library which does it]
 
Last edited:

LucaMs

Expert
Licensed User
Longtime User
1. Test whether the device ip address is not 127.0.0.1 (ServerSocket).
2. Try to connect to your server instead of google.
Done, exactly because I use my own server; however, I created a big library :D whose sole purpose was to verify the existence of an Internet connection and it downloaded google.com. Now I changed it and if the download fails, another page download starts, from this link (very light ;)).

Thank you, Erel
 
Upvote 0
Top