Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Android Database

 
hazim aleid
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
i have questions about the DB for the android,
1- i use the data as xml file, it's around 6500 row, so is it recommended to use the database or keep it xml?
2- if i'm using the database, is there a method to insert the data to the database one time (when install the application), and if i uninstall the application, how can i delete the tables from the database?

thanks.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the data change during the lifetime of the app? If so, a DB would be a better approach, because it's easier to update than an XML file. If there's a substantial amount of data with which the DB needs to be prepopulated upon installation, then shippping that data with the app as XML might be the way to go.

The DB will be automatically deleted once the app is uninstalled..
 
hazim aleid
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer,
my application only read the data, it's static but it's long rows around 6000 rows, so i think it's not recommended to read these rows from the xml, and keep it on the memory!!
true, please your advice.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
6000 records is not a large number these days, even for a mobile device (assuming that each record isn't 100KB in size). Keep in mind that Android manages memory for you, and will close applications if it needs more memory to work with.
 
hazim aleid
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic