UIWebView中的WebSQL / SQLite数据库的最大大小(phonegap) [英] Max size of WebSQL/SQLite database inside UIWebView (phonegap)

查看:222
本文介绍了UIWebView中的WebSQL / SQLite数据库的最大大小(phonegap)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它似乎以前被问过,但我没有找到一个令人满意的答案。


当创建IOS Phone gap应用程序时,IPAD上的任何html5应用程序是否在编译为本机应用程序时对数据库的大小有限制?我知道一般来说,对于Web应用程序的本地存储有5MB的限制。

It seems to have been asked before but I did not find a satisfactory answer.
When creating a IOS Phone gap application, well any html5 application on an IPAD is their a restriction to the size of the database when compiled to a native application? I know that in general there is a 5MB limit to native storage for web applications. Is this limitation also there for native web view apps?

推荐答案

是的,WebKit数据库也仅限于5mo。

Yes, the WebKit DB is also limited to 5mo.

您可以使用此解决方案欺骗系统: https://issues.apache.org/jira/browse/CB-330?focusedCommentId=13237796&page= com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13237796

You can trick the system with this solution: https://issues.apache.org/jira/browse/CB-330?focusedCommentId=13237796&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13237796

或者您可以使用本机SQLite数据库(与WebSQL相同) )与phonegap插件。该插件将数据库保存在Document文件夹中(或者可以指定另一个文件夹),并且没有大小限制,iCloud保存数据。 (但要注意,苹果不太喜欢应用浪费iCloud存储)

Or you can use a native SQLite DB (same as WebSQL) with a phonegap plugin. That plugin save the database in the Document folder (or you can specify another folder), and there is no size limit and data is saved by iCloud. (But take care, Apple don't really like apps wasting iCloud storage)

这是Native SQLite phonegap插件: https://github.com/davibe/Phonegap-SQLitePlugin 关于这个插件,WebSQL API之间有一些区别,这里是一个适配器: a href =https://gist.github.com/2009518 =noreferrer> https://gist.github.com/2009518

Here is the Native SQLite phonegap plugin : https://github.com/davibe/Phonegap-SQLitePlugin Regarding this plugin, there are some differences between the WebSQL API, here is an adaptor: https://gist.github.com/2009518

如果数据很重要,您应该将其保存到服务器。我写了一个小库来将SQlite DB同步到服务器: https://github.com/orbitaloop/WebSqlSync

And if the data are important, you should save it to a server. I wrote a small lib to synchronize the SQlite DB to a server : https://github.com/orbitaloop/WebSqlSync

这篇关于UIWebView中的WebSQL / SQLite数据库的最大大小(phonegap)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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