is Connect Internet - Android android.net.wifi

Android examples for android.net.wifi:Wifi Connection

Description

is Connect Internet

Demo Code

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

public class Main {

  public static boolean isConnectInternet(Context pContext) {
    ConnectivityManager conManager = (ConnectivityManager) pContext.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo networkInfo = conManager.getActiveNetworkInfo();
    if (networkInfo != null) {
      return networkInfo.isAvailable();
    }/*from w ww .  ja  v a2s.c o m*/
    return false;
  }

}

Related Tutorials