i'm very-very noob at programming and intel xdk. i'm creating android application using Intel XDK and Ionic Framework, i want to use local storage to store my data. i've searched on internet and found some tutorial like using LokiJS and PouchDB, but when i tried it, it didn't working.
Then, i've found simple script local storage like this:
<h1>Welcome <span id="name"></span></h1>
<br>
<input id="input" placeholder="What is your name?">
<button onclick="setName()">Save</button>
<br>
<br>
<button onclick="getName()">Get the Name</button>
</div>
<script>
document.addEventListener("deviceready", function(){
document.getElementById("name").innerHTML = window.localStorage.getItem("name");
}, false);
function setName(){
window.localStorage.setItem("name", document.getElementById("input").value);
alert("Name added to localStorage");
}
function getName(){
alert(window.localStorage.getItem("name"));
}
</script>
it's working on my project, input->store->get , it's simple.
but now i want, if i input text, it will store to storage on some array, then i want to show the text on list view in intel xdk. Can i do that ?