Why not use WifiManager.WifiLock when the transfer is in progress, and release it when done.
I would suggest that the network connection switch would not be smooth. I do not know for sure.
BroadcastReceiver will notify you when the Wi-Fi connection status changes. Look at the ConnectivityManager, though, because it will control Wi-Fi and GPRS, etc., and it makes a switch to another resource. Is it seamless, although I do not know.
source
share