Feb 19

What Facebook says about HTML5 mobile apps

“We’ve tried in the past to just build web apps that we could wrap in thin native wrappers, but it doesn’t work. […] Anytime somebody tries to reimplement a native widget using HTML, CSS and JavaScript it always feels like shit.” – Tom Occhino while introducing Facebook’s new React Native

It’s exactly my experience since I started developing mobile apps four years ago. Therefore, I focused on Appcelerator Titanium which does for years what Facebook tries to do now.

Nevertheless, at the moment I’m developing a BlackBerry 10 app using HTML5, and I’m quite satisfied with the outcome – but only because it’s a relatively small app that only needs to store small amounts of data on the device, and where small UI glitches are acceptable.

But in the end, there are UI glitches. Like a bar at the top that should be fixed, but scrolls with the content for a small moment before it’s being placed at the top again. Or small, subtile differences in transition animations. On the other hand, I like that I can control the UI as much as I want – since it’s only HTML that can be modified at any time using JavaScript.

So it’s as always: there is no “one solution that rules them all”. HTML5 apps are fine in several cases. But if you want to develop huge, complex apps I’m sure an approach like Titanium is the better way. And if you want to synchronize with Notes, you need to do it in Titanium anyway, so that you can use DominoToGo.

Jun 22

Mobile Apps: Offline First

The story of a company moving from hybrid mobile apps to native using Appcelerator Titanium. One reason: customer complains about bad performance in areas with poor network coverage. Therefore the new paradigm: offline first.

Interesting read: Four Benefits of Changing Our Technology Platform to Titanium

If you want a full offline enabled mobile app for IBM Notes and Domino, you need DominoToGo.


Apr 09

I am proud of DominoToGo. It. Just. Works.

(If you see a video about what I’m writing about, just scroll down…)

I’m just back from a customer in Zurich, Switzerland where we kickstarted a DominoToGo project.

A quite interesting project from my perspective: it’s about coroners that want to write reports about dead people on an iPad mini while they are on site.

So far they had a Notes application in the office, so that they needed to make notes somewhere, for example on a sheet of paper, and enter the information when they’re back in the office.

Since the Notes application should continue to be master of the data, the iPad app needs to push new reports to the Notes application. Furthermore, to create a report, several lists are needed from Notes, for example Notes user names and selection lists for fields like “cause of death”.

Does everyone die in places with good network coverage?

Unfortunately, people do not always die in places with good network coverage, so offline functionality is essential. Therefore a web based app is out of the question, just as in so many other projects I recently worked on.

About the app

So basically the app needs to:

– get a list of all Notes users from the Domino Directory
– get several selection lists from one NSF
– get a list of customer records from another NSF
– offer a form to enter the data
– offer several selection dialogs in the form, something like a view pick list in Notes
– save the data to a new document
– upload the document to a third NSF in Domino, when the device is online
– if the device is offline, the data needs to be queued locally and uploaded sometime later

What we did

In Appcelerator Titanium we started with a template that is delivered with the DominoToGo package. This template contains an app with basic functionality like

– layout for iPad, iPhone and Android
– a configuration dialog for entering the Domino username and password
– an HTML based “about” page
– basic navigation
– a skeleton for synchronization functionality

This template app already has the DominoToGo libraries included so we could start immediately with the business logic.
Futhermore, this template app already uses Titanium’s Alloy framework, which is a system where layout, logic and data is organized separately and the app code is very well structured. The layout is defined with simple XML tags while the logic is written with JavaScript.

First step: synchronization

We started with the synchronization logic. As written above, several Notes views needed to be synchronized to the app. With DominoToGo, this was a no-brainer, here is a piece of the code:

function sync_personen(success, e) {
if (!success) {
DTG.log("Sync von names fehlgeschlagen: "+e.error);
var view = Alloy.Globals.notesdb_adressen.getView("(iLotus_Personen)");
view.update(sync_adressen, false, 'Synchronisation fehlgeschlagen: %s');

function sync_names(success, e) {
if (!success) {
DTG.log("Sync von fehlgeschlagen: "+e.error);
var view = Alloy.Globals.notesdb_names.getView("(iLotus_People)");
view.update(sync_personen, false, 'Synchronisation fehlgeschlagen: %s');

Regarding the amount of data, we counted some hundred Notes users from the Domino Directory, some 500 customer records and about one hundred keywords used in selection lists.

The synchronization took about one second to complete. It is so fast, that we simply let the synchronization run everytime the app starts, the user doesn’t notice it at all.

Second step: designing the form

The basic form was done very quick thanks to the great Titanium Alloy framework. For example, have a look at this code:

and now look what this kind of tag produces in the app:

It’s a generalized view picker dialog which displays the content of a Notes view in a picker dialog in the app (of course, even when the iPad is offline). I wrote code for various generalized picker dialogs, like a date picker, a view picker and a selection list picker. My customer now only needs one line of XML code like the one above to use such dialogs. Not that bad, isn’t it?

Third step: uploading data to Notes

Data entered in the form in the app should be uploaded to a Notes application in Domino. Nothing simpler than that, look here (no, that’s not LotusScript! It’s JavaScript in Titanium);

var notesdb = Alloy.Globals.notesdb_ereignisse;
var doc = notesdb.createDocument();
doc.replaceItemValue("form", "FM-LN");
doc.replaceItemValue("Name", $.fields1.c_getValue1());
doc.replaceItemValue("Vorname", $.fields1.c_getValue2());

But there was one additional requirement: the documents need to get a number based on special numbering rules. This numbering could only be done on the Domino side. A problem? Hell no!

In DominoToGo there is a SSJS library on the Domino side that provides extension points, for example when a new document has been uploaded from the app to Notes,

So we simply needed to write some server side JavaScript code in this library which computes a new number and stores it in the new document that just has been uploaded by the app. Simple and clean.

My job was done and I am proud

After developing and explaining all this functionality my job was done. Now the customer has all the functionality and pieces needed to finish the app by himself.

I’m proud of DominoToGo. All the synchronization functionality needed in this project was implemented in minutes and just worked. Reliable and fast.

Yes, since I developed the DominoToGo framework by myself such a statement seems to be selfish. Nevertheless, I’m still proud of my work 🙂

If you want to read more about DominoToGo, have a look here.