Issue
I am making an android app which requires WIFI to be always ON even if phone gets locked. Also, power mode selected by user shouldn't make WIFI to turn OFF. For example, if user selects "Power Saving" mode than OS will automatically turn OFF the WIFI which I want to ignore & just keep it ON forever?
Is it achievable?
Solution
The only thing that you can do is use WifiLock
. This keeps the WiFi radio on when it was already on. However:
It does not override manual user control (e.g., airplane mode)
AFAIK it will not change full Doze behavior, where network access is suspended (though the user could add your app to the battery optimization whitelist)
Some device manufacturers have added more aggressive power management features, and it is possible that
WifiLock
is ignored for themUsers may get irritated if they feel that you are using an excessive amount of power, and users can express their irritation in a variety of ways, few of which are pleasant
Answered By - CommonsWare
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.