Java tutorial
//package com.java2s; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; public class Main { private static String getIpAddr(WifiManager wifiManager) { WifiInfo wifiInfo = wifiManager.getConnectionInfo(); int ip = wifiInfo.getIpAddress(); String ipString = String.format("%d.%d.%d.%d", (ip & 0xff), (ip >> 8 & 0xff), (ip >> 16 & 0xff), (ip >> 24 & 0xff)); return ipString; } }