0

Ive created an app that stores user login information into an sqlite database. However when i try to access it using Root Explorer i get an error.

An error occurred while opening the database. disk i/o error (code 3850):, while compiling: Select * from sqlite_master where type in('table','view') order by name.

The app works fine, and it is storing the log in information as required. However i cant access it on the root explorer?

Any suggestions?

3 Answers 3

1

please call this function:

public static void copyDataBase(Context mActivity) throws IOException {
        InputStream myInput = new FileInputStream(new File("/data/data/"
                + mActivity.getPackageName() + "/databases/" + "yourdb.sqlite"));
        File files = new File("/sdcard/files/");
        files.mkdirs();
        String outFileName = "/sdcard/files/your.sqlite";
        OutputStream myOutput = new FileOutputStream(outFileName);
        byte[] buffer = new byte[1024];
        int bufferLength;
        while ((bufferLength = myInput.read(buffer)) > 0) {
            myOutput.write(buffer, 0, bufferLength);
        }
        myOutput.flush();
        myOutput.close();
        myInput.close();
    }

your database is copied /sdcard/files/your.sqlite this path.

Sign up to request clarification or add additional context in comments.

3 Comments

have you solved your issue or not?this function is call when your app is start.
this method is properly work in my project.whats is your issue?
it just wasnt appearing, ive since managed to get access to database. Thanks thou, im sure il be able to use your answer at some point in my project.
0

You could add a button in your app to view the database information or write the database information to a file in external storage.

Otherwise, maybe you need to root your device to access the database.

Comments

0

Just give permissions to all users to the file [YOUR_DB].db-journal

For me it worked.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.