Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing and configuring SQlite Browser on LINUX

Tags:

android

sqlite

I am new to Linux, and I don't know how to install sqlite-autoconf-3070400 and SQlite database browser in my Linux OS. Please give step wise details. I want it for Android Development. So do I need some extra?


This was the question about to view database. I asked this question because I had no idea how can I view db contents. I was aware and used other DB so was thinking that there might be a GUI for SQlite too. As I got my answer and added too for future. So be honest while downvoting this question.

like image 903
Pankaj Kumar Avatar asked Dec 01 '22 04:12

Pankaj Kumar


1 Answers

This is alternative solution for SQlite browser... (Actually all LINUX machines having SQlite allready, You need only GUI of SQlite. Sqlite database browser is predefined option. But when you unable to install it(like me) then go for this another solution ... You have to add addon to firefox. You can download it from http://code.google.com/p/sqlite-manager/
and for installing this addon (after downloaded it) press "ctrl+o" > choose downloaded file > open > install.

Now after restarting Firefox, go to Tools > SQLite Manager > open it and choose your database to open and do your work.


Update for sqlite3


Android has given a very good tool, which is sqlite3. You can find this tool into sdk/tool/ directory.

Introduction :-

From an adb remote shell, you can use the sqlite3 command-line program to manage SQLite databases created by Android applications. The sqlite3 tool includes many useful commands, such as .dump to print out the contents of a table and .schema to print the SQL CREATE statement for an existing table. The tool also gives you the ability to execute SQLite commands on the fly.

To use sqlite3, enter a remote shell on the emulator instance, as described above, then invoke the tool using the sqlite3 command. Optionally, when invoking sqlite3 you can specify the full path to the database you want to explore. Emulator/device instances store SQLite3 databases in the folder /data/data/<package_name>/databases/.

Here's an example:

adb -s emulator-5554 shell
# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db
SQLite version 3.3.12
Enter ".help" for instructions
.... enter commands, then quit...
sqlite> .exit 

Once you've invoked sqlite3, you can issue sqlite3 commands in the shell. To exit and return to the adb remote shell, use exit or CTRL+D.

Read more at Examining sqlite3 databases from a remote shell

Happy coding!

like image 120
Pankaj Kumar Avatar answered Dec 04 '22 13:12

Pankaj Kumar