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 deviceOpen command prompt. Run->cmd->click on cmdGive command adb shellIf 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/dataNow 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 databasesOpen the database using sqlite3 command. If your database name is example, use the command sqlite3 exampleSqlite 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 tableany sql command - do not forget to add…