可能重复:
如何获取设备的 IP 地址?
是否可以使用某些程序?这是我的代码
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()));