Is there any way to get the previously associated Wifi networks for an Android device? Ultimately, I want to bring up a list (e.g., a spinner) that has all of the networks that the user has associated with. Then, I want them to select their "home network." However, I can't find a history of associations. The history must be kept somewhere, because I can bring up my "Wi-Fi settings" and I can see my previously associated networks. They just say "Not in range" below them.
I checked WifiManager but couldn't find anything related there.
I do notice that there is a history in a root-only location (likely because the network's passwords are in cleartext):
data/wifi/bcm_supp.conf
I'd like a non-root method.
Edit: I now know it's possible. If you download the app called "Wifi Manager" from the Market or Google Play, you can pull down the dropdown menu to "Known networks" and they will come up. I've scoured all of the networking documentation and I still can't find out how, however.
What you are looking for is: https://developer.android.com/reference/android/net/wifi/WifiManager.html#getConfiguredNetworks()
This will get you all the previously associated networks as they will have to have been configured in order to connect to them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With