an-rahulpandey / cordova-plugin-dbcopy

Copy SQLite Database from www folder to default app database location
Apache License 2.0
89 stars 47 forks source link

Copy Database from Device Storage issue #47

Closed milanifour closed 5 years ago

milanifour commented 7 years ago

We are trying to Copy Database from Device Storage but there is no any status return

an-rahulpandey commented 7 years ago

If you can provide some log, then it would be great. You can use Android Monitor or ADB Logcat

milanifour commented 7 years ago

Now i can Copy database from Device Storage But getting one issue
"attempt to write a readonly database (code 1032)" After copy data when i am going to edit or insert at that time i Got this Please suggest me how we solve

an-rahulpandey commented 7 years ago

Can you delete the app and reinstall, also can you paste some code here?

milanifour commented 7 years ago

I tried with reinstall app but got same issue. (after restart app Database is working But not working with copy and then use )

` oncopyDbFromStorage: function () { var basePath = app.appConfig.filesDir + "/" + app.appConfig.filesSubDir + "/";

        window.plugins.sqlDB.checkDbOnStorage("amc_database", basePath, function (success2) {
            console.log(success2.message);
            window.plugins.sqlDB.copyDbFromStorage("amc_database", 0, basePath + "amc_database", true, function (success3) {
                console.log(success3.message);
                location.reload();
                //var initialHref = window.location.href;
                //    // Show splash screen (useful if your app takes time to load) 
                //    navigator.splashscreen.show();
                //    // Reload original app url (ie your index.html file)
                //    window.location = initialHref;
            }, function (error3) {
                console.log(error3.message);
            });
        }, function (error2) {
            console.log(error2.message);
        });
    },
`
milanifour commented 7 years ago

Is there any option for progress bar. I think progress bar feature you have to add