I’ve been taking a break from PodcastUtilities to start work on a new project TextByNumbers. TextByNumbers is designed to enable people putting together letters / emails / SMS messages from snippets that the user can easily produce. Its should be useable on phones with or without a data connection.

I did think of writing a native app, I guess it would be an android app as I have an adroid phone but then I thought that I could do something cross platform if I used HTML5. I selected JQuery Mobile and Knockoutjs for my architecture. So I have come up with the first cut version of the app. The basic functionality has been done and the app does work and has a couple of users already

tbn1

Key features

  1. As its HTML5 it works on modern smartphones and desktops and tablets
  2. It is entirely client side code there is no server side code at all, the web server is just used to deliver static content.
  3. It is an offline app using an appcache so that it will work when disconnected from the network
  4. The format of the snippets is a JSON packet meaning that its pretty easy to drop in a new set of snippets – see below

Catagories

[
{"CatagoryId":1,"Display":"Query Type"},
{"CatagoryId":2,"Display":"Impact"},
{"CatagoryId":3,"Display":"Action"},
{"CatagoryId":4,"Display":"Timescale"}
]

Snippets

[
{"CatagoryId":1,"Display":"I have got your email"},
{"CatagoryId":1,"Display":"I have received a report from a customer on {DATE} at {TIME}"},
{"CatagoryId":2,"Display":"The system is completely down"},
{"CatagoryId":2,"Display":"I cannot reproduce this problem"},
{"CatagoryId":2,"Display":"There is an issue, however there is a workaround"},
{"CatagoryId":2,"Display":"I do not understand the impact of the problem yet"},
{"CatagoryId":3,"Display":"We must fix production as soon as possible"},
{"CatagoryId":3,"Display":"We can live with the workaround until tomorrow"},
{"CatagoryId":3,"Display":"This needs to be raised as a defect"},
{"CatagoryId":4,"Display":"I will contact you again in one hour"},
{"CatagoryId":4,"Display":"We can discuss this tomorrow"},
{"CatagoryId":4,"Display":"Let me know the issue number and I will prioritise the fix"},
]

Main things I learnt

  1. appcache is not a configured MIME type by default in IIS7 – sigh
  2. Chrome is by far and away the easiest browser to debug in – it has direct support for appcache files
  3. The appcache must be updated to force the browser to reload all the content from the server – only after the new appcache is downloaded will the new content be fetched, this meant when a new version is deployed you will have to press F5 twice in the browser
  4. In general phone based browsers are a bit more flaky than desktop, for instance some times I have to manually empty the cache to get the app updated, sometime my local storage will go away etc.
  5. I used JQuery Mobile and Knockoutjs and at times they got in each others way. I will do a separate blog post of the tweaking that I found myself doing.
  6. Prepopulating an SMS message does not work on older Samsung phones due to a bug in its implementation of the SMS protocol, I’ve had no problems with my HTC handsets and apparently Samsung have fixed this in their handsets that use version 4 of Android. It does not work on iOS – as far as I can tell this is by design so it will probably never be fixed. However a manual cut and paste method can be used and is still quicker than typing text from scratch

Conclusion

In general the platform was pretty much what I was expecting its still an immature architecture by comparison to .NET development or even native development however I think that the results are completely acceptable (I’ll will await user feedback) and I can see that for some scenarios that the significantly lower cost against native development will be compelling. As it stands at the moment I think that a native app will deliver a more polished solution, but will require multiple implementations across the market place (iOS, Android, Windows Phone etc).