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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -