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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:58:47+00:00 2026-06-15T22:58:47+00:00

In my application the user can download an XML file witch is stored on

  • 0

In my application the user can download an XML file witch is stored on the internal memory. Is there a way to pass this file given its absolute path to a XMLPullParser ?

  • 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-15T22:58:49+00:00Added an answer on June 15, 2026 at 10:58 pm

    Since the file saved internally you don’t need absolute path you just need the file name:

    final String xmlFile="fileName";
     FileInputStream fis = null;
                InputStreamReader isr = null;
                char[] inputBuffer = null;
                String data = null;
                ArrayList<String> items = new ArrayList<String>();
                try {
                    fis = getApplicationContext().openFileInput(xmlFile);
                    isr = new InputStreamReader(fis);
                    inputBuffer = new char[fis.available()];
                    isr.read(inputBuffer);
                    data = new String(inputBuffer);
                    isr.close();
                    fis.close();
                    } catch (FileNotFoundException e3) {
                    // TODO Auto-generated catch block
                        e3.printStackTrace();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                XmlPullParserFactory factory = null;
                try {
                    factory = XmlPullParserFactory.newInstance();
                    } catch (XmlPullParserException e2) {
                    // TODO Auto-generated catch block
                    e2.printStackTrace();
                    }
                factory.setNamespaceAware(true);
                XmlPullParser xpp = null;
                try {
                    xpp = factory.newPullParser();
                    } catch (XmlPullParserException e2) {
                    // TODO Auto-generated catch block
                    e2.printStackTrace();
                    }
                try{
                    xpp.setInput( new StringReader (data) );
                    } catch (XmlPullParserException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                    }
                 int eventType = 0;
                 try{
                     eventType = xpp.getEventType();
                    } catch (XmlPullParserException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                    }
                 while (eventType != XmlPullParser.END_DOCUMENT){
                     if(eventType == XmlPullParser.START_DOCUMENT) {
                         System.out.println("Start document");
                     }else if(eventType == XmlPullParser.START_TAG) {
                         System.out.println("Start tag "+xpp.getName());
                     }else if(eventType == XmlPullParser.END_TAG) {
                         System.out.println("End tag "+xpp.getName());
                     }else if(eventType == XmlPullParser.TEXT) {
                         items.add(xpp.getText());
                     }
                     try{
                         eventType = xpp.next();
                    }catch (XmlPullParserException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                    }
                 }
                String item1=contact.get(0);
            String item2=contact.get(1);
            String item3 = contact.get(2);
            String item4=contact.get(3);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my struts application, a user can download a file from the server. I
Our Application deployment structure is something like this: User can download the application form
In my application user can add there reminder for the specific day and reminder
I would like to in my application user can download content on http, but
in my application,user can download and play videos from different video sites like bofunk.com,dailymotion.com,youtube.com,metacafe.com,stupid
I've developed an application in which user can download .mp3 files from server. And
I am currently developing a web application in which the user can download some
I have a site where a user can download a file. Some files are
I've got an xml file stored in a database blob which a user will
I have an application where user can download documents. User has option to download

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.