Here you can find the source of getSocket(Context context)
public static Socket getSocket(Context context) throws IOException
//package com.java2s; import java.io.IOException; import java.net.InetSocketAddress; import java.net.Socket; import android.content.Context; public class Main { private final static String DEFAULT_HOST = "127.0.0.1"; private final static int DEFAULT_SOCKET_PORT = 9050; public static Socket getSocket(Context context, String proxyHost, int proxyPort) throws IOException { Socket sock = new Socket(); sock.connect(new InetSocketAddress(proxyHost, proxyPort), 10000); return sock; }/* w w w.ja va 2 s . c om*/ public static Socket getSocket(Context context) throws IOException { return getSocket(context, DEFAULT_HOST, DEFAULT_SOCKET_PORT); } }