Do you have any idea how to establish a wifi connection with sending password in my android application?
100% Works.
By this way you can connect to your specific Wifi This code for MainActivity.java
////////////// >>> Wifi Connection (WP2) <<< ////////////////
WifiConfiguration wifiConfig = new WifiConfiguration();
wifiConfig.SSID = String.format("\"%s\"", "Wifi name");
wifiConfig.preSharedKey = String.format("\"%s\"", "Wifi password");
WifiManager wifiManager=(WifiManager)getSystemService(WIFI_SERVICE);
int netId = wifiManager.addNetwork(wifiConfig);
wifiManager.disconnect();
wifiManager.enableNetwork(netId, true);
wifiManager.reconnect();
And Also don't forget to include this code to your AndroidManifest.xml