while establishing connection with server,getting the localhost address i did
try {
InetAddress here = InetAddress.getLocalHost ();
hostname = here.getHostName ();
logDisplay.append ( "host = "+hostname+"\n" );
}
catch (UnknownHostException e) { ;}
is this the coorect approach