I am working on a mobile application with phonegap and jquery mobile for android. It is working properly but it takes so much time to get data from server.
I want to cache its pages so if user come back on same page he can view same page.
I am using jquery mobile caching code but it is not working.
I am using this code data-dom-cache="true" for cache
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.appView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
super.loadUrl("file:///android_asset/www/find.html");
}
Cache is not working in my app so I stored all json data in localstorage by doing this
where
datais json object I retrieve from server.And next time i retrieve data from localstorage
This solution solved my problem hope it will help others.
Thanks