开发者

periodic check to see whether Wifi in enables in Android

I 开发者_StackOverflowwant to develop an application that will periodically check whether Wi-Fi is enabled in android and depending on on the result it will take an action. Can anyone give me some suggestions regarding this?

Thanks kaisar


I think you would better implement a BroadcastReceiver listening to WifiManager.NETWORK_STATE_CHANGED_ACTION system intents.

This way you don't drain battery with unnecessary system wakeup for starting your periodic service, and you are guaranteed to track all wifi state changes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜