Search code examples
cordova-pluginshybrid-mobile-appcordova-5.0.0

how to implement shared preferences in hybrid mobile application using apache cordova


I am using cordova hybrid mobile application. In that application I want to implement shared preferences in the code. I get a response from server also. How to implement the shared preferences in my application. I get the response through jquery and my file extension is .html


Solution

  • in cordova app you can use local storage for e.g.

    window.localStorage.setItem('Username',value); //Store your values
    
    window.localStorage.getItem('Username'); //Retrieve your values
    
    window.localStorage.removeItem('Username'); //Remove your values