Will android automatically reconnect available WIFI after wake-up with an sceduled alarm?

StackOverflow https://stackoverflow.com/questions/20111591

  •  03-08-2022
  •  | 
  •  

Вопрос

  1. I am aware of WifiManager.WifiLock such thing. I don't have to use it, because I don't need persistent wifi connection. Instead, I just need to try wifi connection every, say 30 min.

  2. I registered a CONNECTIVITY_CHANGE listener. If I set a scheduled wake-up alarm with 30 min interval. After wake-up, will android automatically reconnect available WIFI, so my CONNECTIVITY_CHANGE listener can hear it?

Это было полезно?

Решение

Yes, it should. Whether it has to 'reconnect' or not depends on the wifi sleep settings: by default it will remain connected even in sleep.

But if it has disconnected due to that setting, then it will reconnect when the device awakes, assuming that wifi is enabled, of course.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top