PhoneGap的离线存储和COM pression [英] phonegap offline storage and compression

查看:184
本文介绍了PhoneGap的离线存储和COM pression的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的PhoneGap新手。方案有关我的应用程序:

Phonegap newbie here. Scenario about my application:

  1. 将需要运送包含一些XML数据(1000 XML斑点,共15MB uncom pressed)
  2. 的用户将能够查看和编辑这些XMLS
  3. 在应用程序的更新不应该覆盖(可能是编辑)XMLS

问题:

  • 的离线存储可我只是用我的应用程序的文件吗?或者我应该将这些应用程序捆绑XMLS /复制到离线存储?如果是的话,哪一个?
  • ,因为这种类型的数据是高度COM pressible,有没有办法,我可以让他们存放COM pressed无论是在步骤1(初始应用程序包),并在情况下,第2步,我需要一个离线存储?

解决这些问题都需要能够同时与iPhone,iPad和Android,因此,使用PhoneGap的兼容。

The solution to these questions need to be compatible with both iPhone, iPad and Android, hence the use of Phonegap.

推荐答案

如果它是15 MB uncom pressed,它可能会过多地存储在应用程序本身。您可以使用 PhoneGap的存储API的它们存储在数据库中,但我不知道如果你能做到任何COM pression这个数据库。

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.

我可能会去将它们存储与使用手机的文件系统上的外部文件中的PhoneGap文件AP​​I的:

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#文件

他们也都支持iOS和andoid平台。

They are well supported on both ios and andoid platforms.

对于COM pression,你可以使用一个JS库,如 JSZip 与合作文件系统存储。我没有尝试这样做自己,但它应该工作。

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.

这篇关于PhoneGap的离线存储和COM pression的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆