如何连接到LocalOnlyHotspot(Android 8.x+)?

问题描述 投票:0回答:1

我已经成功地使用以下方法建立了一个热点 仅限本地热点.它给了我一个SSID为Android_share_xxxx和未知密码的热点,我如何将我的其他设备连接到这个热点?

android android-studio android-wifi
1个回答
0
投票

我们可以通过以下方式获取生成的wifi配置。

        @Override
    public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) {
      super.onStarted(reservation);
      hotspotReservation = reservation;
      currentConfig = hotspotReservation.getWifiConfiguration();

      Log.v("DANG", "THE PASSWORD IS: "
          + currentConfig.preSharedKey 
          + " \n SSID is : "
          + currentConfig.SSID); 

      hotspotDetailsDialog();

    }
© www.soinside.com 2019 - 2024. All rights reserved.