public static String getInfo()
{
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo info = wifi.getConnectionInfo();
String maxText = info.getMacAddress();
String ipText = intToIp(info.getIpAddress());
String status = "";
if (wifi.getWifiState() == WifiManager.WIFI_STATE_ENABLED)
{
status = "WIFI_STATE_ENABLED";
}
String ssid = info.getSSID();
int networkID = info.getNetworkId();
int speed = info.getLinkSpeed();
return "mac:" + maxText + "
"
+ "ip:" + ipText + "
"
+ "wifi status :" + status + "
"
+ "ssid :" + ssid + "
"
+ "net work id :" + networkID + "
"
+ "connection speed:" + speed + "
"
;
}
private String intToIp(int ip)
{
return (ip & 0xFF) + "." + ((ip >> 8) & 0xFF) + "." + ((ip >> 16) & 0xFF) + "."
+ ((ip >> 24) & 0xFF);
}
结伴旅游,免费的交友网站:www.jieberu.com
推推族,可以免费得门票,游景区哦:www.tuituizu.com