开发者

How to view tables created in a database

开发者 https://www.devze.com 2023-01-19 01:33 出处:网络
I am new to android. I created a data base named as example.db with some tables in SqlLite. It worked fine. It was also cr开发者_开发问答eated in data/data/com.mypackage.myapp/databases/example.db.

I am new to android. I created a data base named as example.db with some tables in SqlLite. It worked fine. It was also cr开发者_开发问答eated in data/data/com.mypackage.myapp/databases/example.db.

Now, I need to open that database and see the content in the database. How can I do this?


The Following only works on the Emulator or on a rooted phone.

Open your Command prompt (or Terminal)

1) Traverse to `\android-sdk-XXX\tools`
2) Type in `adb shell`
3) cd /data/data/com.mypackage.myapp/databases/
4) sqlite3 example.db

Now you have an SQL Interface for your Database.

Select * from TableName;


you can see the contents of database by pull the database to desktop with extension .sqlite for example abc.sqlite then install the sqlite manager for the firefox and then open that mangaer and select the connnect to open your database which will definately allow you to see the contents of your database as well as tables.

0

精彩评论

暂无评论...
验证码 换一张
取 消