android 如何获取wifi内的主机 wifi连接后怎么获取其余连接的pc的ip地址
发布网友
发布时间:2022-04-26 15:44
我来回答
共2个回答
热心网友
时间:2023-10-12 15:12
WifiManager wifi_service = (WifiManager) getSystemService(WIFI_SERVICE);
WifiInfo wifiinfo = wifi_service.getConnectionInfo();
Log.v("getBSSID", wifiinfo.getBSSID() + "");
Log.v("getHiddenSSID", wifiinfo.getBSSID() + "");
Log.v("getIpAddress", wifiinfo.getIpAddress() + "");
Log.v("getLinkSpeed", wifiinfo.getLinkSpeed() + "");
Log.v("getMacAddress", wifiinfo.getMacAddress() + "");
Log.v("getNetworkId", wifiinfo.getNetworkId() + "");
Log.v("getRssi", wifiinfo.getRssi() + "");
Log.v("getSSID", wifiinfo.getSSID() + "");
DhcpInfo dhcpinfo = wifi_service.getDhcpInfo();
Log.v("ipaddr", dhcpinfo.ipAddress + "");
Log.v("gatewau", dhcpinfo.gateway + "");
Log.v("netmask", dhcpinfo.netmask + "");
Log.v("dns1", dhcpinfo.dns1 + "");
Log.v("dns1", dhcpinfo.dns2 + "");
Log.v("serverAddress", dhcpinfo.serverAddress + "");
热心网友
时间:2023-10-12 15:13
你想做什么呢?