0

我尝试了以下代码,但不断得到:

ndroidlib.conn.HttpHostConnectException: Connection to http://10.0.2.2:8080 refused

 HttpClient httpclient = new DefaultHttpClient();
        // Execute the request
        HttpResponse response;
        String postURL = "http://10.0.2.2:8080/users/";
        HttpGet httpget = new HttpGet(postURL);
        response = httpclient.execute(httpget);

我的清单中有

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
4

0 回答 0