Code example for WifiInfo

Methods: getSupplicantState

0
		if(useWifi && (netType == ConnectivityManager.TYPE_WIFI)){
			if(this.wifiManager.isWifiEnabled()){
				this.wifiLock = this.wifiManager.createWifiLock(NetworkService.TAG);
				final WifiInfo wifiInfo = this.wifiManager.getConnectionInfo();
				if(wifiInfo != null && this.wifiLock != null){
					final DetailedState detailedState = WifiInfo.getDetailedStateOf(wifiInfo.getSupplicantState());
					if(detailedState == DetailedState.CONNECTED 
							|| detailedState == DetailedState.CONNECTING || detailedState == DetailedState.OBTAINING_IPADDR){
						this.wifiLock.acquire();
						connected = true;
					} 
				} 
			} 
			else{ 
				Toast.makeText(IMPSDev.getContext(), "WiFi not enabled", Toast.LENGTH_LONG).show();
				if(DEBUG) Log.d(NetworkService.TAG, "WiFi not enabled");
			} 
		} 
		else if(use3G && (netType == ConnectivityManager.TYPE_MOBILE )){
			if(		(netSubType >= TelephonyManager.NETWORK_TYPE_UMTS) || // HACK
				    (netSubType == TelephonyManager.NETWORK_TYPE_GPRS) ||