我正在調用一個url的應用程序。 撥打電話的方式如下:使用HttpResponse調用url
//…
public String doInBackground(String... urls){
String url = urls[0];
try {
Log.i("base","Parsing");
// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
xml = EntityUtils.toString(httpEntity);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return xml;
}
//...
new callingUrl().execute("http://www.myurl.com/directory/myxml.xml");
我想知道是否通過日誌,否則,任何人都可以看到我稱之爲
的網址,如果是這樣,反正是有隱藏?
非常感謝你提前
問候
使用'HttpURLConnection'而不是'DefaultHttpClient' ... Android團隊最積極地維護它。 – 2012-07-31 21:29:31