Convert int To Ip address - Android java.net

Android examples for java.net:IP Address

Description

Convert int To Ip address

Demo Code

import android.text.TextUtils;

public class Main{


    public static String intToIp(int i) {
        return (i & 0xFF) + "." + ((i >> 8) & 0xFF) + "."
                + ((i >> 16) & 0xFF) + "." + (i >> 24 & 0xFF);
    }/*from  w w w.  ja va2 s. c o m*/

}

Related Tutorials