Sample code using ConnectivityManager and NetworkInfo
Use of logcat to watch the logging
adb logcat -s NETCHK
Sample code using ConnectivityManager and NetworkInfo AsyncTask, HttpURLConnection, BufferedReader`
Use of logcat to watch the logging
adb logcat -s HttpURLConn