How can I get the ip address of my phone when it is connected under wifi?
I found a method here but it returns something like 24.182.239.255 even if I\'m under wifi
Add Following Permission.
WifiManager initialize in onCreate.
WifiManager wifiMgr = (WifiManager) getContext().getSystemService(context.WIFI_SERVICE);
Use following function.
public void WI-FI_IP() {
WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
int ip = wifiInfo.getIpAddress();
String ipAddress = Formatter.formatIpAddress(ip);
}