Skip to main content

Posts

Showing posts from December, 2013

Accessing sqlite database in the command prompt

Many a times working with sqlite database, you often wonder if the tables are created, whether they are populated etc. If you want to find out the contents of the database, here are the steps needed  Start running your application using emulator or device Open command prompt. Run->cmd->click on cmd Give command adb shell If adb gives unknown command error, you can go to the folder <your androidsdk location>/platform-tools and then try giving the adb shell command. Change to directory /data/data using cd /data/data Now go to directory of your application package. e.g. if package name is com.example.dbtest, give the command cd com.example.dbtest  Change to databases directory. cd databases Open the database using sqlite3 command. If your database name is example, use the command sqlite3 example Sqlite will start. Some basic commands you can use are .quit - come out of sqlite .table - list the tables .schema tablename - list the columns of the table any