title: hotspot set number of users programmatically
body: <p>i've used a method to create a hotspot and it's working</p>
  
  <p>but i need to set a specific number of maximum connections that will be in this hotspot</p>
  
  <p>thanks in advance</p>
  
  <p>My current code :</p>
  
  <pre><code>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;
  }
  </code></pre>