Android Network Information Get getNetworkInfo(Context context)

Here you can find the source of getNetworkInfo(Context context)

Description

get Network Info

Declaration

public static NetworkInfo getNetworkInfo(Context context) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Main {
    public static NetworkInfo getNetworkInfo(Context context) {
        ConnectivityManager cm = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        return cm.getActiveNetworkInfo();
    }/*from  www.  j  a v a2  s. c  o m*/
}

Related

  1. getNetworkInfo(Context context)
  2. getProvidersName(Context context)
  3. getCallState(TelephonyManager tm)
  4. getDeviceId(TelephonyManager tm)