Answers for "how to detect network connection on android app (android studio)"

1

check network connection android

private Boolean isNetworkAvailable() {
    ConnectivityManager connectivityManager 
          = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
    return activeNetworkInfo != null && activeNetworkInfo.isConnectedOrConnecting();
}
Posted by: Guest on August-21-2021

Code answers related to "how to detect network connection on android app (android studio)"

Browse Popular Code Answers by Language