hammlab / Crowd-ML

Framework for Crowd-sourced Machine Learning
Apache License 2.0
16 stars 10 forks source link

Changed WiFi connection detection to Event Based Listener #26

Closed 3ygun closed 7 years ago

3ygun commented 7 years ago

What?

Following the https://stackoverflow.com/questions/1783117/network-listener-android and https://developer.android.com/reference/android/net/ConnectivityManager.html I changed from the custom WiFi ready code to an event listener one. Appears to work tested turning on and off the WiFi on my phone and the app didn't crash and was able to resume calculations. Also seems to resolve #24

Parts

NOTE: DO NOT MERGE UNTIL THE FOLLOWING ARE COMPLETE

Fixes

tylermzeller commented 7 years ago

Confirmed memory leak fix?

Since you removed NetworkUtils, #15 shouldn't be an issue. Just test a few experiments to ensure the wifi connectivity is reliable and quick to respond to a connectivity change.

3ygun commented 7 years ago

@tylermzeller I removed the WifiHandler thread also. Could you check through the changes and see if they work on your end. I can fix feedback and when done we can merge.

My Concerns