JavaScript Async <> Multi-threaded

Upon reacquainting myself with JavaScript, I learned to love the asynchronous nature built into JavaScript. It’s just there, with no real work to do on my part.  Want something to happen later?  setTimeout.  *poof* it’s done when you want.  Want something to happen continuously?  setInterval.  *poof* that’s done too.

Now the danger of this is that Asynchronous feels like you just sent something to the background  to happen later on another thread and won’t interfere with anything you want to do.  That is not the case.  At least within the browser anyway.
Continue reading

HTML5 WebSQL Database Joy

First, some history. I’ve been working on a Blackberry app for Mindr Mobile using WebWorks. Given how drastically BB is changing with BB10, I figured it was easier to use WebWorks in both legacy BB and BB10, rather than completely different development on each. So I got to dust off the HTML and Javascript skills.

Part of the app I’m building requires having a local database. OK, require might be the wrong word as it could be done with HTML local storage, but a database is easier, and more in line with the Android version of the app.  Conveniently, both Android and HTML5 WebSQL use SqlLite as the backend database as well, so I don’t even have to worry about differences in syntax (although I already use several db’s, so not a big deal), and should be able to port everything across easily.

Continue reading