Phonegap newbie here. Scenario about my application:
- it will need to be shipped containing some xml data (1000 xml blobs, total 15MB uncompressed)
- the user will be able to view and edit those xmls
- updates on the application should not overwrite the (possibly edited) xmls
Questions:
- for the offline storage can I simply use the files of my application? Or should I move/copy those application bundled xmls to an offline storage? If yes, which one?
- since this type of data is highly compressible, is there a way I can have them stored compressed both in step 1 (initial application package) and in step 2 in case I need an offline storage?
The solution to these questions need to be compatible with both iPhone, iPad and Android, hence the use of Phonegap.
If it’s 15 MB uncompressed, it’ll probably be too much to store in your app itself. You can store them in a database using the phonegap storage API’s but I don’t know if you can do any compression on this database.
I would probably go for storing them as external files on the phone’s file system using the PhoneGap File API’s:
http://docs.phonegap.com/en/2.1.0/cordova_file_file.md.html#File
They are well supported on both ios and andoid platforms.
As for compression, you can use a JS library such as JSZip in collaboration with the file system storage. I haven’t tried this myself but it should work.