I developed an android application using web services. Here i am calling web services to get data from server and showed in my application views. Application is working fine but calling web services is gave me performance issues. It will take more time to get data.
I am using the below code to call api and used handler to parse the data. And my result is in XML format. I am using SAX parser to parse data. I don't know why the application is very slow to get data and parse. Please provide me good performance service hint for me.
Here is my api calling code:
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
StringEntity entity = null;
entity = new StringEntity(xmlRequest, HTTP.UTF_8);
httppost.setHeader("Content-Type", "text/xml");
httppost.setEntity(se);
BasicHttpResponse httpResponse = (BasicHttpResponse) httpclient.execute(httppost);
InputStream is = httpResponse.getEntity().getContent();
I am converting this input stream to string builder and parsing.
Thanks in advance.