How to verify SQLite database is set up properly in Android
Hi I'm checking if there is a fast way of checking if the sqlite database has been 开发者_StackOverflowset up properly in android ?
Anyway to printf it ? or anyway to quickly see it ?
Thank you !
Firstly, check that you can find the Database in the File Explorer:
data/data/<package_where_DB_is_created>/databases/<db_name>.db
You can then export that using the "Pull a file from the device" option in the top right. Finally, you can use SQLiteBrowser ( http://sourceforge.net/projects/sqlitebrowser/ ) or similar to check that the contents match your expectations.
Additionally, I am sure you have tested with running INSERT
and whatnot commands on it? I didn't do much testing on my DB except verifying that everything worked smoothly when I added and gathered entries from it (as that is all it does, being a rather simple one).
Alternatively you can run adb, go into shell mode, and run sqlite3 on the device.
精彩评论