4
我試圖用android連接mysql,但它會給我一個錯誤。 錯誤HTTP連接的java.net.UnknownHostException:Android - HTTP連接錯誤java.net.UnknownHostException:
下面是我的代碼:
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.pherma.net84.net/admin/getAllPeopleBornAfter.php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
但URL s工作的罰款。請複製n貼上網址。
設備的網絡連接是否正常工作?你有沒有在你的AndroidManifest中指定'internet'權限? – Floern
刪除此行httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); –
它的作品現在...我的壞....沒有給予網絡的許可 –