K
K
KOS_MOS2012-01-18 17:30:53
Android
KOS_MOS, 2012-01-18 17:30:53

XML is parsed very slowly under Android

I parse the xml-file as follows: If you run the code in a normal application, the code is executed in a fraction of a second. Under Android - 20 seconds.

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(false);
factory.setValidating(false);
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(is);


Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sadyjka, 2012-01-18
@sadyjka

How big is the XML?

P
palmut, 2012-01-19
@palmut

Try better to use XMLPullParser. Works many times faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question