Q:

Android dev: Sync database

This is my first time writing an Android app that utilizes a database.
I have created a test database in the assets folder. I then have the app copy the database to the database folder: /data/data/myapplication1/databases/myDB.db
I realize now that the assets folders are read only, but how can I sync my database so I can verify, using SQLite browser, the changes I have made?
Should I just move my test DB from assets to a different location? Is there something better?
Or is there a way I can view the DB in the databases folder? (which I believe is protected so it is not visible to other programs)

A:

to view the database from the databases folder:

with adb on either a rooted device or an emulator, just adb pull /data/data/myapplication/databases/mydb.db.
with adb on a non-rooted/non-emulator, you can try adb shell "run-as [package.name.myapplication] cp /data/data/myapplication/databases/mydb.db /sdcard/mydb.db", and then adb pull /sdcard/mydb.db.
if you integrate stetho in your app, you can easily inspect sqlite databases from chrome.

