Tales of a Web Architect Michele Sciabarra's thoughts about Content Management and the web…

27Feb/100

Hybrid Apps

The Pain

Most of the mobile sites for the iphone nowadays are delivered as apps, not just web sites (or webapps, if you prefer). Apps offer more than simple browsing, and have also the ability to go offline (an eventuality not so remote even for an always-connected device like the iPhone). So, users want apps, not just iphonized web sites.

Note also that the landscape is not limited to the iPhone: there are others smart phones in the wild: android, blackberry, symbian, windows mobile and even the palm WebOs.

You can develop your own app using the native programming language of the iPhone, that is Objective-C. You can also develop an app for Android using Android Java (that is not J2ME nor is 100% standard Java, by the way), or develop an app for Nokia phones  in Symbian in C++ (or  J2ME, if you want to take the route of  "write once, be frustrated anywhere"). The pain is not finished: you can write an app for Windows Phones in C# and, last but not least you can write also an app for Blackberry using his Java , that is different from J2me and Android Java, also.  An if you also want an app for the new Palm Webos, you have to write it in Javascript.

The hope for less pain.

You can decide that it is too much, and take a simpler route:  implement your app using what is the common denominator of the mobile landscape today. I mean, the Webkit  browser.

Webkit was born as the HTML component for rendering web pages for the Linux KDE. Since then, it was adopted by Apple as a rendering engine for Safari, a few years ago. Of course, it was used also for the iPhone and now it is the core of the Mobile Safari.

Webkit  became the web browser engine  also for Nokia mobile phones. It has been adopted also from Google for Android (and Chrome, by the way). And of course recent Blackberries have their browser built using Webkit.

In a nutshell, Webkit IS the reference web engine for mobile devices. As far as I know the only smart phones today having a browser not based on Webkit are Windows Phones, that use a browser derived from the Internet Explorer Trident rendering engine.

So what?

The obvious idea is is that if you want an application running everywhere, you can implement it in HTML/CSS/Javascript.

What, are you kidding you can say? Well actually I am not.

Javascript on mobile browser is pretty fast. And the rendering abilities of the HTML are actually very poverful. The problem is that a a Javascript application have limited access to the phone advanced functionalities, like the location, contacts, the accelerometer and so on.

This is why  projects like PhoneGap come in the play. They build a bridge between Webkit and the rest of the phone, providing an extended API that does a lot more than the normal Javascript API. For example, geolocation or access to the Contacts stored in the agenda of the mobile phone.  Hybrid apps, even if they look (and actually are) somewhat limited, are gaining a wider consensus to the point that efforts are underway to standardize this approach.

So definitely it is an idea worth to be considered, EVEN IF YOU DON'T BELIEVE it is possibile. Most of my friend dub mobile apps like "toys" or "limited at the best". Not sure they are right. I see a bright future in this approach. I will continue to explore the landscape, trying to understand how good they are. Stay tuned.

Filed under: Uncategorized No Comments
21Feb/100

Kits for building an iphonized theme.

So you got a project: iphonize your web site. Well, that is a complex matter actually. You have to ask yourself: what I really want? For example: A website viewable from my iphone? A client app for my website?

You have a number of options.  The first option is just a version of your website that can be easily seen with your iphone. This is what we will cover in this post.

If you are using a CMS, and you are lucky,  is it possible that there is already a mobile theme available for it. For example for WordPress (the software powering this site) there is the WPTouch theme. Another notable case: the Magento ecommerce system provides out of the box a theme already optimized for the iPhone. This list can go on. In such a case, you can just grab the theme and install it, and you are done.

However, very often you are not so lucky, so you may have to develop a theme for  your site by yourself.

Since is not that easy (you have to adapt the css and the layout to the Mobile Safari browser), you can use as a starting point a number of "kits" ready for you website.

There are many kits  for iphonizing your site. I want to point you out to those three:

  • iWebKit, that is actually a template for building your website for the iPhone. It provides CSS and HTML that must be worked out to build an actual theme for your CMS.
  • jqTouch is a plugin to the widely used jQuery library. It is useful to iphonize your website as well as writing applications. The drawback is the reliance on the jQuery  library, that can be sometimes incompatible with other libraries.
  • iUi can be useful also as a basis for build your iphone theme, although it is more a library to build applications with an iPhone-like user interface, than a kit for developing your theme.

Those listed are the basic options to use when you decide to get into the brave new world of the iPhone web. However we have not exhausted all the possibilities

Stay tuned, we will see also which options we have to develop also client applications, both native (written in Objective-C) and hybrid (written in Javascript, mostly).

Filed under: Uncategorized No Comments