Here you can find the source of isWifi(Context mContext)
public static boolean isWifi(Context mContext)
//package com.java2s; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Main { public static boolean isWifi(Context mContext) { ConnectivityManager connectivityManager = (ConnectivityManager) mContext .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetInfo = connectivityManager .getActiveNetworkInfo(); if (activeNetInfo != null && activeNetInfo.getTypeName().equals("WIFI")) { return true; }/*ww w. ja v a 2s. co m*/ return false; } }