2013-04-17 36 views
0

即時通訊嘗試連接其他設備與我的android應用程序使用wifimanager.im獲取ip地址o我的android設備使用此code.but我無法得到我的android設備端口號與wifi.How獲取它? ??請幫幫我!!!!在此先感謝...如何使用wifimanager設置android設備的端口號?

wifiManager = (WifiManager)context.getSystemService(context.WIFI_SERVICE); 
    wifiInfo = wifiManager.getConnectionInfo(); 
     int ipAddress = wifiInfo.getIpAddress(); 
     ip_Address=String.format("%d.%d.%d.%d",(ipAddress & 0xff),(ipAddress >> 8 &  `0xff),(ipAddress >> 16 & 0xff),(ipAddress >> 24 & 0xff)); 

`

回答

相關問題