Anyone knows how and where the WiFi passwords are stored on the android devices. I'm not looking into cracking it, but into saving and restoring whatever "container" holds it. any android API framework support to save wifi password and then retrieve the wifi password?
It varies from device to device: it is stored in the wpa_supplication.conf
configuration file, but that can be customized from distribution to distribution. See for a couple of possible locations, but you will need to dig around your device for it.
There is no API support for reading/writing Wifi passwords for APKs not signed with the system key, so no: you won't be able to retrieve it.