Phonegap - jQuery Mobile - Upload / Save / Upload File
I am using Phonegap with jQuery Mobile and have the following use case:
- I want to download a file from a remote server via JSON.
- Save the file to the local file system of the mobile device (to work also offline).
- Target platforms: iOS, Android, possibly Windows Phone and BlackBerry.
- Load the file from the file system.
What's the recommended way to do this?
- Phonegap.FileWriter? Is there a way to save it to "assets / www ../"?
- Phonegap.Storage?
Or is there a better way?
+3
user1165474
source
to share
1 answer
- Use XHR to load JSON data.
- Use FileWriter to save the file to the file system.
- Use FileReader or XHR to read a JSON file from the file system.
No, you cannot save the file to the / www file as it cannot be written.
+1
Simon macdonald
source
to share