I'm new to Android, I've just gotten to the point where I can create an SQLite database from my app (I'm using Eclpise with Android SDK and the emulator, I made the SQL code in a separate designer and then just pasted it). After getting rid of a few initial errors, the SQLiteOpenHelper-descendant class initialization code ran without any exceptions, so I'm assuming the database has been created (and presumably persisted in a file). Is there a way I could access the database and examine it? (I mean other than from the actual app, which at this point has no functionality to speak of) I'd like to have a look at the database structure, and later when the app gradually becomes capable of adding data, I'd like to be able to chcek if it's working properly. Is there a way to do this? Thanks.
Open a command prompt (cmd.exe) and 'cd' to the folder location of the SQL_SAFI. sqlite database file. run the command 'sqlite3' This should open the SQLite shell and present a screen similar to that below.
Select the Database Inspector tab. Select the running app process from the dropdown menu. The databases in the currently running app appear in the Databases pane. Expand the node for the database that you want to inspect.
The Android SDK provides dedicated APIs that allow developers to use SQLite databases in their applications. The SQLite files are generally stored on the internal storage under /data/data/<packageName>/databases.
Here is what I do (I'm running Windows 7):
Here is the content of that batch file:
cd C:\Development\Android\android-sdk\platform-tools
adb pull /data/data/<your package name>/databases/<your database file name> <your local path>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With