In my application, i am using ksoap2 for retrieving data from .net web service. Data which we are transferring is in format called "xml string". It works fine if i accesses 1000 item records. But When i am trying to access 12000 item records from server it is giving "Out of memory on an 5943816 byte allocation" error in my logcat.
////////////////// My code for retrieving data from server,
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
request.addProperty("myparameter", myparameter);
envelope.dotNet = true;// to handle .net services asmx/aspx
envelope.setOutputSoapObject(request);
HttpTransportSE ht = new HttpTransportSE(MyURL);
ht.debug = true;
ht.call(SOAP_ACTION, envelope);
// to change dialog
publishProgress("Moving data file");
SoapObject resultString = (SoapObject) envelope.getResponse();
//////////////////
I know that this is because of heap size problem. But i dont know how to solve this, If any one have solution for this please help me..
Finally i found a way to solve the above problem, First i modified the .net service to return the number of lines the xml contains. Then i will request for bulk numbers of line which is under the heap size from service and write it into the local file. I repeat this until i get the last line in the xml from the server. After completing all lines, i use file for my further process.