如何在使用Phonegap和iOS 5.1时停止删除HTML 5数据库 [英] How to stop the HTML 5 database from being deleted, when using Phonegap and iOS 5.1

查看:127
本文介绍了如何在使用Phonegap和iOS 5.1时停止删除HTML 5数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phonegap为iOS创建测验样式应用程序。该应用程序允许用户创建然后进行测验。

I am creating a quiz style app for iOS using phonegap. The app allows users to create then take the quizzes.

目前,我使用一个HTML 5数据库使用phonegap API来存储测试和结果数据。我担心,当设备存储空间已满时,iOS 5.1现在可以删除数据库。

Currently I am using a HTML 5 database using phonegap APIs to store the test and results data. I am concerned though that the database can now be deleted by iOS 5.1 when the device storage gets full.

有没有标记存储数据库的webkit缓存文件夹这样它就不会被删除?

Is there anyway to mark the webkit cache folder where the database is stored so that it is never deleted? If this is not possible are there any suggestions for another way to store data that will always be persistent.

推荐答案

有一个修复方法对于Webkit存储和iOS 5.1的问题

There is a fix for both issues with Webkit storage and iOS 5.1


  1. 存储从/ Webkit移动到/ Cache

  2. 在iOS 5.1(WebKit Bug)下的应用更新中,存储未调整为更新的文件夹结构

https://issues.apache.org/jira/browse/CB-330

这个解决方案似乎比更改Webkit数据调用私有API的位置更安全。当应用程序运行时,使用Webkit存储位置。在恢复或终止所有数据时,将备份到文档文件夹。时间戳记确保ab旧备份不会覆盖较新的存储数据(如果应用崩溃...)。

This solution seems to be more safe than just changing the location of Webkit data calling a private API. While the App is running the Webkit storage locations are used. On resuming or terminating all data is backuped to the documents folder. Timestamps ensure that ab old backup cannot overwrite newer storage data (if the app crashes...).

最好的:使用应用程序的旧版iOS版本有了这个修复,不会遭受任何iOS更新情况下的损失。这是为什么不应该等待...

The best: Users that are on an older iOS Version using an App with that fix in it, will not suffer damage lost in case of any iOS updates. Thats why one should not wait...

这篇关于如何在使用Phonegap和iOS 5.1时停止删除HTML 5数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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