In todays tutorial I will show you how to work with sqlite databases in android through command line.
1. You can browse any number of databases.
2. You can write any queries and execute.
First go through these tutorials to get a glance of how to work with sqlite databases in android.
After going through these tutorials you will get to know these.
1. How to create an SQLite database.?
2. Where to locate the database file in your device or emulator?
3. How to browse the database using the plugin I provided in this example(http://coderzheaven.com/2011/04/sqlitemanager-plugin-for-eclipse/
I am using the sqlite database that I created using this example
Now open the command prompt or terminal and type
adb -s emulator-5554 shell
now type the path of your sqlite database like this.
check the screenshot for example
Now look at the screenshot for how am I navigating through the tables and selecting and inserting values to the table creating new tables etc.
Click and enlarge the image to see it.
Which you can see by opening the file explorer from the window menu and expanding your package folder.(check this example for a screenshot of how to see the database http://coderzheaven.com/2012/01/how-to-save-score-in-android-cocos2d/)
Now about the SQLite database file.
Here I have three tables my_table, temp_table and test_table.
I am executing different commands to manipulate these tables.
The results are appearing just after the command
Please leave your valuable comments on this post.
Also +1 this post to share it to others if you liked it.