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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:52:13+00:00 2026-05-24T03:52:13+00:00

The android-app I’m programming is going to have a database of products, say 150-250

  • 0

The android-app I’m programming is going to have a database of products, say 150-250 of them. Each item will have properties like name, cost, EAN-number, etc.

My first idea was to store everything in an xml-file which is loaded when the app starts and then populated into an array/map of products. The products need to be viewable in a listview and the user should be able to add more of these products through the app. Most of their properties practically never changes but a few of them do change like all the time. I don’t know if it’s a good idea to change the properties in both the product-array and the xml and then resave to the xml-file eveytime something changes at the same time. Maybe serialization would be a better option?
Though either way i suppose the file wouldn’t need to be written to for each change, I guess it could be done like when the app closes or on intervals or something(not quite sure on that one either since I’ all new to developing mobile-apps and i don’t want any of the data to get lost).
Maybe it would be a good idea to separate their “static” and “dynamic” properties in some way?

I’m quite lost here. Any suggestion as to what would be a good way to go?

Been searching around on stackoverflow and google but haven’t really been able to find something useful.

  • 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-24T03:52:14+00:00Added an answer on May 24, 2026 at 3:52 am

    Structured data that you will be accessing all the time is better-handled in a SQLite database rather than an XML file. If you go the XML route, you’ll have to write all the code to parse, query, store the data. With a database, most of these functions require far less code to write and will most likely be more efficient. There is also less potential for bugs. You also avoid having to think about when to commit changes made to your in-memory XML representation to the actual file.

    I strongly suggest you read the article on data storage and also look at the Notepad Tutorial as it demonstrates all the techniques that you would need to create, update, and query a database and integrate it with a ListView.

    It might seem like a lot of research, but your app will be a lot more flexible and bug-free if you use the built-in SQLite rather than roll your own XML-file-backed storage.

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

Sidebar

Related Questions

My Android App has a products table in an SQLite database that comes pre-populated
The android app reads from database but doesnt write anything to DB, the app
My android app will work for both normal and hdpi device. I don't want
My Android app consists of a simple tablayout (3 tabs). Let's say the user
My android app works on landscape mode. I have a listview that contains some
My Android app opens images and makes manipulations on them. My Activity requests an
I have written an Android app (target 3.2) using Eclipse 3.7, I tried to
import android.app.Activity; import android.content.ContentResolver; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts.People;
My Android app has a WebView that requires the Flash plugin. The webview will
My Android app stores its SQLite database on the SD card, so that when

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.