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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:02:48+00:00 2026-06-12T07:02:48+00:00

I am really lost here, i am trying to find my way around xml

  • 0

I am really lost here, i am trying to find my way around xml parsing, reading and writing.

I have this app where at one point i can input data such as a Date and a time for instance – click save, and once it saved it will write into an existing XML file, for later reading, and add it at the end in a format like this:

<Units>
 <item>
   <date>27-5-12</date>
   <time>15:30</time>
 </item>
 <item> 

   ... and so on ...

</Units>

i managed to read an xml file, but i am really having trouble in opening a premade – existing file for reading or writing.

currently i tried this code:

InputStream raw = this.getAssets().open("mydata.xml");
Reader is = new BufferedReader(new InputStreamReader(raw, "UTF8"));

which returns file not found exception.

could anyone direct me on what i should look for?

Thanks.

  • 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-12T07:02:50+00:00Added an answer on June 12, 2026 at 7:02 am

    As written, your source XML file is located in your APK’s assets directory – everything in your APK is read-only, so you won’t be able to write to that file. (Also, you should probably put that XML data into the res/xml directory instead of the assets directory, unless you have a compelling reason to do otherwise.)

    If the XML file isn’t very long/complex, you could read the assets file into a structure, then add your new data to that structure, and write a new XML file into your app’s data directory with the updated data. This approach has the advantage that you can have multiple source files feeding into one main file per app.

    A more flexible and open-ended option would be to set up a database table. When the app is first installed, you load/update the table with data from the assets file. As your app keeps adding timestamped data, you just add new rows to the table. This approach also has the advantage that you can easily update the source data or the database structure with each app update – it’s harder to compare old vs new data if it’s stored internally in XML format.

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

Sidebar

Related Questions

I am really at a loss here, and have been trying to find a
Really ripping my hair out on this one. I have a JAAS Authentication Provider
I have a really tricky thing going up here. My project has around 100
I'm really lost on this case. I am trying to apply a custom MVC
I am really lost trying to configure FOSOAuthServerBundle. I think I have correctly installed
This is probably really easy, but I'm lost on how to make sure it
Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return
I have been trying to figure out how to implement a simple xml rpc
I'm really confused here. Let's say my user story looks like this. A user
Maybe I'm going about it the wrong way. Here is what I'm trying to

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.