code: public boolean isWifiConnected() {
  		try {
  			if (connMan == null) {
  				connMan = (ConnectivityManager) context
  						.getSystemService(Context.CONNECTIVITY_SERVICE);
  			}
  			NetworkInfo wifiNetInfo = connMan.getNetworkInfo(TYPE_WIFI);
  			NetworkInfo wimaxNetInfo = connMan.getNetworkInfo(TYPE_WIMAX);
  
  			if (wifiNetInfo == null && wimaxNetInfo == null) {
  				Log.e(TAG, "wifiNetworkInfo is null.");
  				return false;
  			}
  
  			if (wifiNetInfo != null && wifiNetInfo.isConnected()) {
  				return true;
  			}
  
  			if (wimaxNetInfo != null && wimaxNetInfo.isConnected()) {
  				return true;
  			}
  		} catch (Exception e) {
  			Log.e(TAG,
  					"Exception during isWifiConnected(). - "
  							+ e.getLocalizedMessage());
  		}
  		return false;
  	}
docs: Returns WiFi connection state<br>
  Requires ACCESS_NETWORK_SATE, READ_PHONE_STATE permissions<br>
  
  @return true if WiFi is connected; false otherwise