ip To Dotted Decimal : IP « Network « Android






ip To Dotted Decimal

   
//package edu.umich.jezzball.net;

import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

class Utility
{
  static final int IP_ADDRESS_LENGTH = 32;

  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);
  }

}

   
    
    
  








Related examples in the same category

1.Get Ip Address
2.Get Ip Address Text
3.get Local Ip Address
4.Int To InetAddress