Monday, July 25, 2011

[android-developers] Pre - installed sqlite data vs user provided values

Hi all, hope somebody can help me with the issue I am having while finishing my app.

At the moment my app relies on a sqlite db to store / give back some kind of data. The user can of course add / delete rows from the db, and I thought it would have been nice to provide some stuff pre installed (it's full of examples on how to ship a pre built sqllite file). I am now thinking that, if I just provide a pre installed db, the user's new data will be mixed the pre installed one.

Now, what I'd really like to do is an easy way to update the data between a release and another without wiping the user's own data out. If I just overwrite the .db file, I will loose the user's own data.

I thought a possible solution would be to have two separates sqllite files, one with my pre-installed stuff (that I can update from release to release), and one with the data filled by the user (that will survive between updates). I can then use a merge cursor to display the data as if it were from one single db, but it sounds a bit tricky. 

Do you guys have some other way to achieve this result? 

Thanks in advance,

    Federico

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment