cordova - storing backbone model and collections in phonegap singlep page apps before sync -
i developing single page phonegap applications , using backbone, require.js, underscore. need enter patient, , doctor information. means have backbone model patient , doctor. now, may enter 3 patient , 3 doctor information. mean have form collection of pateint , doctor. now, when device offline, want store them locally. , when device online, want sync them server.
i wondering idea here use. should use phonegap sqlite, or backbone adopter local storage or html5 local storage efficient , reliable means? , can suggest me sample on git hub or examples on doing this?
i think on right track. there several step accomplish it, each of represent it's own problem.
- detect application goes offline.
- once offine, switch
backbone.sync
ajax-based, localstore (you mentioned sqllite, if there api in javascript , backbone plugin it's nice too). - you track "sync" happens during offline mode.
- once application goes online again, not-sync changes uploads server.
please check backbone-offine repo well.
Comments
Post a Comment