Unity – Detect if Wifi is enabled on Android without plugin

Sometimes you need to check the Wifi connection of the device on mobile for several reasons.

In order to get the permission to get the Wifi state you have to add this permission in the AndroidManifest.xml file:

Then use this code in your c# class: