Pre-populated database?


#1

Hello all,

I want to know something. I have placed a mydatabase.db file inside www folder and copied it using https://github.com/an-rahulpandey/cordova-plugin-dbcopy plugin.

Now, I want to delete that mydatabase.db file from www folder, after copying it to sqlite default storage using above plugin. Anyone have idea? How ca I delete that db? We can get appdirectory only in read only mode, so we can able to delete aseets files? It says directory not found when I am trying to delete that.

Please help asap. Thanks all :slight_smile:


#2

You can do this with the native File plugin: https://ionicframework.com/docs/native/file/


#3

I have tried, but it not works. Can you show here some demo type code. I have do something like it

this.file.removeFile(this.file.applicationDirectory+“www”,“mydatabase.db”) and returns promise.It always show directory not exists in error.


#4

I don’t think this is possible. The applicationDirectory is a fictional window into your APK, and I don’t think it can be modified by any means.