public boolean isDataConnected(){
  ConnectivityManager connectMan=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
  NetworkInfo activeNetworkInfo=connectMan.getActiveNetworkInfo();
  return activeNetworkInfo != null && activeNetworkInfo.isConnectedOrConnecting();
}

public boolean isDataConnected ( ) { ConnectivityManager connectMan = ( ConnectivityManager ) getSystemService ( Context . CONNECTIVITY_SERVICE ) ; NetworkInfo activeNetworkInfo = connectMan . getActiveNetworkInfo ( ) ; return activeNetworkInfo != null && activeNetworkInfo . isConnectedOrConnecting ( ) ; }
method check , if internet is available .
