I'm trying to run a hotspot with a new name and open accessibility.
wifiConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
wifiConfig.SSID = "\"MySSID\"";
wifiConfig.networkId = 1;
methodNum = getMethodNumber("setWifiApEnabled");
try {
wmMethods[methodNum].invoke(wifiManager, wifiConfig, true);
} catch (IllegalArgumentException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IllegalAccessException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (InvocationTargetException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
I get the right method and it seems like it starts the hotspot on the phone, but the configuration doesn't change.
I tried to get the current configuration data with getWifiApConfiguration and i get nothing with it, no ssid and not the current encryption.
I'm using HTC Evo 3d for the debugging.