View contents of database file in Android Studio

I have been using Android Studio to develop my app since it’s was released. Everything works nice until recently, I have to debug together with checking the database file. Since I don’t know how to see the database directly, When I debugged to generate the database file, I have to export the database file from … Read more

When does SQLiteOpenHelper onCreate() / onUpgrade() run?

I have created my tables in my SQLiteOpenHelper onCreate() but receive SQLiteException: no such table or SQLiteException: no such column errors. Why? NOTE: (This is the amalgamated summary of tens of similar questions every week. Attempting to provide a “canonical” community wiki question/answer here so that all those questions can be directed to a good … Read more

How can you access the contents of Android Emulator databases?

I’ve read the answer to a question as to how to access the contents of the databases, however I cannot seem to get it to work on my machine. Here is the shell log: C:\android-sdk-windows\tools>adb -s emulator-5554 shell # sqlite3 /data/data/com.android.demo.notepad2/databases/notes sqlite3 /data/data/com.android.demo.notepad2/databases/notes SQLite version 3.5.9 Enter “.help” for instructions sqlite> .tables .tables sqlite> ^C … Read more