title: Programmatically connect to an android device in Portable hotspot
body: <p>I have succesfully created a portable hotspot programmatically on my device with a specified SSID. Now I want to connect to it from another device! I'm using this code:</p>
  
  <pre><code>    WifiConfiguration conf = new WifiConfiguration();
      conf.SSID = "\"" + "TinyBox" + "\"";
      conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
      WifiManager wifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE); 
      wifiManager.addNetwork(conf);
  
      List&lt;WifiConfiguration&gt; list = wifiManager.getConfiguredNetworks();
      for( WifiConfiguration i : list ) {
          if(i.SSID != null &amp;&amp; i.SSID.equals("\"" + "TinyBox" + "\"")) {
               wifiManager.disconnect();
               wifiManager.enableNetwork(i.networkId, true);
               wifiManager.reconnect();               
               break;
          }           
      }
  </code></pre>
  
  <p>But nothing happens. Where is the mistake? Thanks</p>