android - How do I dump my sqlite db back into my assets folder -
i have succeeded in generating sqlite3 database in android app initial sqlite3 file in assets folder. helpful have similar routine dump modified database folder a) verify updates/inserts/deletes working correctly , b) possible way pass bulk revisions process.
does have utility this?
i don't think if can that. if want save data inserted, can keep database in /database folder, in order database not rewritten (think of this: when start app, code again writes database asset folder /database folder, have old data again) this
file filedb = new file("data/data/[package-name]/databases/"+database_name); if( !filedb.exist()) { //if database file not exist, means database not copied asset folder /database folder, copying, }
with test have prevented database in /database folder rewriten database have in asset folder. verify if inserting/deleting/updateing working fine, pull out database file emulator , open sqlite browser. don't forget put in assets ;)
cheers.
Comments
Post a Comment