tags:

views:

93

answers:

1

Hi,

There are some things my application needs to do on first start up(first startup after update) . These actions could be described in a .txt file and then when it is the case read the file and do according to it ,or on the other hand (I lean to use this option) a sqlite database could be used to store the information . The apk file would be shipped with an .txt file/prebuild sql db stored in res/raw or res.asset and then copied into proper space and used. This I have figured out how !, though I'm not sure which option of this two would be the fittest ? One thing that is unclear to me is how could sqlite version mismatch affect me, and if it serious enough to take into consideration ? I 'm using Android api level 4 (Android 1.6) and the future application might be used on several different devices , with different api levels.

A: 

These actions could be described in a .txt file and then when it is the case read the file and do according to it ,or on the other hand (I lean to use this option) a sqlite database could be used to store the information .

Or, they could be implemented in Java.

Well the actions that the application needs to perform on install / after update , according to the update version and the pre update version of the application

Why not just implement this as regular Java code in your app?

Or, as Albert Einstein wrote, in homage to Occam's Razor: "Make everything as simple as possible, but not simpler."

CommonsWare
Yes , it could be done this way if the number of actions was limited or at least known for all future updates ,but this is unpredictable. Consider for example deleting 20 files and downloading 30 new ones . Plus you still need a way to persist the result of the operation between application runs, as to avoid doing the same thing at startup over again.
rantravee
While not succeding to delete a file is ok, and probably should be a one time try, downloading a file is criticall and the app must try it until it succeeds so it must have this information persisted .
rantravee
And most important , as I said the actions described are to be done on application update, and the update must work no matter the version of the application when the user performs it (one might update from version 3 to 4 , and other from 1 to 4, but if the last update describes (in code) only the actions to be performed on updating from 3 to 4 , this will probably crash the latter's application)
rantravee
For these reasons I consider a persistent way of storing all actions to be done ,(from version 1 to n)..., so my question was more about the consideration to take when using an sqlite db.
rantravee