除了添加这个:
uses-permission android:name="android.permission.INTERNET" /uses-permission
到清单。应用程序连接到互联网、发送 httppost 和接收 httpresponse 还需要什么,如下所示:
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(URL);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
InputStream is = httpEntity.getContent();
因为我在 XML 中得到了答案,但它告诉我找不到 API 方法(我正在使用 API)。我认为这是一个许可问题......或者不是?