WifiUtils icon indicating copy to clipboard operation
WifiUtils copied to clipboard

WifiUtils.withContext(context).connectWith(networkSSID, networkPass) in background service/thread

Open arslanyasin opened this issue 6 years ago • 4 comments

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..

arslanyasin avatar Dec 28 '18 12:12 arslanyasin

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 .

ThanosFisherman avatar Dec 28 '18 16:12 ThanosFisherman

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

arslanyasin avatar Dec 31 '18 05:12 arslanyasin

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?

adaonder avatar Aug 06 '20 05:08 adaonder

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

fernando-s97 avatar Nov 23 '21 19:11 fernando-s97