tags:

views:

85

answers:

3

I have trouble with finding my SQLite Database.

As we can access the SQLite databases on a running emulator like below:

 adb -s emulator-5554 shell
 sqlite3 /data/data/package_name/databases/database_name

But what if I am testing my application on real device(HTC Here-Android) ? where does i find my database?

+1  A: 

It's at the same location on the device as on the emulator. Although you can only see it with root access (su).

Mathias Lin
@Mathias Lin...how can i check whether i am having "root access" or not ?
PM - Paresh Mayani
If you haven't rooted your phone, you probably don't have root access, cause phones come unrooted by default. If you root, you lose the phone's guarantee. You can check whether you have root by using the 'adb' tool in your sdk. "adb -d shell" and then you type "su". If it says "su: not found" you don't have root access. Otherwise, su is the command to switch to super user.
Mathias Lin
+2  A: 

Usually, it will be in the same directory. For example, in my HTC Tattoo:

alt text

Of course, if you want to access that directory, you will have to have a rooted handset. Also, keep in mind most of the production handsets does not include the sqlite3 tool.

Cristian
then HTC hero is root accessible? from where i can open root ?
PM - Paresh Mayani
I don't think so. You will have to root it manually. There are lots of tutorials out there.
Cristian
i dont know about to "Root" so if possible then provide me one link atleast...@Christian C
PM - Paresh Mayani
+2  A: 

It will be present in the same location that is present in the emulator .If it is in /data/data//databases/ , it usually is in the same place in the real device also.

You should access it with root privileges .. :)

ravi
@ravi...i had tried to access...but "data" folder shows empty everytime with real devices
PM - Paresh Mayani
you need to open the data folder when you are running the app. did u do dat.. ?
ravi