tcp/ip open connection
<p>currently i am using the following code to interact with server</p>

<pre><code>  public String connectToserverforincomingmsgs(String phonurl, String phno)
        throws IOException {
    URL url = new URL(phonurl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setDoInput(true);

    // Allow Outputs
    con.setDoOutput(true);
    con.connect();
    BufferedWriter writer = null;
    writer = new BufferedWriter(new OutputStreamWriter(
            con.getOutputStream(), "UTF-8"));
    // give server your all parameters and values (replace param1 with you
    // param1 name and value with your one's)
    writer.write("sender_no=" + phno);

    writer.flush();

    String responseString = "";

    BufferedReader reader = null;
    reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;

    while ((line = reader.readLine()) != null) {
        responseString = responseString.concat(line);
    }
    con.disconnect();
    return responseString;

}
</code></pre>

<p>how could i make tcp connection .right now i don't have any idea . i am new to android and java aswell so any sample code about the tcp connection would be appreciated</p>
