How to develop PhoneGap app with database storage > 5MB to be distributed on almost all platforms

自闭症网瘾萝莉.ら 提交于 2019-12-24 11:01:57

问题


I am building enterprise business application using PhoneGap to be able to distribute the application on almost all mobile platforms.

My app may need offline database storage more than 5MB, and the PhoneGap SQLite DB is limited to 5M.

After some search I found a cool plugin which make PhoneGap able to connect the SQLite DB with unlimited DB size, but unfortunately this solution is created for Android and iOS only.

Is there any workaround or solution to let me develop my mobile app using PhoneGap and distribute on almost all platforms with DB storage more than 5MB?


回答1:


As soon as you need something beyond what is built into the browser or core phonegap framework, you will need native code. If you're lucky that will mean using someone else's plugin, but since most developers only care about iOS and Android, you are unlikely to find anything universal.

Porting SQLitePlugin to another platform should be pretty straightforward assuming that platform has good sqllite support built in - the native part of the plugin has only 2 functions (open and executeSql) and is under 300 lines of code.




回答2:


you can write your own plugin. Creating a plugin in phonegap is not so difficult if you know the target platform's language.

if you ever had some exposure to java. probably you can create your own plugin, there are few blackberry plugins available here .. may be you can port the plugin you found for android to blackberry.




回答3:


This will hopefully help. I already answered the same question before, so I'm just going to link to the answer here. . . . .

Phonegap Offline Database

You can use the following ::

  1. SQLite
  2. LocalStorage
  3. Native DB for any OS. By calling the Phonegap plugin to your Native DB model class, and passing the parameters as arguments to be entered into the DB.
  4. Indexed DB


来源:https://stackoverflow.com/questions/13441339/how-to-develop-phonegap-app-with-database-storage-5mb-to-be-distributed-on-alm

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