如何找到Android设备的IP地址?

时间:2012-06-07 06:08:26

标签: android

  

可能重复:
  How to get ip address of the device?

是否可以使用某些程序?  这是我的代码

TextView ip_address = (TextView) findViewById(R.id.tv1);
WifiManager wifimanager= (WifiManager) getSystemService(WIFI_SERVICE);
List<String> lsit =  wifimanager.getConfiguredNetworks(); 
WifiConfiguration wc = (String)lsit.get(0); 
ip_address.setText("\n"+ Formatter.formatIpAddress(wifimanager.getConnectionInfo().getIpAddress()));

0 个答案:

没有答案