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