public bool SetNetworkState(bool enabled) { wifiManager = (WifiManager)context.GetSystemService(Context.WifiService); try { if (enabled) { callback = new HotSpotCallback(this); wifiManager.StartLocalOnlyHotspot(callback, new Handler()); } else { if (mReservation != null) { HotSpotState = HotSpotState.Disabled; mReservation.Close(); } } } catch (System.Exception s) { Console.WriteLine("Exception occured: " + s.Message); return(false); } return(true); }