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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:01:52+00:00 2026-06-05T14:01:52+00:00

When my activity starts I check for an existing data file and if there

  • 0

When my activity starts I check for an existing data file and if there isn’t one I call a web service that provides a blank one to begin with. The file is read into an ArrayList collection and the user makes changes as needed. Now I am in need of advice for the best approach.

Should I try to match the updated contents in the ArrayList to the element in the XML file (there is an ID field that could be used for matching) or should I just write out the ArrayList overwriting the old xml file? No worries about maintaining a hx.

If I write out the file (what I’m thinking is the way to go) do I have to decorate everything in the DataObject class (ie all the properties) as serializable or just at the class level. Do I also somehow need to mark the ArrayList collection serializable as well?

  • 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-05T14:01:54+00:00Added an answer on June 5, 2026 at 2:01 pm

    There is no need to mark your ArrayList or DataObject as serializable if you just want to write it out as XML, check for e.g XStream for Basic Object to XML conversion.

    Also since you are containing the whole content in your ArrayList which means at any given point in time your ArrayList contains the updated data, if you just override the XML file it will be much easier for coding point of view as you need not do any dirty check.

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

Sidebar

Related Questions

I have an single Activity application that starts a Service and binds to it.
i have a default activity that starts first (Activity A), and from there the
I have an activity that starts with an AsyncTask to check the connection to
I have an activity that starts after a certain time. Once this activity starts,
So I have a very simple android activity that starts a timer when you
I've populated a ListActivity from a Cursor using SimpleCursorAdapter that starts another activity when
I have 4 buttons that when click starts a new activity class. This works
I have a method that I need to run when the activity starts. I've
I'm creating an intent to transfer data from one activity to another like this
My main activity does some initial things and than starts InitDBActivity. This one is

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.