Skip to content

Instantly share code, notes, and snippets.

@mide42
mide42 / Method_ipAsIntToStr.java
Created July 6, 2014 15:32
Method to convert IPv4 address contained in a single int-value into string
/**
* Get string with IPv4 address contained in a single
* int-value. This format for IP addresses is
* used by class {@link android.net.DhcpInfo}
* (public member variables, e.g. <i>gateway</i>
* or <i>dns1</i>).
*
* @param ipAsInt IP encoded as int-value
* @return String with IP address, for example <i>127.0.0.1</i>
*/