Guild lines for working with pre-populated sqlite database in android -


i working on pre-populated sqlite database. can please tell guide lines kind of project.

i particularity worried database update. have method copy database form assets folder data, if database not present copy database.

my question is, if in next version if add new table database if old user update app time old database present in phone new database not copy.

i search on internet found there 1 method called onupgrade (sqlitedatabase db, int oldversion, int newversion) can please tell how use method, oldversion, newversion , how method work? method add new tables old database or replace old database new one.

in solution told forcefully delete old database , replace new one, there way add new table old database if present without deleting old database.

if have blog link, video tutorial please tell me.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -