Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9037451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:14:56+00:00 2026-06-16T09:14:56+00:00

I have implemented a simple XML parser using the official Android guide on the

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:14:57+00:00Added an answer on June 16, 2026 at 9:14 am

    After a more thorough debugging and researching I realized that the problem was not on the XmlPullParser as I suspected, it just didn’t make any sense…

    The real problem was on the fact that I was parsing a date and using SimpleDateFormat, specifying a different locale than the one currently in use. Android versions below ICS (if I’m not mistaken) have serious bugs with this and takes ages to load the needed locale information for SimpleDateFormat. Those versions loads and caches the default system locale (user setting) and Locale.US on a system boot and if any of those locales are used with SimpleDateFormat than the operation is fast. Otherwise, it’s slow as hell.

    I was also creating a new instance of SimpleDateFormat for each date parsing, which was unnecessary and stupid. Using a single object as an instance variable, decreased the time it took to parse the file considerably.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented an android program that can receive simple messages using the MJSIP,
I've got a simple C class I have implemented, using function pointers in a
Very simple Qt GUI application: On the scene I have multiple circles implemented as
I have a simple question about sending a file (XML file) from my webapp
I'm trying to parse a moderately large XML file (6mb) in php using simpleXML.
I have implemented simple com.sun.net.httpserver.HttpServer application using one of examples in the internet. Server
I have an existing android app. I added a simple widget to it using
I have implemented a simple entity ejb with a @version annotation. I expect that
I have implemented a simple linux shell in c. Now, I am adding some
I have implemented a simple RSS reader in Java. I hit a URL and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.