xml - Choosing Best Storage Type in Android -


there many similar questions issue have clear points question ask you.

i new @ android development , before developed small applications store small sized data. example country list, calendar, birthday reminder etc. stored small data in single xml file , parsed easy methods. enough me. mobile application development course took project store huge static data.

specifications of project these:

  • there 200 entities.
  • each entity has 20 sub categories stored in text format.
  • each sub category has 30-sub categories stored again in text format.
  • also each parent entity have 2-3 image

if calculate simply, have store 200 x 20 x 30 = 120.000 static data application , data not change. install , use application. online data interaction not necessary. (if there changes data relase major updates in long periods of time.)

my question storing method.

which way should choose? sqlite or xml parsing? answer can explain advantages / disadvantages choice?

interesting project, although not realistic.

to manage large amount of "static" data, you'll want database. xml parsing forces store data in memory, means have read memory on regular basis. remember can't count in-memory data being around when user goes app; android may have destroyed app previously.

on other hand, can use sqlite database on disk directly app. it's persistent, if app goes away. you'll have load database once, when install app.

consider wrapping sqlite database in content provider. will, among other things, allow asynchronous queries using cursorloader.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -