Trends in RIA Development: Cross-platform mobile RIAs
Over time the number of smartphone platforms has increased considerably, and the different variations of screen resolutions, bit-depths and device capabilities has not made it any easier to make applications which work across platforms.
Look at the few popular Smartphone operating systems, Symbian applications are developed in C / C , Android applications are developed in Java, iPhone applications are developed in Objective-C, webOS applications are developed in HTML JavaScript… While for performance intensive applications it is very important that the application be developed in the native language, for many simple applications it is a pain to develop the same functionality in multiple different programming languages.
This where solutions such as Adobe AIR stand out. With Adobe AIR, you need only develop your application once, in ActionScript 3 and you will be able to have the same application running on any device to which Adobe AIR has been ported, and over time the number of such platforms will only increase. Already you can have your AIR-based application running on Windows, Linux, MacOS X, Android, and the iPhone. Soon such applications will run on the Blackberry Tablet as well. The same applications, with reduced / different functionality can run on the web too using the Flash Player.
While RIAs can be deployed to mobiles using HTML5 (or even 4) and Flash, AIR application have an edge as they have greater access to the system's functionalities, such as the location, orientation and acceleration sensors that can enhance the experience of any RIA.
Adobe's AIR is not the only solution for this functionality though, however most solutions lack somewhere when it comes to cross-platform development. Here are a few examples:
PhoneGap: This is a brilliant open-source solution for targeting multiple phone platforms. It currently supports more platforms than Adobe AIR, having support for iPhone, Android, BlackBerry, Symbian and Palm. It's roadmap includes support for Maemo and Windows Mobile as well.
Applications built with PhoneGap are written in web technologies HTML, JavaScript and CSS however PhoneGap exposes and API which allows you have access to core device features such as Geolocation, Vibration, Acclerometer, Sound, and Contacts, most of which aren't available to web applications.
HTML, JavaScript and CSS are obvious choices for RIAs, which makes PhoneGap perfect for deploying existing HTML-based webapps to mobiles, just as AIR is perfect to deploy existing Flash-based webapps to mobiles.
Unlike AIR tough, PhoneGap is limited to targeting phones. While HTML, JavaScript and CSS are already very portable being able to create native applications for Windows, Linux and MacOS X is something you will miss out with PhoneGap.
MonoTouch and MonoDroid: MonoTouch is a commercial toolkit available from Novell which allows developers to create applications for iOS devices, the iPhone and iPads using C# and .NET. As it's name suggests, it is based on the Mono framework which is an open-source implementation of Microsoft's .NET framework.
While it only allows developers to target the Apple's devices, it does help developing cross-platform applications by allows code reuse between Linux, Windows, Mac OSX and iOS. In fact Mono applications can also run on Nokia's Maemo devices, and soon on Android via MonoDroid. Unlike Mono applications though, MonoTouch are compiled instead of being executed by a JIT compiler.
While Mono makes Windows applications cross-platform by making it easier to port them to Linux, and Mac OSX, MonoTouch makes it easier to port functionality from those applications to iOS. MonoTouch is thus only suitable if you have .NET code you want to port to iOS, or if .NET is your area of expertise and you want to use it to build iOS applications, since that is all it is capable of targeting for now. For deploying applications to multiple mobile platforms MonoTouch isn't suitable.
Titanium: Another cross-platform SDK for developing native applications using HTML, CSS, and JavaScript. Titanium lets you develop applications for both Mobile and desktop. On the mobile side it supports iOS and Android, and on the desktop side it supports Windows, Linux and Mac OSX.
Titanium is not only multi-platform, but multi-language as well. Not only does it support JavaScript, but it also supports Ruby, Python and PHP, allowing you full access to the language's features. So you can use the Titanium API to perform system operations with JavaScript, or you can use features native to each langauge.
Titanium actually allows you to embed Ruby, PHP, and Python code in your HTML code, and your code will be able to access the DOM of your HTML file just like JavaScript would. This means you can easily develop an application in these powerful languages and use the familiar HTML for the UI. With its support for PHP it can even be used to run server-side applications as native desktop applications. This makes it significantly more powerful that Adobe AIR, when it comes to features, and a good platform for mobile RIAs.
As more mobile application stores open, there is a clear trend towards making your application available for as many platforms as possible. While applications developed using the native toolkits provide a clear advantage over cross-platform applications when it comes to performance, and in utilizing platform-specific features, this is only something which will improve with time. Cross-platform toolkits are the way to go for RIAs as they let the developer focus on their application without needing to worry about how to port it to plethora of platforms available today.