I'm using phonegap to create an Android App. My app is about a simple game where I generate random number to do math. When you answer right, the score goes up and if you lose, you save your name and score at the moment into localStorage. The problem is that I can't view it in android. Can you guys help me? Below is the code that I use to view in Browser.
function loadPlayer(){
const lsOutput = document.getElementById("lsOutput");
var l;
if (localStorage.length < 5) {
l = localStorage.length;
} else {
l = 5;
}
for (var i = 0; i < l; i++) {
const key = localStorage.key(i);
const value = localStorage.getItem(key);
lsOutput.innerHTML += `${i+1}- ${key}: ${value}<br/>`;
}
}
Nevermind guys. It's just my old phone can't understand the code. I tried borrow my friend phone and it's work.