static public boolean isNetworkAvailable(Context c) {
        ConnectivityManager cm =
                (ConnectivityManager)c.getSystemService(Context.CONNECTIVITY_SERVICE);

        NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
        return activeNetwork != null &&
                activeNetwork.isConnectedOrConnecting();
    }
Returns true if the network is available or about to become available.

@param c Context used to get the ConnectivityManager
@return true if the network is available
app/src/main/java/com/example/android/sunshine/app/Utility.java