I’ve seen and heard a lot of discussion about how people build applications for mobile devices. While there are literally hundreds of thousands of apps out there for Apple, Android, Blackberry and other smartphones, I can’t help but think the majority of these are one-off efforts. In this series in the blog, I’m going to tackle some of the issues with developing mobile apps, especially for enterprise use, and along the way propose some ideas for making the process easier and more repeatable.
In the last entry I spoke about the attraction of writing pure Native applications for mobile devices. They’re fast, have full access to all the device features, and can be made as beautiful and functional as your software development skill allows. They’re also non-portable and can take more people, time, and money to develop.
Wouldn’t it be nice to be able to develop applications using open industry standards that run in many different environments? You know, applications that allow text content, great formatting, images, video, forms, and interaction with backend systems?
While there have been many motivations for developing HTML5 given the experience of people creating billions of web pages, I think it’s safe to say that creating a standards-based cross-platform environment for mobile devices was an important reason. That is, don’t think of a web page as just something you read, but rather consider it an application with which you are interacting.
I won’t go into all the features of HTML5 but there are several good references on the web in addition to the spec to which I linked above. In particular:
Generally, HTML5 allows much better and more consistent ways of embedding multimedia in web pages. It also adds new elements to help you structure the document. The Document Object Model, something I worked on in ancient history, is now considered core to the specification and the programming model.
These are nice things for web pages, but does HTML5 give you anything new that makes its especially attractive for mobile devices? One of these is the geolocation application programming interface. In short, this allows you to programmatically determine your location, and then do something with it. That “something” might be to pinpoint your location on a map, provide a starting point for map directions, determine what weather forecast to show you, or display ads for local businesses, for example.
You can also store information locally on your device, though that opens up the question of security if you happen to lose it or you somehow get hacked.
What about access to other core features on your device? Using pure HTML5, can you snap a picture? How about use the compass or receive a notification? You can’t, but remember that you can still do all the interactions that you’ve been doing for years in your browser. You can read all sorts of information, do searches, buy things, access FaceBook, and so forth.
So HTML5 provides a richer interactive environment than we’ve had before and is starting to allow programmatic access to some device features.
If HTML5 does everything you need for your planned application, then use it.
HTML5 is still under development and you are seeing support for it from the big industry names that supply browsers or content, companies like Google, Apple, Amazon, and FaceBook. IBM, of course, has been and continues to be a huge supporter of open Internet and Web standards.
You do need to understand which HTML5 features are considered solid and which are experimental. You should also experiment with formatting on multiple devices to make sure that your app looks right (not too skinny, not too wide, just right) on the smartphones or tablets that are important to you.
Note that an HTML5 app is really just a web page, so you don’t need anyone’s permission to put it into an app store. For many people, that is more than enough reason to try really hard to make HTML5 work.
Also, even if you are developing some native applications, you might decide to do some HTML5 ones as well. The more experience you get in creating apps with different capabilities, the better you will get at economically providing apps faster to your consumers, customers, or employees.
So Native gives you everything, but is non-portable. HTML5 is portable and standards-based, though it is still under development and does not give you full access to the device. What do you do if you want the best of both worlds?
Hybrid is this weird middle ground between Native and HTML5. Over time, this gap between them will get smaller. There are several approaches for both development and runtime of Hybrid apps, and I’ll discuss them next.
Also see: “The spectrum of hybrid mobile app development with Worklight”