Android 8+ scan throttle
oykenfurkan opened this issue · 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.
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.
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 :-).
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.
Yeah. As a regular developers we cannot do much about it. We can simply adjust to the Google/Android API and Guidelines.
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!
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.