I get 5 MB of JSON response, I load and save to StringBuffer using a byte array with a size of 1024.
To parse this answer, I need to create a JSONObject with a parameter as a string. Converting the response to String, I get an out of memory exception(stringBufferVar.toString()).
From the service, I get the following response as a maximum of 5 attachments, each of which contains a maximum of 5 MB of Base64 encoded data.
Below is the response from the service.
{"result":[{"attachment":{"name":"one.doc", "type":"document", "data":"base64 encoded data max of 5MB"}, {"attachment":{"name":"two.txt", "type":"text", "data":"base64 encoded data max of 5MB"} }] }
I will show the attachments in the list when the user clicks on the item that I have to save this application to SDCard. For this, how can I parse and save this huge amount of data in JSON.
Please provide any solution for this.
Thanks in advance.
source share