code: public static boolean isConnected(Context context) {
          NetworkInfo info = Managers.connectivity(context).getActiveNetworkInfo();
          return info != null && info.isConnected();
      }
docs: True if a data network is connected.