How to increment/save a variable in html activity?
I'd like to count how many times someone pushed a button on various html pages in my html activity (e.g. a test with yes/no answers) and then show different content depending on the value of the counter.
How can I do this in html with Andromo?
How can I do this in html with Andromo?
Tagged:
Comments
http://www.w3schools.com/html/html5_webstorage.asp
I just made a little app with 2 html pages and although they both reference the same counter (have a button to increment counter each time I press it), each html page has it's local data so page A might say 9 but on the page B I see 22 - this is maintained when I switch back and forth between the pages, but unfortunately I can't have just one counter they both can share.
It makes no difference if I use sessionStorage or localStorage variables as outlined in the HTML 5 spec here: http://dev.w3.org/html5/webstorage/ - although I would have thought the localStorage counter would have persisted.
I found a post from a few months ago where support confirmed this missing feature: ref: http://support.andromo.com/discussions/questions/4126-html5-localstorage-issue-with-andromo
Too bad as this limits the power of using HTLM 5 for offline games and other apps where you want to have some local data saved... as explained here: http://www.html5rocks.com/en/features/storage
It seems that Andromo simply doesn't let you store anything on the phone using cookies or HTML 5 storage, which makes offline apps quite limited
:-w
I suspect there may be better handling for it in the most recent Android SDK update (API level 19) since the WebView has been changed to be based on Chrome, however I haven't confirmed that. We do plan to update the SDK in the near future though either way.
Beyond HTML5's LocalStorage, we may look at alternate ways to store data from HTML in the future.
Great Todo feature indeed. I can't wait. Thanks @pdog for all the iterations. Andromo would be a more powerful tool with this feature.