-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Too much callbacks when observing "observeWifiAccessPoints" #31
Comments
Hi, Thanks for reporting this issue. I'll take a closer look on that. Regards, |
Thanks for quick reply, I tested above mentioned solution, looks like when you don't call |
That's correct. I know it's not the best solution, but it's the only solution I know, which allows to receive updates about access points continuously. If you call You can build another observable on top of that for your specific use case. E.g. you can store unique APs somewhere (in the memory, database, shared prefs, etc.) and then subscribe the new observable for data changes so you won't be flooded by incoming scan results all the time. |
|
Hi @akashgowda0110. I was AFK. I'm not sure about behavior and monitoring capabilities in "lock mode". Maybe Android OS is blocking scanning in this mode due to performance or energy saving reasons. It's reasonable for me. Have you put scanning code in the |
Thank you. As you told, Android OS which was blocking for energy saving reason. Works fine with Naugat and below versions of android. Oreo version of android having problem with this. |
I'm using
ReactiveWifiLocal.observeWifiAccessPoints(context)
everything works well except that I'm receiving too much events, and it is causing high cpu load, lags and battery drain.I can handle it partially by using
.throttleFirst(SAMPLING_TIME, TimeUnit.SECONDS)
but anyway the library it-selves receives callbacks in BroadcastReceiverI suggest to do something like
This is how often I get updates:
The text was updated successfully, but these errors were encountered: