0

Is there a way to get the IP address of the device without using Wi-Fi?

I just find how to get IP from Wi-Fi connection:

WifiManager wifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE);
WifiInfo connectionInfo = wifiManager.getConnectionInfo();
int ipAddress = connectionInfo.getIpAddress();

But now I'm searching how to get it without Wi-Fi. Just using the mobile type network.

halfer
  • 19,824
  • 17
  • 99
  • 186
NullPointerException
  • 36,107
  • 79
  • 222
  • 382

0 Answers0