Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Is this on the emulator or a phone? If you are developing on a phone and have built up a DB you want:</p> <ul> <li><p>If the phone is rooted - use a file explorer (or DDMS views file explorer) and get it from <code>/data/data/com.example.prackage/databases</code> and place it in your new package folder.</p></li> <li><p>If the phone isn't rooted - if you have the original package code, create a backup script to copy the sqlite file from the folder <code>/data/data/com.example.prackage/databases</code> - you will need to know the DB file name too. Then in the new package create the reverse of the code to copy the file from the SDCard to the new packages DB folder.</p></li> <li><p>If on the emulator - use the DDMS views file explorer to get the file from the database folder.</p></li> </ul> <p>This link may help with backup and restore:</p> <p><a href="https://stackoverflow.com/questions/2170031/backup-and-restore-sqllite-database-to-sdcard">Backup / Restore Sqlite to SDCard</a></p> <p><em>UPDATE</em></p> <p>One method, using the DDMS File explorer</p> <ol> <li>Navigate to data/data/com.old.package/databases</li> <li>Select the database file</li> <li>Click on the floppy disk with an arrow (top right of the file explorer)</li> <li>Save the file somewhere you know.</li> <li>Navigate to data/data/com.new.package/databases</li> <li>Click on the phone with an arrow.</li> <li>Find the file you just saved.</li> </ol> <p>That should copy the DB to the new package so you can use it as you did before.</p> <p>The above is a GUI for using the adb from a command prompt to copy the DB file from the old package to the new package, something like:</p> <p><code>adb pull /data/data/com.example.package/databases C:\tempdb</code></p> <p>That should make a copy of the old DB, then:</p> <p><code>adb push C:\tempdb /data/data/com.example.package/databases</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload