安卓可以做到,如果下:
var Context = plus.android.importClass("android.content.Context");
var WifiManager = plus.android.importClass("android.net.wifi.WifiManager")
var wifiManager = plus.android.runtimeMainActivity().getSystemService(Context.WIFI_SERVICE);
var List = plus.android.importClass("java.util.List");
var ArrayList = plus.android.importClass("java.util.ArrayList");
var ScanResult = plus.android.importClass("android.net.wifi.ScanResult");
// 获取当前连接WIFI的信息
var wifiInfo = plus.android.invoke(wifiManager, "getConnectionInfo");
var mac = plus.android.invoke(wifiInfo, "getMacAddress");
var wifisList = new ArrayList();
wifisList = wifiManager.getScanResults();
alert(wifiManager.getScanResults());
var wifisInfo = '';
for (var i = 1; i < wifisList.size() ; i++) {
wifisInfo += wifisList.get(i).plusGetAttribute('SSID') + '\r\n' + wifisList.get(i).plusGetAttribute('BSSID') + '\r\n';
}
alert(wifisInfo);
5***@qq.com
native 怎么写?求大佬文档
2019-03-19 14:20