How can I access my Sqlite database after changing package name in Android? -
in order publish android app had change package name com.example.project had used during development. although, after changed package name cannot access sqlite database longer. tried accessing through .adb, , works old package-name not new one.
how can access db in order put under new package? have copy of old un-altered project file.
many thanks! ak
is on emulator or phone? if developing on phone , have built db want:
if phone rooted - use file explorer (or ddms views file explorer) ,
/data/data/com.example.prackage/databases
, place in new package folder.if phone isn't rooted - if have original package code, create backup script copy sqlite file folder
/data/data/com.example.prackage/databases
- need know db file name too. in new package create reverse of code copy file sdcard new packages db folder.if on emulator - use ddms views file explorer file database folder.
this link may backup , restore:
backup / restore sqlite sdcard
update
one method, using ddms file explorer
- navigate data/data/com.old.package/databases
- select database file
- click on floppy disk arrow (top right of file explorer)
- save file somewhere know.
- navigate data/data/com.new.package/databases
- click on phone arrow.
- find file saved.
that should copy db new package can use did before.
the above gui using adb command prompt copy db file old package new package, like:
adb pull /data/data/com.example.package/databases c:\tempdb
that should make copy of old db, then:
adb push c:\tempdb /data/data/com.example.package/databases
Comments
Post a Comment