Code example for WifiManager

Methods: isWifiEnabled

2
	 *  
	 * @returns {boolean} The status of Wi-Fi in device settings. 
	 */ 
	public boolean isWifiEnabled() { 
		WifiManager wifiManager = (WifiManager) ctx.getSystemService(Context.WIFI_SERVICE);
		boolean result = wifiManager.isWifiEnabled();
		Log.d(LOG_TAG, "Wifi enabled: " + result);
		return result;
	} 
	 
	/** 
	 * Requests that the user enable the Wi-Fi in device settings. 
	 */ 
	public void switchToWifiSettings() { 
		Log.d(LOG_TAG, "Switch to Wifi Settings");
		Intent settingsIntent = new Intent(Settings.ACTION_WIFI_SETTINGS);
		ctx.startActivity(settingsIntent);
	} 
	 
	/** 
	 * Check device settings for Bluetooth.