n76 / wifi_backend

Local (phone only) WiFi AP location provider for microG project's unified network location provider
GNU General Public License v3.0
59 stars 11 forks source link

Use API level 17 (or lower) #2

Closed wvengen closed 9 years ago

wvengen commented 9 years ago

I've compiled and tested with API level 17 on an Android 4.2 device, and it seems to work without a problem.

n76 commented 9 years ago

If I change the API level to 17 in both AndroidManifest.xml and project.properties I get a compile failure for isScanAlwaysAvailable(). Looking at http://developer.android.com/reference/android/net/wifi/WifiManager.html#isScanAlwaysAvailable() I see that that call was added in API 18. I get a clean compile with API 18 so I will change from 19 to 18 on the manifest and build properties.

wvengen commented 9 years ago

Ah, I forgot to clean when recompiling for a different API level.

I'd really like to use this on Android 4.2. Would you be open to use isScanAlwaysAvailable() when supported, but skip it when not? Either using something like this or perhaps even introspection?

wvengen commented 9 years ago

I'd be happy to make a pull request for this (but only able to test with Android 4.2).

wvengen commented 9 years ago

See also http://mobiledev.sourceforge.net/guide/appendix/api-levels.html

n76 commented 9 years ago

I can't test on Android 4.2 (only one device and that is at 4.4). If you give me a pull request for a version that works for you I can test it on 4.4 and accept it.

n76 commented 9 years ago

Just pushed v0.7.0 which should allow the code to run on your Android 4.2

wvengen commented 9 years ago

Thank you! I'll test it today or tomorrow.

wvengen commented 9 years ago

Works great, thanks!

yuphorian6 commented 8 years ago

On my device with android 4.2 , the backend gets installed and maps wifi AP's to gps locations. But the backend fails to provide location data to the system on Location request. Maps won't lock the network location with this backend within the range of mapped APs .

Since UnifiedNlp has a legacy version supporting even android 2.3 , it would be ideal for this to support since android 2.3 . On devices below kitkat where background scanning isn't available, maybe a legacy version of app or by some other way it needs to support.