How to create an “offline mode” in a cordova application?

狂风中的少年 提交于 2021-01-27 18:21:29

问题


I have to develop an application for tablet (Android). This application will be used by some people in differents places where an internet connection will not always be available.

But this application needs data to work. The users will have to be able to use the functionality with and without and internet access.

We will work with cordova to build the application, and we will use the extjs framework.

My question is : how to make a kind of "offline mode" in a cordova application ? Maybe we have to create a "synchronization" button in the application. After a first synchronization which save data in a file stored in the device, the user could use the application with this file. When he open the application without internet access, the data would be loaded from this file. When the user modify/add/delete some data without internet, we thought add these information in a js file (JSON) which would be sent to the controller which used for synchronisation when internet is back.

But we don't know if this solution is correct or not, and if we can write or read a file stored in the device.

Thanks guys, have a good day.

来源:https://stackoverflow.com/questions/41937771/how-to-create-an-offline-mode-in-a-cordova-application

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