I'm trying to parse a large file in android.The xml file size exceeds 2Mb. I'm using this code:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder db = factory.newDocumentBuilder();
InputSource inStream = new InputSource();
inStream.setCharacterStream(new StringReader(XMLResponse));
Document doc = db.parse(inStream);
I got an outofmemory error and I dont know how to fix this problem! I'm working on a Xperia arc device!