Prevent WiFi from power off

為{幸葍}努か 提交于 2019-12-10 17:48:59

问题


Backround: Android 2.x running on a Tablet. Is there any way to prevent the WiFi from power off when there are no connection incoming or outgoing? I need the WiFi to stay alive for incoming connection from a server. For now I am doing keep alive calls but that's not that nice. I've googled that already and found out that it is something about powersaving. Is there anyway to come around this?

Thanks in advance for any Help on this!


回答1:


Try to go to Settings -> Wireless -> Wifi Settings -> Menu -> Advanced -> WiFi Sleep Policy and change the policy.

This may avoid the behavior you're describing.




回答2:


Try the WifiLock just like the WakeLock.

http://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock.html



来源:https://stackoverflow.com/questions/5976469/prevent-wifi-from-power-off

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!