Android Question Question about WifiNetworkSpecifier + NetworkRequest

Filippo

Expert
Licensed User
Longtime User
Hi,

I am using this code snippet from Erel.
The connection to the WiFi network (XIAO-ESP32C3) works very well and quickly.
If the WiFi fails, e.g., is switched off, my app receives the message/event about 15 seconds later.
Question: Is there a way to receive this message/event faster?
Or should I use a timer to check whether the connection is established?


Thank you very much.
Filippo
 

drgottjr

Expert
Licensed User
Longtime User
you want onLost, not onUnavailable. that's why you're getting the delay. they are different methods with different purposes.
 
Upvote 0
Top