def isWiFiEnabled():
 try:
  mContext = autoclass('android.content.Context')
  pythonActivity = autoclass('org.renpy.android.PythonService')
  wifiManager = cast('android.net.wifi.WifiManager', pythonActivity.mService.getSystemService(mContext.WIFI_SERVICE))
  return wifiManager.isWifiEnabled()
 except Exception as e:
  return None

def isWiFiEnabled ( ) : try : mContext = autoclass ( 'android.content.Context' ) pythonActivity = autoclass ( 'org.renpy.android.PythonService' ) wifiManager = cast ( 'android.net.wifi.WifiManager' , pythonActivity . mService . getSystemService ( mContext . WIFI_SERVICE ) ) return wifiManager . isWifiEnabled ( ) except Exception as e : return None
returns none if an error .