ReactiveWiFi icon indicating copy to clipboard operation
ReactiveWiFi copied to clipboard

Android 8+ scan throttle

Open oykenfurkan opened this issue 6 years ago • 6 comments

After version 8.0 Android started apply limitations to the frequency of scans using. The new limitations are;

Android 8.0 and Android 8.1:

Each background app can scan one time in a 30-minute period.

Android 9:

Each foreground app can scan four times in a 2-minute period. This allows for a burst of scans in a short time.

All background apps combined can scan one time in a 30-minute period.

https://developer.android.com/guide/topics/connectivity/wifi-scan

According to these the sample application is failed to update the values after 4 scans.

oykenfurkan avatar Oct 11 '19 06:10 oykenfurkan

It's good to know. Due to this update, library will no longer work on the newest Android versions. The only reasonable fix I see right now, is to add limitation for scan with these periods for the newest Android versions.

pwittchen avatar Oct 11 '19 16:10 pwittchen

I think alternative way to solve that issue may be creating the separate library, which can use new RTT API. I had this idea some time ago, but I haven't executed it yet :-).

pwittchen avatar Oct 17 '19 13:10 pwittchen

RTT API would be a great idea. But it is just too new yet and Android is restricted Wi-Fi scanning to early in my opinion.

oykenfurkan avatar Oct 18 '19 06:10 oykenfurkan

Yeah. As a regular developers we cannot do much about it. We can simply adjust to the Google/Android API and Guidelines.

pwittchen avatar Oct 18 '19 09:10 pwittchen

So i heard you preparing to release new version or new library at latest thread, thats awseome! but before we wait for new library or version, id like to stop scanning when its throttled. is there any way i can detect status of Failed to start scan and do another strategy?

Thanks!

juicycool92 avatar Sep 03 '20 14:09 juicycool92

is there any way i can detect status of Failed to start scan and do another strategy?

I'm not sure if it's possible to detect such situation. We can just send request for scan and wait for the results.

pwittchen avatar Sep 04 '20 08:09 pwittchen