I am a new comer to Android, I have just become to the stage where I'm able to create an SQLite database from the application (I am using Eclpise with Android SDK and also the emulator, I made the SQL code inside a separate designer after which just copied and pasted it). After eliminating a couple of initial errors, the SQLiteOpenHelper-descendant class initialization code went with no exceptions, so I am presuming the database continues to be produced (and most probably endured inside a file). It is possible to way I possibly could access the database and look at it? (I am talking about apart from in the actual application, which at this time doesn't have functionality to talk of) Let me take a look in the database structure, and then once the application progressively becomes able to adding data, Let me have the ability to chcek whether it's working correctly. It is possible to method of doing this? Thanks.
You have access to the SQLite Data with the DDMS incorporated in Android SDK and integrated in Eclipse.
Within this link they are saying how to get this done.
You've got a handful of options:
- As the emulator is running, inside Eclipse, visit Window -> Show View -> Other.. -> Android -> File Explorer after which data/data/(Search your Application_title)/databases
- Copy the db towards the sdcard, move it for your computer and examine it there. For code to get this done, see among my other posts here: Is it possible to save database file to SD card?
For #1, remember that the emulator must be running. For #2, I have discovered that the SQLite Manager for Opera is a superb tool for viewing the db.
Grab the file out of this path, within the DDMS perspective File explorer
Make use of the SQLite database browser to understand more about saved data.
Here's what I actually do (I am running Home windows 7):
- A load file that pulls the database file in the device / emulator to my local filesystem:
This is actually the content of this 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>