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

The Archive Base Latest Questions

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

So im looking for some guidance in terms of storing data within my android

  • 0

So im looking for some guidance in terms of storing data within my android application.

At the moment, i have an XML file that stores a bunch of Restaurant elements.
i read this file when the application starts and store all the restaurants in an ArrayList.

Now i am trying to add a favorite Restaurant functionality. The only thing is, how would i store the favorite Restaurant.

Should the application read the information from the XML file and then place it into a database , or should i give an id to every Restaurant and then store their favorite Restaurant’s inside the database.

  • 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:40:05+00:00Added an answer on May 23, 2026 at 12:40 am

    XML-files are nice if you want to include data that doesn’t change. If you want to work with your data and change it, a Database is the common way.

    But do it with an SQLiteOpenHelper, where you can also define some standard-values in the onCreate-method.


    The first time your App starts (after the user installed it) and you want to access your Database through your SQLiteOpenHelper, the onCreate-method is called. In this method, you’ll want to create your needed Database-tables.

    If you want some standard data in your Database, this is also the place to add these (using some inserts).

    After that, SQLite has created a database (which is actually a file in the applications /databases-directory), the Database exists (and can be used) as long as this file is there (which should be till the user deletes the app or your app deletes the Database). So you have a persistent data-storage. So you don’t need an XML-file at all.

    If you however need to get your Data from a XML-file (like from the Web), you can use a XML-parser to get your informations from the XML-file and put them in the Database using PreparedStatement‘s.

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

Sidebar

Related Questions

I have a common scenario that I am looking for some guidance from people
Looking for some guidance. In my main window nib file, i have a tab
I am looking for some guidance. I have a data form field which I
Looking for some guidance on a WCF service I’m prototyping. I have a WCF
Being a self-confessed newbie I'm looking for some advice and guidance :) I have
looking for some help with images referenced within the stylesheet. I have no problems
Hi guys looking for some guidance, i have a knowledge of xhtml, css, javascript,
Looking for some guidance on this issue (below is a parallel example): I have
Not a great title but I'm looking more for some guidance, have searched quite
Looking for some guidance on the best way to implement this scenario: I have

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.