Here you can find the source of getXML(String url)
public static String getXML(String url)
//package com.java2s; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.params.BasicHttpParams; import org.apache.http.params.HttpParams; import org.apache.http.util.EntityUtils; import android.util.Log; public class Main { public static String getXML(String url) { String responseBody = ""; try {//w w w .j a v a 2 s. co m HttpParams httpParameters = new BasicHttpParams(); DefaultHttpClient httpClient = new DefaultHttpClient( httpParameters); HttpPost httpPost = new HttpPost(url); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); responseBody = EntityUtils.toString(httpEntity); } catch (Exception e) { e.printStackTrace(); responseBody = "Exception"; Log.e("info", "Exception :couldn't connect to server"); return responseBody; } return responseBody; } }