2

I am implementing the data base using sqlite in android .I create table and insert value successfully .I also retrieve value. But my problem is that how to get file of DB from DDMS .Actually I saw a developer who take file from DDMS or somewhere else(I don't know) open it and saw all values in that?

Can you please tell me how to get that file .so that I will look it.

Let me explain again.I need sqlite (in which i create table) so that i will check entry ?

5 Answers 5

1

you can see it in DBMS->file explorer->data->data->your package

Sign up to request clarification or add additional context in comments.

8 Comments

can we check on emulator..?
I am not getting option of data in emulator when I go to file explorer
yes this work in emulator.befor you go to file explorer part you should select your emulator in devices part of DBMS then you have folder data in file explorer
you can't check your db on emulator you only can check it in dbms as I say
I got the file .Now hoe to check my package .there is lot of package
|
1

check Sqlite Manager Plugin for eclipse.

SQLiteManager plugin for eclipse

Not able to open database file in SQLite manager plugin for eclipse?

Comments

0

Do yout want get DB file from internal memory of android device ( samsung, sony...)? if your device is not rooted, that is impossible .

1 Comment

I am checking in emulator
0

There are two scenarios: rooted or non-rooted.

If rooted, you can just do the following using command line:

adb shell
su
cd /data/data/com.your.company/databases/
cp your.sqlite /sdcard

Then it is in your sdcard, you can do adb pull /scard/your.sqlite

But it is too cumbersome, so what you really should do is, in your java code:

new File(database.getPath()).setReadable(true, false);

The database is your SQLiteDatabase instance, probably in the SQLiteHelper class. Then you can simply:

adb pull /data/data/com.your.company.package/databases/your.sqlite

Comments

0

You can always use ADB to solve your problem.
If you are a developer of the same app use this commmand to push and pull to get the database and see in
adb shell
run-as com.example.yourapp
cd /data/data/com.example.yourapp/databases
chmod 666 ./com.example.yourapp.db
OR
you can do a ls -l to see the name and permissions of your database
pull com.example.yourapp.db C:\Where_you_want_the_database
OR
pull ./com.example.yourapp.db C:\Where_you_want_the_database
you can edit the database using SQLlite browser and you can also push the database like this
push C:\your_database.db /data/data/com.example.yourapp/databases

This works well even without rooting the device and also in emulators and on real devices.

Comments