[태그:] android.permission.INTERNET


  • 안드로이드에서 IP주소 구하기

    public String getLocalIpAddress(){ final String IP_NONE = “N/A”; final String WIFI_DEVICE_PREFIX = “eth”; String LocalIP = IP_NONE; try { NetworkInterface.getNetworkInterfaces(); for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); for (Enumeration enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { InetAddress inetAddress… “read more”