Hi, I am trying to understand how I can dynamically save resources to the application storage area on a deployed application. We have a web service that makes a call, receives data and attempts to save the content as a file. I can actually save the file to the device without supplying any path and it seems to save it to the root folder on the internal storage i.e. "Device Storage" (obviously I am only referring to Android OS). I am using a Samsung S5 with Lollipop version of the OS. I used the sample file plugin using the writeLine method to do this.
I want to be able to save my file to the same location as the index.html as shipped with my hybrid application i.e. the root folder of my application.
If if interrogate the values of the following, running on the device I get:
window.location.href => file:///data/data/<myAppName>/files/12590FAA-5EDD-4B12-856D-F52A0A1599F2/index.html
cordova.file.applicationStorageDirectory => file:///data/data/<myAppName>/
cordova.file.applicationDirectory => file:///android_asset/
If I attempt to save the file to cordova.file.applicationStorageDirectory (//data/data/<myAppName> or /data/data/<myAppName>/files/12590FAA-5EDD-4B12-856D-F52A0A1599F2/ I get an INVALID_MODIFICATION_ERR.
What I am trying to achieve is to download the relevant file, save it to the device and be able to access via my application e.g. render the contents of a html file via the application.