Nilesh Tupe Nilesh Tupe - 1 year ago 108
Android Question

How to get IP address of the device?

Is it possible to get the IP address of the device using some code?

Answer Source

This worked for me:

WifiManager wm = (WifiManager) getSystemService(WIFI_SERVICE);
String ip = Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress());
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download