我使用了一种创建热点的方法并且它正在运作
但我需要设置将在此热点中的特定数量的最大连接
提前致谢
我目前的代码:
private boolean configHotspot(String name,String pass) {
WifiConfiguration wifiCon = new WifiConfiguration();
wifiCon.SSID = name;
wifiCon.preSharedKey = pass;
wifiCon.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED);
wifiCon.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
wifiCon.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
wifiCon.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
try
{
Method setWifiApMethod = wifimanager.getClass().getMethod("setWifiApEnabled", WifiConfiguration.class, boolean.class);
boolean apstatus=(Boolean) setWifiApMethod.invoke(wifimanager, wifiCon,true);
return apstatus;
}
catch (Exception e)
{
e.printStackTrace();
}
return false;
}