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 7036781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:27:54+00:00 2026-05-28T01:27:54+00:00

I receive 360K of data from a server which I transform into a XML

  • 0

I receive 360K of data from a server which I transform into a XML file on my phone. The final file is about 1.3 Mb. Later, I try to read this file and on my GT-S5660 and this process runs for 5(!) hours. Although it produces a correct result I wonder if there is a way to optimize this process. I have an iphone version of it, and there the process completes in less than 5 seconds.
Is this a normal behaviour? If so, would SQLIte be an alternative?
Here’s my code:

FileInputStream fileos;
    try {
        fileos = openFileInput("TarifsCache" + Constants.VERSION + ".txt");
    } catch (FileNotFoundException e) {
        return;
    }
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db;
    try {
        db = dbf.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
        return;
    }
    Document doc;
    try {
        doc = db.parse(new InputSource(fileos));
    } catch (SAXException e) {
        return;
    } catch (IOException e) {
        return;
    }
    doc.getDocumentElement().normalize();

    for (int i = 0;; i++) {

        NodeList nodeList = doc.getElementsByTagName("Cache" + i);

        Node node = nodeList.item(0);
        if (node == null)
            break;
        Element fstElmnt = (Element) node;

        NodeList nameList = fstElmnt.getElementsByTagName("area_ref");
        Element nameElement = (Element) nameList.item(0);
        nameList = nameElement.getChildNodes();
        tarifread.area_ref = Integer.parseInt(((Node) nameList.item(0))
                .getNodeValue());

followed by plenty of other element retrievals.

  • 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-05-28T01:27:55+00:00Added an answer on May 28, 2026 at 1:27 am

    Try to use advance parser parser like SAX and dnt use STAX as its not support in android .

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

Sidebar

Related Questions

I receive input from the server in the following manner (sample input data): [1284336000]:
I receive a daily XML file which I use to update a database with
I receive an array from a server which contains objects and association tables. So
I receive Date and time from CSV file The received Date format is YYYYMMDD
I receive a daily XML file that contains thousands of records, each being a
I receive a get request from server, but is encrypted with a simple algorithm
I receive a JSON response in an Ajax request from the server. This way
I receive from socket a string in a byte array which look like :
I receive json from a webservice into a NSMutableData. That gets converted into a
I receive a an xml string from third party. The xml string contains invalid

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.