Here is Some sample Code!!
public static Socket sock=new Socket();
public static Socket recvsock;
public static SocketInfo ipinfo;
public static void setSocket(Socket socket)
{
sock=socket;
Log.d(handsOn.Tag, ""+sock.getInetAddress());//Dis log fuction is bcoz i m coding for n Android .. same as System.out.println()
}
public static Socket getSocket()
{
Log.d(handsOn.Tag, "sock"+sock.getInetAddress());
return sock;
}