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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:35:53+00:00 2026-05-23T00:35:53+00:00

I created xml file getFilesDir().getAbsolutePath()+ File.separator + test.xml in this path, i want to

  • 0

I created xml file

getFilesDir().getAbsolutePath()+ File.separator + "test.xml"

in this path, i want to read xml values from this path how can i do it. please send me code for accessing file on that path. this xml is created in this path in DDMS (data/data/<packagename>/files/xmlname.xml) please help me.

Thank You,

TextView  txtoldpwd=(TextView)findViewById(R.id.txtOldPwd);
TextView txtnewpwd=(TextView)findViewById(R.id.TxtNewPwd);
File objFile=new File(getFilesDir().getAbsolutePath()+ File.separator + "test.xml");
try {
    if (objFile.exists()){
        objFile.delete();
    }
    objFile.createNewFile();
    FileOutputStream  objFileStream=new FileOutputStream(objFile);

    XmlSerializer objXmlSrl=Xml.newSerializer();
    objXmlSrl.setOutput(objFileStream,"UTF-8");
    objXmlSrl.startDocument(null, true);
    objXmlSrl.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
    objXmlSrl.startTag(null, "ChangePassword");
    objXmlSrl.startTag(null, "Oldpassword");
    objXmlSrl.text(txtoldpwd.getText().toString());
    objXmlSrl.endTag(null, "Oldpassword");
    objXmlSrl.startTag(null, "Newpassword");
    objXmlSrl.text(txtnewpwd.getText().toString());
    objXmlSrl.endTag(null, "Newpassword");
    objXmlSrl.endTag(null, "ChangePassword"); 
    objXmlSrl.endDocument();
    objFileStream.close();
} catch (Exception e) {
    // TODO: handle exception
}
  • 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-23T00:35:54+00:00Added an answer on May 23, 2026 at 12:35 am

    you can use … XmlPullParser .. to parse xml file in android.

    http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html

    Doc about xml pull parser on android developer site.
    and little article with code snippest is given here …

    http://indiheaven.blogspot.com/2011/03/xml-parsing-in-android-using.html

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

Sidebar

Related Questions

i have created an xml file from my c# application i want to use
I created an XSD file from Visual Studio and can generate a sample XML
I want to create XML file from my Excel file through .NET (c#). My
I have created XML file,but I can't view it/output it.I know there is no
HI. i am trying to open a local file from xml created by xlink
How can I create xml file with this format using c#? <?xml version=1.0 encoding=utf-8
I need help in creating a xml file from my php code. I created
I created a colors.xml file in my Android app under /res/values/colors.xml. The contents are...
I´m making a simple website to display information from XML file that is created
I am trying to create an XML file based on data fields from a

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.