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

4
  • Because you don't have root permission. Commented Sep 3, 2016 at 10:37
  • Do you know easy way to get 'root' permission? Commented Sep 3, 2016 at 10:38
  • you have to root your device to get root permission. You can check the method I suggested. Commented Sep 3, 2016 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. Commented Sep 3, 2016 at 12:18

1 Answer 1

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);
    }
Sign up to request clarification or add additional context in comments.

2 Comments

This may offer "ease of access". It also is very insecure, as any app can now access this database.
@CommonsWare But this for testing purpose, after your app is ready you can put it back to default location.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.