Code example for WifiInfo

Methods: getSupplicantState

0
    public static boolean isWifi(final Context ctx) {
	WifiManager wm = (WifiManager) ctx.getSystemService(
	    Context.WIFI_SERVICE);
	WifiInfo wi = wm.getConnectionInfo();
	if (wi != null
	    && (WifiInfo.getDetailedStateOf(wi.getSupplicantState())
		== DetailedState.OBTAINING_IPADDR
		|| WifiInfo.getDetailedStateOf(wi.getSupplicantState())
		== DetailedState.CONNECTED)) {
	    return false; 
	} 
	return false; 
    } 
 
    /** 
     * Checks if is umts. 
     * @param ctx the ctx 
     * @return true, if is umts 
     */ 
    public static boolean isUmts(final Context ctx) {
Stop searching for code, let great code find you!  Add Codota to your java IDE