Phonegap store local db [英] Phonegap store local db

查看:105
本文介绍了Phonegap store local db的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程式中有大量资料。我需要它,以防应用程序离线。



目前我有一个data.js文件,并使用 jQuery data 函数来管理它。有1800行这样。 〜500kb。

  $。data(db,'Aarstraße',['34236:1','34246:2 ','34270:4','34290:6',...]); 

有更好的方法来存储这些数据吗?



我主要关心的是性能。

解决方案

我的建议是为你预先设置 - 填充SQLite数据库,并在应用程序启动将数据库复制到正确的位置,以便您的应用程序可以访问它。有关此主题的一个很好的博文:



http://gauravstomar.blogspot.com /2011/08/prepopulate-sqlite-in-phonegap.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+GauravSTomarBootstrappingIntelligence+%28Gaurav+S+Tomar+%3A+Bootstrapping+Intelligence%29 p>

I have a bulk of data in my app. I need it in case the app runs offline.

Currently I have it in a data.js file and use the jQuery data function to manage it. There are 1800 lines like this. ~500kb in total.

$.data(db,'Aarstraße',['34236:1','34246:2','34270:4','34290:6',...]);

Is there a better way to store this data?

My main concern is performance. Not to query some data but the app performance in total like RAM usage and startup time.

解决方案

My recommendation is for you to pre-populate a SQLite DB and on application startup copy the DB to the correct location so your app can access it. There is a good blog post on this topic at:

http://gauravstomar.blogspot.com/2011/08/prepopulate-sqlite-in-phonegap.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+GauravSTomarBootstrappingIntelligence+%28Gaurav+S+Tomar+%3A+Bootstrapping+Intelligence%29

这篇关于Phonegap store local db的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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