Android examples for Wifi:Wifi Connection
is On Wifi Net
//package com.java2s; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.util.Log; public class Main { public static Boolean isOnWifiNet(Context context) { boolean isWifi = false; ConnectivityManager connManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = connManager.getActiveNetworkInfo(); if (netInfo != null && netInfo.isConnected()) { isWifi = (netInfo.getType() == ConnectivityManager.TYPE_WIFI); Log.d("IsOnWifiNet", isWifi + ""); }// w ww . java 2 s. c om return isWifi; } }