Anybody have some simple code that tests for a live internet connection? I've been playing around with the URL class and the URLConnection class, but I can't find anything that tests for a connection. Here is some code I have so far if it helps.
URL url = null;
url = new URL("http://www.yahoo.com
URLConnection urlC = url.openConnection();
This code works either way, even if I'm not connected to the Internet, but I don't know if I am even close or not.