2

I want retrieve database from Android Device Monitor as described here, but this time can not enter into /data folder. Why? Do you know any workaround?

Deleted, reinstalled app, restarted Android Studio etc.

enter image description here

Community
  • 1
  • 1
János
  • 32,867
  • 38
  • 193
  • 353
  • Because you don't have root permission. – K Neeraj Lal Sep 03 '16 at 10:37
  • Do you know easy way to get 'root' permission? – János Sep 03 '16 at 10:38
  • you have to root your device to get root permission. You can check the method I suggested. – Vivek Mishra Sep 03 '16 at 11:00
  • "I want retrieve database from Android Device Monitor as described here" -- those instructions are for emulators. Follow the other answers on that question for copying a database using `adb`, as that approach can work on devices as well. And, you will not have the security issues of your presently-accepted answer. – CommonsWare Sep 03 '16 at 12:18

1 Answers1

1

For ease of access you can create your database in mobile phone sd card or external storage also. By this way you can easily access database file.

You can do it like this

    public DatabaseHelper(final Context context) {
     //super(context, DATABASE_NAME , null, 1); //for default location
        super(context, Environment.getExternalStorageDirectory()
                + File.separator + FILE_DIR
                + File.separator + DATABASE_NAME, null, DATABASE_VERSION);
    }
Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84