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

  • Home
  • SEARCH
  • 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 7536953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:42:58+00:00 2026-05-30T06:42:58+00:00

I want to add one xml file (which has some static data related to

  • 0

I want to add one xml file (which has some static data related to my application) to my Android app. The important thing is that we can’t add the data to the string.xml file.

At the time the application is launched, it should load all static data from the xml file to my data structure.

Problems:
1. How do I add xml to my Android app using Eclipse?
2. Where should I add my custom xml? (inside the values folder OR res folder OR anywhere else?)
3. As per my understanding, we have to write an xml parser class for this, is it correct or is there any other way to automatically get the parsed xml value in Android?

  • 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-30T06:43:00+00:00Added an answer on May 30, 2026 at 6:43 am

    It’s easy.

    1. Put your xml file into \res\xml\ folder.
    2. Use XmlResourceParser to parse xml data. See the following code

      XmlResourceParser xrp = context.getResources().getXml(R.xml.your_file);
      
      xrp.next();
      int eventType = xrp.getEventType();
      while (eventType != XmlPullParser.END_DOCUMENT) {
          if (eventType == XmlPullParser.START_TAG
                  && xrp.getName().equalsIgnoreCase("your_target_tag")) {
              String attrValue = xrp.getAttributeValue(null,
                      "attribute");
              int intValue = xrp.getAttributeIntValue(null, "order", 0);
              break;
          }
          eventType = xrp.next();
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a xml file which contains data I want to insert into a
I developed small CakePHP application, and now I want to add one more table
I want to add some jQuery functionality to our sites where one piece of
I am trying to add some data received from a form to an XML
I'm making an Android app, which gets its information from XML files. I'm filling
I am currently working with a large XML file which includes <Count>123</Count> for some
I have 3 images that I want to add one after other on a
I've written a WPF UserControl, and want to add one or more of it
I want to add a Select One option to a drop down list bound
I want to add an NSMutableArray of NSStrings to one of my Entities in

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.