1 person found this helpful
Unfortunately, you're running into one of the cases where the PhoneGap Desktop + PhoneGap Developer apps are different from building and deploying your app on a device.
In the latter case, your files would be stored in the application bundle and deployed to the device. This is where cordova.file.applicationDirectory points.
However, in the former case, you're using another PhoneGap app (PG Developer), and it's just loading content from a server (PhoneGap Desktop). Unfortunately, there is no mechanism to copy files into another app's bundle (bundles are considered read-only), and so whatever you see at cordova.file.applicationDirectory is actually the PhoneGap Developer app's bundle, which is not what you expect, of course.
There are two ways around this:
- Temporarily download the content from your dev machine using XHR or File Transfer, or,
- Build your app with PhoneGap / Cordova CLI / PhoneGap Build. This will ensure that your app's assets are copied into the application bundle, and accessible via cordova.file.applicationDirectory. (This would be my suggestion; otherwise you'd have to rip out code associated with #1 when you're ready to test your build process.)
Hope that helps!
Thanks for the answer.
Solution 1) I don't know how to perform a download of a whole folder with a lot of folders with html files in these. I could zip the folder and download it from my webspace, but don't know how to unzip it.
Solution 2) Building the app everytime I change two lines of code, transfer it to the phone, installing it is actually way to much effort for me..