Androidプログラミング初心者質問スレ Part4
■ このスレッドは過去ログ倉庫に格納されています
0763デフォルトの名無しさん
2010/12/26(日) 04:40:48updateNetwork関数を実行時に、-1が返ってきてしまいます。
アドバイス頂けるとうれしいです。よろしくお願いいたします。
WifiConfiguration config = new WifiConfiguration();
wifiManager.setWifiEnabled(true);
config.SSID = "\"" + ssid + "\"";
config.preSharedKey = "\"" + password + "\"";
config.hiddenSSID = true;
config.status = WifiConfiguration.Status.ENABLED;
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
config.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
wifiManager.addNetwork(config);
wifiManager.saveConfiguration();
int networkId = wifiManager.updateNetwork(config);
Log.d("WifiLog", "add Network returned " + networkId );
boolean result = wifiManager.enableNetwork(config.networkId, true);
Log.d("WifiLog", "enableNetwork returned " + result );
■ このスレッドは過去ログ倉庫に格納されています