我正在尝试创建一个简单的 android 应用程序,它将与网站进行通信。我遇到的问题是,每次我尝试使用 HttpPost Eclipse 的调试器时都会告诉我: Source not Found The JAR file C:\Users...\android-sdk\plarforms\android-16\android.jar has no源附件 您可以通过单击下面的附加源来附加源:
我试图附加一些 jar 文件,但没有任何效果。这是我的代码:
public void onClick(View v) {
URI website = null;
HttpResponse response = null;
BufferedReader in = null;
HttpClient client = new DefaultHttpClient();
try {
website = new URI("http://fakewebsite.php");
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
HttpGet getRequest = new HttpGet();
getRequest.setURI(website);
HttpPost postRequest = new HttpPost();
try {
response = client.execute(postRequest);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
感谢您的任何帮助