Android examples for Network:IP Address
Int ip Address To Dotted Decimal
//package com.java2s; public class Main { public static String ipToDottedDecimal(int ipAddress) { int a = (ipAddress >> 0) & 0xFF, b = (ipAddress >> 8) & 0xFF, c = (ipAddress >> 16) & 0xFF, d = (ipAddress >> 24) & 0xFF; return Integer.toString(a) + "." + Integer.toString(b) + "." + Integer.toString(c) + "." + Integer.toString(d); }//from www. ja va2s .co m }