質問

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?

役に立ちましたか?

解決

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

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top