android - Store object into SQLite database best practices -


i store object sqllite database. looking how best in order ensure if need updata/change object in future users of new , old object layout minimally impacted. in other words want ensure making changes object have minimum affect on clients not update software on old database format. want ensure easy update old record style new format.

i thinking add element in sql row identify object type unique name, , identify object version number. way read row , use object number control deserializer use correct version of class.

i appreciate best practices on subject.

the info start here.

basically need create subclass of sqliteopenhelper. doing way useful callbacks create/update db schema or change data.

the sqliteopenhelper.onupgrade(sqlitedatabase db, int oldversion, int newversion) callback called os automatically , accepts version params able detect whether there upgrade or downgrade , undertake needed db changes. way you'll able arrange sort of db migrations (in way rails it).


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -