• Thursday, September 25, 2014

    GET ALL LOCAL IP ADDRESS in Java, Android

    How to get all connected local ip address.

    String myIP=Inet4Address.getLocalHost().getHostAddress();

    for(int i=1;i<=255;i++)
    {
    int pos=myIP.lastIndexOf(".");
    String temp=myIP.substring(0,pos) + "." + i;
    System.out.println("IP Address: " +temp);
    }


    Syed Masoom Rizvi

    Author & Editor

    Hi, This is Syed Masoom Rizvi, who is continue exploring the world of programming ,programming and programming... :)

    0 comments:

    Post a Comment