WifiUtils
WifiUtils copied to clipboard
WifiUtils.withContext(context).connectWith(networkSSID, networkPass) in background service/thread
Hello, I am facing a small issue with WifiUtils in background service. I want to connect with wifi when my app is running in background but enable to connect. My background service is running and trying to connect with wifi but not getting any response in onConnectionResult..
Hi
I haven't tested the library in a background service so I can't think of what could be wrong. Maybe it is the background service limitations of Android itself. I will have a look as soon as I find some time.
On Fri, Dec 28, 2018, 1:55 PM Arslan Yasin <[email protected] wrote:
Hello, I am facing a small issue with WifiUtils in background service. I want to connect with wifi when my app is running in background but enable to connect. My background service is running and trying to connect with wifi but not getting any response in onConnectionResult..
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ThanosFisherman/WifiUtils/issues/22, or mute the thread https://github.com/notifications/unsubscribe-auth/AEqXCtKyr4PbFy-x1ZiW8RnmYBLp0uMJks5u9hTZgaJpZM4Zj1AU .
Hi, Thank you for your reply. Yes may there are limitations of android. Can you please check this soon and let me know the solution for it? THanks
Hi, I found the problem, if GPS is on, the result comes. If GPS is off, there is no result. Why was the GPS condition added?
My guess is: the lib always perform a scan before connecting to a network, and scan needs location permission, therefore I imagine that android indeed uses the user location for that purpose, but if the gps is disable, it may not be able to perform the scan