Mobile application development middleware?

I am the author of an ExtJS based cluster management web-application (Scyld IMF at Penguin Computing) that allows controlling a high performance compute cluster from any web-browser, be it from your desktop or from a mobile device. This works fairly well already even without writing a special view for the mobile devices as current smartphones (iphone, android) come essentially with a full blown javascript capable web-browsers and lots of processing power. However performance still could be better by having a native app that uses the same data sources / api as the full blown web-application (javascript app running on the browser being the client to the webservice-api on the server side), but implementing the view natively.

After hacking up a proof of concept for the iphone (thanks John for your awesome iphone JSON flickr tutorial and xcode example for download) and thinking of how to do the same for android without duplicating effort, I realized that it would be nice to be able to have some kind of middleware that allows me to create and populate native gui components without code duplication.

One such middleware is phonegap which requires you to write your application in javascript and html, and allows accessing phone specific features through javascript calling the middleware. It then is bundled as a native application that can be submitted to the app store for purchase and can run completely offline once downloaded, unless the programmer chooses to access remote resources. Their initial focus seems to have been allowing access to smartphone specific features like the address book, vibrate and sound, gps location and such, but there also is code in there to use native gui components as well.

I have two problems with the approach:

1. development of javascript – while palm pre developers might tout this as an advantage, I find javascript development and debugging rather tedious and would prefer writing my code in java or objective-c and be able to run it through a full control debugger on my desktop before deploying it to the simulator. I know about and am actively using firebug, the javascript debugger for firefox, but a lot of the bugs I had to deal with were incredibly hard to hunt down and rather than the debugger it was the forums and interacting with developers on #extjs chat, as well as using jslint and manually analyzing code, that helped me figure out a root-cause, workaround or fix.

2. performance – developers report that the phonegap version of their app appears to consume more resources rather than less compared to a remotely hosted javascript app, accessed through the mobile devices web-browser. Apart from the overhead of having to parse javascript at runtime, developers sometimes need platform specific knowledge and implement different than for a web-application, i.e. iphone onclick events being much slower from the touchscreen than ontouch events.

The advantage on the other hand appears to be that it is relatively easy to add new mobile platforms to phonegap. So far they appear to have iphone, android, blackberry and some nokia platforms covered, with palm pre being on the horizon to be added beginning of next year.

And according to phonegaps website, there are already several real-world phonegap powered apps in the marketplaces of both the iphone and android.

Thoughts?

Advertisements

solved: Could not access windows shares between ubuntu and XP

After spending some time googling for a solution on why I can’t access my samba shares from XP nor my XP shares from ubuntu 8.04 hardy I finally figured it out myself – the firewall as it comes preconfigured was preventing full communication.

The symptom was that I would be able to list shares with

smbclient -L 192.168.0.222

but when wanting to connect to a share, it would give me errors like

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

I also would get messages such as ‘missing \ in share name‘ and the like.

Ubuntus Nautilus was not able to connect to the smb://192.168.0.222/Trip2008 url.

Windows XP would also not see any folders that I had selected as shared in nautilus on the ubuntu side.

The quick solution was to give full access to the windows xp laptop coming from 192.168.0.222  (I will start googling to narrow down what exactly I need rather than allow all access) via:

iptables -I INPUT –source 192.168.0.222 -j ACCEPT

Now I can simply connect with smbclient //192.168.0.222/Trip2008 and XP allows me to see anything exported from ubuntu automatically in the network places view.

Problem solved.

extjs – my favourite widget-rich javascript library de jour

extjs.com After looking at dojo/scriptaculous/yui/jquery and the like, I finally narrowed it down to extjs ( http://extjs.com ) as my favourite playground for a widget-rich browserindependent javascript library. Check out their examples to get excited quickly.

Of course there is no light without shadow: The API documentation is ‘somewhat terse’ (read: lacking links to examples) and the examples that exist outside of that are excellent for showing off what it will look like but leave out the essential pieces that would allow you to learn on how to make it useful for your own application.

I was lucky to find Sakis extjs examples website: http://examples.extjs.eu/ which does actually implement forms including the submit functionality and so I was able to glean from it how to use the ajax submit/load functionality.

Another interesting find is http://tof2k.com/ext/formbuilder/ which allows you to drag and drop forms together that you can then include in your apps.

Give it a try, if you are shopping for a javascript library that has commercial support and a free community (GPL) version, this is the way to go IMHO.

thunderbird does not want to send attachements out of /tmp ?

Strange surprise today, I tried to send an email with attachements and for some reason it fails, and says I should check my temporary directory settings. Up and down the settings I see no such thing. After a bit of googling and the misleading hint to remove a parentlock file, I am getting the idea – its actually throwing files with that precise filename into /tmp. Now thats stupid, who wrote that ? At the very least do a mktemp directory for the application.

So I had to move the files from /tmp ihnto a subdir /tmp/x and voila it works – but also only because I happen to own read/write those files. Otherwise I would have even had to rename them before sending…

Should file a bugzilla report…

filepost – upload a file to a temporary location and get a url to share with friends

Ever wanted to share a large file with one or multiple people without having to email it?

It’s simple: upload it through  QuickFilePost  and you will get a url that you can cut and paste for future use, i.e. email to the friends so they can download the file instead of you having to email it. You don’t need to signup and its free.

http://www.quickfilepost.com/upload2/upload_form.html