How to get previously associated Wi-Fi networks?

Is there a way to get previously associated Wi-Fi networks for an Android device? Ultimately, I want to display a list (for example, a counter) that has all the networks the user is connected to. Then I want them to choose their "home network". However, I can not find the history of associations. The story should be kept somewhere because I can bring up my “Wi-Fi settings” and I can see my previously connected networks. They just say "Not in range" below them.

I checked WifiManager but could not find anything there.

I notice that there is a story in the root location (probably because the network passwords are in clear text):

data/wifi/bcm_supp.conf 

I need a non-root method.


Edit: I now know that this is possible. If you download the “Wifi Manager” application from Market or Google Play, you can display the drop-down menu in “Known networks” and they will appear. I have looked through all the online documentation, but I still cannot figure out how to do this.

+4
source share
1 answer

What are you looking for: https://developer.android.com/reference/android/net/wifi/WifiManager.html#getConfiguredNetworks ()

This will give you all the previously connected networks, as they must be configured to connect to them.

+8
source

All Articles