Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
353 views
in Technique[技术] by (71.8m points)

ios - Max size of WebSQL/SQLite database inside UIWebView (phonegap)

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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

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)

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...