java.net.SocketException: Permission denied for android
<p>I create my android application to link "www.google.com" . But I always get the Exception like that:</p>

<pre><code>07-20 16:50:31.137: W/System.err(19007): java.net.SocketException: Permission denied
07-20 16:50:31.137: W/System.err(19007):    at org.apache.harmony.luni.platform.OSNetworkSystem.socket(Native Method)
07-20 16:50:31.137: W/System.err(19007):    at dalvik.system.BlockGuard$WrappedNetworkSystem.socket(BlockGuard.java:335)
07-20 16:50:31.137: W/System.err(19007):    at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:219)
07-20 16:50:31.137: W/System.err(19007):    at java.net.Socket.checkOpenAndCreate(Socket.java:832)
07-20 16:50:31.137: W/System.err(19007):    at java.net.Socket.connect(Socket.java:978)
07-20 16:50:31.137: W/System.err(19007):    at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
07-20 16:50:31.137: W/System.err(19007):    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143)
07-20 16:50:31.137: W/System.err(19007):    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
07-20 16:50:31.147: W/System.err(19007):    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
07-20 16:50:31.147: W/System.err(19007):    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
07-20 16:50:31.147: W/System.err(19007):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
07-20 16:50:31.147: W/System.err(19007):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
07-20 16:50:31.147: W/System.err(19007):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
07-20 16:50:31.147: W/System.err(19007):    at com.xenos.httpclienttest.HttpClientTest$1.onClick(HttpClientTest.java:60)
07-20 16:50:31.147: W/System.err(19007):    at android.view.View.performClick(View.java:2532)
07-20 16:50:31.147: W/System.err(19007):    at android.view.View$PerformClick.run(View.java:9291)
07-20 16:50:31.147: W/System.err(19007):    at android.os.Handler.handleCallback(Handler.java:587)
07-20 16:50:31.147: W/System.err(19007):    at android.os.Handler.dispatchMessage(Handler.java:92)
07-20 16:50:31.147: W/System.err(19007):    at android.os.Looper.loop(Looper.java:150)
07-20 16:50:31.147: W/System.err(19007):    at android.app.ActivityThread.main(ActivityThread.java:4293)
07-20 16:50:31.147: W/System.err(19007):    at java.lang.reflect.Method.invokeNative(Native Method)
07-20 16:50:31.147: W/System.err(19007):    at java.lang.reflect.Method.invoke(Method.java:507)
07-20 16:50:31.147: W/System.err(19007):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
07-20 16:50:31.147: W/System.err(19007):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
07-20 16:50:31.147: W/System.err(19007):    at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>and I also add the permission into the Manifest.xml </p>

<pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xenos.study.httpclienttest"
android:versionCode="1"
android:versionName="1.0" &gt;

&lt;uses-sdk android:minSdkVersion="10" /&gt;
&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
&lt;application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" &gt;
    &lt;activity
        android:name=".HttpClient"
        android:label="@string/app_name" &gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.MAIN" /&gt;

            &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;
&lt;/application&gt;
</code></pre>

<p></p>

<p>The whole code is here : </p>

<pre><code>public class HttpClientTest extends Activity {


private HttpClient httpClient ;
private HttpGet httpGet ;
private HttpResponse httpResponse ;
private HttpEntity httpEntity ;

private BufferedReader br ;
private Button link ;
private EditText show ;

private String path = "http://74.125.71.104";

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    link = (Button) findViewById(R.id.link);
    show = (EditText) findViewById(R.id.show);


    httpClient = new DefaultHttpClient () ;
    httpGet = new HttpGet(path);



    link.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            try {
                httpResponse = httpClient.execute(httpGet);
                httpEntity = httpResponse.getEntity();
                br = new BufferedReader(new InputStreamReader(httpEntity.getContent()));

                String str = null ;
                while ((str = br.readLine())!=null) {

                }
            } catch (ClientProtocolException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

        }
    });

    }
  }
</code></pre>

<p>It makes me gloomy , thanks for your help.</p>
