package com.doverfuelingsolutions.issp.utils

import android.content.Context
import android.net.ConnectivityManager

object NetworkUtil {

    /**
     * Indicate if the network is available
     */
    fun isAvailable(context: Context) : Boolean {
        val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
        val activeNetworkInfo = connectivityManager.activeNetworkInfo
        return activeNetworkInfo?.isAvailable ?: false
    }
}