Created
June 21, 2021 13:38
-
-
Save u-r-w/5a64856f4d71c73cbc2794e0b828387f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); | |
WifiInfo wifiInfo = wifiManager.getConnectionInfo(); | |
int ipAddress = wifiInfo.getIpAddress(); | |
String ipString = String.format("%d.%d.%d.%d", (ip & 0xff), (ip >> 8 & 0xff), (ip >> 16 & 0xff), (ip >> 24 & 0xff)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment