i tried a secured ap and an open - both didnt work. i can create the needed WifiConfiguration and and enableNetwork(int) returns true, but no connection is established.
Ingame is an open network:
- Code: Select all
WifiConfiguration wc = new WifiConfiguration();
wc.SSID = "\"ingame\"";
wc.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
wc.status = WifiConfiguration.Status.ENABLED;
int netID = wifiManager.addNetwork(wc);
wifiManager.enableNetwork(netID, true);
But when i try to check the connection by this:
- Code: Select all
WifiInfo inf = wifiManager.getConnectionInfo();
Log.d("Wifi", " connected to : " + inf.getSSID());
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = null;
if(connectivityManager != null)
{
networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
Log.d("Wifi", "isConnected " + networkInfo.isConnected());
}
i get "connected to : null" and "isConnected false" - so no active connection is established.
The wpa_supplicant throws no errors (in logcat) and ive no clue what is going wrong.
the android wifi-manager (gui) shows no connection too.
any ideas?


