I made an Android/Phonegap app, and it is running fine on all devices with several android OS versions, except on some Gingerbread (2.3) phones. I am using Phonegap 1.9.
Debugging the code, I realized an illegal access exception
on Javascript, every time I use the HTML5 localStorage.getItem()
and localStorage.setItem()
methods.
How can I enable the localStorage
features on those Android devices?
The illegal exception was caused by JSON.parse() methods when the .getItem() returns null. Just be careful to validate it. Android 2.3, HTML5 localStorage and Phonegap are working perfectly now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With