Android Question How to check if WiFi is connected (may not be to internet)?

Inman

Well-Known Member
Licensed User
Longtime User
I searched the forum and found many examples on checking if the device is connected to internet. In my case, I need to check if WiFi is connected but it could be to a hotspot or printer and so there may not be internet connectivity.

What is the proper way to do this?
 

Mihai Rainer Jr.

Member
Licensed User
I'm trying to use this solution to find if the WiFi is connected, but since the phone has a static IP set (I need that for some network devices to connect to it over MQTT), it always returns the static IP I've set on the phone and not 127.0.0.1 so, this solution does not work for me. Is there any other option to check that?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…