> Hello everybody, my apologies for my English in advance (yeah... French...)
> Sorry to bother you, but do any of you understand how the "cordovafile" plugin works?
> I mean : I exported the capx on APK as a charm, but I can't figure out where the file "myfile.txt" from the project is stored ? I can't see it on the capx, and though it does tell me the file is on the phone when I use the app (I can copy, write, type, etc.), I can't seem to find it on the phone browser.
> I need this feature to export JSON files which contain custom levels created by users on my app, for the "download as" command that works on the computer doesn't do any help on my phone.
> Any help would be greatly appreciated, thank you in advance.
Allright, I found out what the problem is : the cordova file plugin is actually saving files in a directory which needs your phone to be rooted so that you can access them ("/data/data/com.yourname.myapp/files/files/").
That's weird, for the documentation of the plugin tells you that the path you specify is "relative to external storage (SD card) root ex) "myfile.txt", "mydir/myfile.txt".
Is there any way to move the path of your written files, for any path I specify leads to "/data/data/com.yourname.myapp/files/files/mydir" (etc.) ?
Thank you to anybody who has the answer.
Success ! For all of you people who met the same problem I did, here's the solution : simply add the following lines at the end of your "intelxdk.config.additions.xml" in your XDK "develop" project board.
<!-- makes the "Cordova File" plugin able to write files on other locations than root -->
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,root" />
This will do the trick : now, when you specify a folder (for example "Documents/myfolder/") in your C2 event sheet, a new folder named "myfolder" will appear in your "documents" folder on your phone, and the file you wanted to create with the "write" command will be there ! Hope it will be useful for some of you ! Have a nice day.