Question

I want to see my database structure on my tablet (samsung Tab 2 10.1). I have root my device, but when I want to see my database in ddms view on my eclipse, folder data didn't open.

Is there any solution for my problem?

Était-ce utile?

La solution

you can copy your sqlite database with adb from your device

  1. connect your phone to pc (usb, debug enabled...)
  2. adb devices list your connected phones
  3. adb -s deviceName pull /data/data/your.app.name.space/databases/your-db-name.db

if you don't know hows the name of your db use the adb shell

adb -s deviceName shell

than list the files in your databases folder like this

ls /data/data/your.app.name.space/databases/

than you have the sqlite database you can browse with some sqlite tools

Autres conseils

One alternative approach for this requirement is to create database on SD card.

SQLiteDatabase.openDatabase(DB_PATH, null, SQLiteDatabase.OPEN_READONLY);

Here you can give sd card's path in DB_PATH. Now your database is easily viewable without even root required.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top