I was looking at some pages with tutorials to see how to get XML from url and to display a data from it on phone, but I only found http connection.
I need to get data from url but I cannot connect to server using http I need to use https
try {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("https:...");
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
line = EntityUtils.toString(httpEntity);
line = con.getResponseMessage();
//con.getResponseMessage();
} catch (UnsupportedEncodingException e) {
line = "<results status=\"error\"><msg>Can't connect to server</msg></results>";
} catch (MalformedURLException e) {
line = "<results status=\"error\"><msg>Can't connect to server</msg></results>";
} catch (IOException e) {
line = "<results status=\"error\"><msg>Can't connect to server</msg></results>";
}
How can I change this fragment to use https? Is there any tutorial to get xml from https?