Android Socket with .net
<p>I set a button in an Android program to connect to .net PC.</p>

<p>Here is my code:</p>

<pre><code>public void onClick(View v) {
    // TODO Auto-generated method stub
    if(v==btn_con){
        try{
            s=new Socket("xxx.xxx.xxx.xxx", xxxx);
            BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream()));
            String str=in.readLine();
            Toast t=Toast.makeText(this, str, Toast.LENGTH_LONG);
            t.show();
            _isconnected=true;
        }catch(Exception e){
           Toast t=Toast.makeText(this, "链接发生错误"+e.getMessage(), Toast.LENGTH_LONG);
           t.show();
           System.out.println("连接发生错误："+e.getMessage());
        }
    }
</code></pre>

<p>When I run the program it throws a Permission denied exception. I have run a .net service program; this is a client Android program. If I run a Java client it has no such problem. When I run the Android program in my phone, I don't know how to solve the problem.</p>
