code: def set_wifi_enabled(cls, state=True):
          
          app = AndroidApplication.instance()
          f = app.create_future()
  
          def on_permission_result(result):
              if not result:
                  #: Permission denied
                  f.set_result(None)
                  return
  
              def on_ready(m):
                  m.setWifiEnabled(state).then(f.set_result)
  
              WifiManager.get().then(on_ready)
  
          #: Check permission
          WifiManager.request_permission([
              WifiManager.PERMISSION_CHANGE_WIFI_STATE
          ]).then(on_permission_result)
          return f
docs: Set the wifi enabled state.
          
          Returns
          --------
              result: future
                A future that resolves with whether the operation succeeded.