Android IP Address Get getIPAddr()

Here you can find the source of getIPAddr()

Description

get IP Addr

License

Open Source License

Declaration

public static String getIPAddr() 

Method Source Code

//package com.java2s;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class Main {
    public static String getIPAddr() {
        InetAddress Address = null;
        try {/*from w  w w  .  j  a  va  2  s  .  com*/
            Address = InetAddress.getLocalHost();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        return Address.getHostAddress();
    }
}

Related

  1. getByteAddress(BluetoothDevice device)
  2. getInetIpAddress()
  3. getLocalIpAddress()
  4. getIPAddress(boolean useIPv4)