亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

android連接wifi時(shí)獲取廣播地址代碼

 更新時(shí)間:2012年12月25日 10:27:16   作者:  
本文詳細(xì)介紹android連接wifi時(shí)獲取廣播地址的方法,需要了解的朋友可以參考下,獲取對(duì)你有所幫助
復(fù)制代碼 代碼如下:

private InetAddress getBroadcastAddress() throws IOException {
WifiManager myWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
DhcpInfo myDhcpInfo = myWifiManager.getDhcpInfo();
if (myDhcpInfo == null) {
System.out.println("Could not get broadcast address");
return null;
}
int broadcast = (myDhcpInfo.ipAddress & myDhcpInfo.netmask)
| ~myDhcpInfo.netmask;
byte[] quads = new byte[4];
for (int k = 0; k < 4; k++)
quads[k] = (byte) ((broadcast >> k * 8) & 0xFF);
return InetAddress.getByAddress(quads);
}

相關(guān)文章

最新評(píng)論