Phonegap store local db

穿精又带淫゛_ 提交于 2019-12-31 04:38:07

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/9004140/phonegap-store-local-db

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!