This post originated from an RSS feed registered with Web Buzz
by Stuart Langridge.
Original Post: Making phone apps
Feed Title: as days pass by
Feed URL: http://feeds.feedburner.com/kryogenix
Feed Description: scratched tallies on the prison wall
I want an app on my phone that displays my Ubuntu One stuff; notes, files, contacts, that sort of thing.
I do not want to have to write it in Java. Nor do I want to have to port it to Objective-C so iPhone people can have it. I want to write an HTML5 app, because then it works everywhere, there's only one codebase, and (critically) I can do it.
Data in Ubuntu One is stored in CouchDB (well, files aren't, but let's leave files out of this for now; they'll work a similar way). CouchDB is all HTTP. So it should be possible to write an HTML5 app that retrieves my data from CouchDB.
Problem 1: an HTML5 app can't access CouchDB on another server, because JavaScript can't request data from another server.
Solution 1:Cross Origin Request Sharing, a W3C spec. Implemented by Firefox 3.5 and by the WebKit in my Nexus One, at least.
I want my app to work offline, of course. I shouldn't have to be online to read my notes.
Problem 2: web apps don't work offline, they're web apps.
Solution 2: use a manifest. Checklist, an HTML5 app, does this beautifully.
But how does the phone store data offline? That's not even worthy of a "problem" statement; offline HTML5 storage has been available for ages.
How does one authenticate to Ubuntu One to get the right data? Well, we use OAuth, deliberately because it enables this sort of thing. So that's all doable, too.
It feels rather like all these different puzzle pieces are slotting together. And that I have another project to write. Game on.