openbmap / radiocells-scanner-android

WLAN and cell tower scanner for Radiocells.org
https://www.radiocells.org
Other
57 stars 25 forks source link

Scan also when wifi off but background scanning allowed #97

Open bonanza123 opened 9 years ago

bonanza123 commented 9 years ago

From my experience I guess the current version from fdroid is not scanning wifis if wifi itself is disabled but in Android wifi settings the background scanning is allowed. Using this is usually less energy consuming as the scanning frequency is fully controlled by the app and not also by android which is trying to find a hot-spot to connect to.

wish7code commented 8 years ago

Hey bonanza123!

Sorry I overlooked your suggestion so far. In fact, that so exciting!

I just checked the documentation @ http://developer.android.com/reference/android/net/wifi/WifiManager.html#isScanAlwaysAvailable%28%29 If I got that right, it would required only minimal code changes.

From my experience I guess the current version from fdroid is not scanning wifis if wifi itself is disabled but in Android wifi settings the background scanning is allowed.

That's true. Currently Radiobeacon only checked isWifiEnabled(). If wifi was disabled no further action was taken..

Using this is usually less energy consuming as the scanning frequency is fully controlled by the app and not also by android which is trying to find a hot-spot to connect to.

Are you aware of any drawback?

Sorry for my late reply & thanks a tons Cheers Toby

wish7code commented 8 years ago

see 0edbce474783754b3ebece9ce70ff39495a32759

bonanza123 commented 8 years ago

Thanks a lot! I actually don't know any drawbacks of this. And as the user can always disable the background checking in the android settings, I guess he is not loosing any control :-) Do you know when this commit will make it with a new build into the fdroid repository?