title: Android Q 10 Connect to network WifiNetworkSpecifier
body: <p>Since Android Q doesn't allow the WifiManager to add Networks, they gave the advise to use WifiNetworkSpecifier instead. 
  With the WifiNetworkSuggestionBuilder I was already able to display the notification on the statusbar, that user can join the network. But this API doesn't fulfill my requirements since that I don't the user to have to use the suggestion from the statusbar. </p>
  
  <p>With WifiNetworkSpecifier I was also already able to display a popup about joining the network and the app also established a connection to the app. But that wifi connection seems only be available in the scope of the app. How is it possible to overcome this scope of the app, so other apps and for example also the browser is able to use this new established connection?
  Below is my code</p>
  
  <pre class="lang-java prettyprint-override"><code>    WifiNetworkSpecifier.Builder builder = new WifiNetworkSpecifier.Builder();
      builder.setSsid("abcdefgh");
      builder.setWpa2Passphrase("1234567890");
  
      WifiNetworkSpecifier wifiNetworkSpecifier = builder.build();
      NetworkRequest.Builder networkRequestBuilder = new NetworkRequest.Builder();
  networkRequestBuilder.addTransportType(NetworkCapabilities.TRANSPORT_WIFI);     
  networkRequestBuilder.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED);            
  networkRequestBuilder.addCapability(NetworkCapabilities.NET_CAPABILITY_TRUSTED);            
  networkRequestBuilder.setNetworkSpecifier(wifiNetworkSpecifier);
  NetworkRequest networkRequest = networkRequestBuilder.build();
      ConnectivityManager cm = (ConnectivityManager) App.getInstance().getBaseContext().getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
      if (cm != null) {
          cm.requestNetwork(networkRequest, new ConnectivityManager.NetworkCallback() {
              @Override
              public void onAvailable(@NonNull Network network) {
                  //Use this network object to Send request.
                  //eg - Using OkHttp library to create a service request
  
                  super.onAvailable(network);
              }
          });
  </code></pre>