Reputation: 33
google play store monitor the bad behavior of Excessive Wi-Fi Scanning in the Background.
not able to identify the issue i have add bellow permission in manifest
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
please suggest appropriate response. thanks
Upvotes: 1
Views: 954
Reputation: 349
Excessive Wi-Fi Scanning in the Background occur, Android vitals considers Wi-Fi scanning excessive when an app performs more than 4 scans per hour. Normally this issue can be reported by Android vital via play console. Otherwise we can use Battery historian tool to find background wifi scanning for each application.
We rectify this problem If possible, your app should be performing Wi-Fi scans while the app is running in the foreground. Foreground services automatically present notifications; performing Wi-Fi scans in the foreground thus makes the user aware of the why and when Wi-Fi scans take place on their device.
Upvotes: 0
Reputation: 84
Assuming your app is using FusedLocationProvider. If you subscribe to retrieve location from GooglePlayServices in background more often than once per 15 minutes, your app will be blamed for excessive WiFi scanning.
https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html
Activities should strongly consider removing all location request when entering the background (for example at onPause()), or at least swap the request to a larger interval and lower quality.
If device is setup in high accuracy location mode, the device will attempt to use wifi scans in order to resolve its location. Hence you have to consider increasing active interval for retrieving location updates.
public LocationRequest setInterval (long millis)
Upvotes: 1