【发布时间】:2019-02-06 12:33:49
【问题描述】:
我必须在 android studio 中以编程方式获取我的移动热点的名称和密码。我该怎么做?
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
Toast.makeText(this,"SSID:"+wifiInfo.getSSID(),Toast.LENGTH_LONG).show();
此代码为我提供了我连接到的 wifi 的 SSID。我需要移动热点的名称。
【问题讨论】: