package com.dinect.checker;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Utils {

    private Utils() {

    }

    public static boolean isOnline(Context context) {
        NetworkInfo netInfo = getConnectivityManager(context).getActiveNetworkInfo();
        return netInfo != null && netInfo.isConnected();
    }

    private static ConnectivityManager getConnectivityManager(Context context) {
        return (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    }
}