Created
September 29, 2011 13:36
-
-
Save stickupkid/1250733 to your computer and use it in GitHub Desktop.
Get wifi ip address for android
This file contains 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