Code example for WifiManager

Methods: isWifiEnabled

0
		} 
		return cachedInstance;
	} 
	 
	public boolean isWifiEnabled() { 
		return wifiManager.isWifiEnabled();
	} 
	 
	public void turnOnWifi(boolean state) {
		wifiManager.setWifiEnabled(state);
	} 
	 
	public void enableMobileData(boolean state){
		try { 
			Method dataMtd = ConnectivityManager.class.getDeclaredMethod("setMobileDataEnabled", boolean.class);
			dataMtd.setAccessible(true);
			dataMtd.invoke(this.mdataManager, state);
		} catch (Exception e) {
			PreyLogger.e("Couldn't enable mobile data", e);
		} 
Experience pair programming with AI  Get Codota for Java