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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:18:44+00:00 2026-06-09T13:18:44+00:00

I am fetching the some data from the server using XML parsing that is

  • 0

I am fetching the some data from the server using XML parsing that is not working with ICS version of Android.here is my please tell me what correction do I make so that I should also run on ICS…(It’s working fine with lower versions). Here is my code

try {
        URL url = new URL(
                "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.parse(new InputSource(url.openStream()));
        doc.getDocumentElement().normalize();
        NodeList nodeList = doc.getElementsByTagName("file");

        namephoto = new String[nodeList.getLength()];
        for (int i = 0; i < nodeList.getLength(); i++) {

            Node node = nodeList.item(i);
            Element fstElmnt = (Element) node;
            NodeList nameList = fstElmnt.getElementsByTagName("file");
            Element nameElement = (Element) nameList.item(0);
            nameList = nameElement.getChildNodes();
            namephoto[i] = ((Node) nameList.item(0)).getNodeValue();

        }
    } catch (Exception e) {
        Log.e("name", "" + e);
    }
    photobitmap = new Bitmap[namephoto.length];

    setPhotoBackground(namephoto[index_photo]);

My XML code like this.

<?xml version="1.0"?>
-<root><file>1 a.JPG</file><file>2 b.JPG</file><file>3 c.JPG</file><file>4 d.JPG</file>  </root>
  • 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-09T13:18:46+00:00Added an answer on June 9, 2026 at 1:18 pm

    i have got the solution myself.. Here is the code which is compatible with Android 4.0 as well as rest of the android versions…Just change the for loop like this.

    for (int i = 0; i < nodeList.getLength(); i++) {
                Node name = nodeList.item(i);
                NodeList nodeEle = name.getChildNodes();
                namephoto[i] = ((Node) nodeEle.item(0)).getNodeValue();
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fetching some data from a site using its API-key and some other
I'm fetching some data from an MSSQL table using the mssql_fetch_object, but the text
I'm fetching some data from FB using the following code: dynamic parameters = new
I am fetching some data from Db and displaying it in a textarea using
I've got a Windows Forms Application that does some data fetching from various places.
I'm finding that JPA is not fetching the latest data from the database. My
hi everyone i am fetching some data from a database using php, encoding it
I am fetching data from the server in a big quantity. I am using
I am fetching some data having UTF8 collation ( utf8_unicode_ci ) from a MySQL
I am fetching data from some tables & storing it in a variable like

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.