I have implemented a simple XML parser using the official Android guide on the XmlPullParser
to parse a very simple and short XML file (120 lines, 10.5Kb). On my HTC One X running Android 4.1.1, it takes a fraction of a second to parse it. But on my HTC Hero running Android 2.1, it took more than 3 minutes...
I know the hardware between the 2 is very different, but 3 minutes for such a small file? It's unacceptable... Especially since the XmlPullParser has been available since API 1, it makes no sense to be this slow.
To try and pinpoint the problem, I went through the parsing code step by step. And I noticed that the nextTag()
is the one that's taking a very long time to process, everything else seems considerably fast. Dunno if this is the only problem or not...
Any ideas how can I fix this?