Here you can find the source of isConnected(Context connext)
public static boolean isConnected(Context connext)
//package com.java2s; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Main { public static boolean isConnected(Context connext) { ConnectivityManager connectivityManager = (ConnectivityManager) connext .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info = connectivityManager.getActiveNetworkInfo(); if (info != null && info.isConnected()) { return true; }/* ww w. ja v a 2 s . c o m*/ return false; } }