Recently I switched from iPhone to Nexus S. This was a major transition as I moved away from iOS to Android. There were few Apps and Games which I liked a lot in my iPhone and naturally after I started using my Nexus S, I tried searching for those Apps and Games in Android Market, as I never wanted to be departed from those. Like me there are many such users who have a similar instinct. I was surprised to find the exact same games and Apps for Android as I was using in my iPhone. This made me more inquisitive to find out how these little things are developed to provide the same user experience and feel in various platforms.
Generally the marketplace for any Smart Phone platform contains the native apps for those platforms. And these native Apps are notoriously known to have compatible issues. So any native App developed for one platform will work only in that platform. So in order to have same Apps or Games available in all the Smart Phone platforms same App needs to be developed separately for each platform. This is not only time consuming but also requires additional overheads. To address this, another category of App called Hybrid Apps took birth. The Hybrid Apps successfully bridged the gap between Native App and Web App and also solved the major issue of cross platform compatibility.
Cross Platform App development methodology
As technology is constantly evolving, we have a plethora of tools and frameworks at our expense to build real cross platform applications which can even access most of the native features of the device in which it will run.
One such technique of building cross platform mobile app is called cross compilation. The framework used in this process provides a platform independent API using dynamic languages like JavaScript, Python or Ruby. This API is used to build the mobile application. The code is then processed by a cross compiler which transforms it into platform specific native app based upon the target platform. The applications developed in this way are faster and can access most of the native features of the device like camera, GPS etc.
Another method in which we can develop cross platform application is by using the virtual machine technique. In this method, the framework used will provide an API as well as the runtime environment for the app. The main disadvantage of this method is slower performance.
Another more popular but less powerful method is building mobile web app using HTML5 and CSS3. The powerful nature of HTML5 and CSS3 let us build apps that gives almost similar user experience like a native app. Usage of JavaScript framework like Sencha Touch can take this approach further.
Cross Platform Frameworks
There are lots of cross platform framework available, few of them with Open Source license and few with commercial license. Some are quite powerful and some are there just for the sake of it’s existence. The most widely used and popular among them are PhoneGaap, Appaccelerator Titanium, Rhodes, Adobe Air, Sencha Touch, Jquery Mobile etc.
PhoneGap
PhoneGap is the most popular framework to create Cross Platform application easily. It leverages the power of standard web technology like HTML, CSS and JavaScript to build native applications. It is popular because of it’s flexibility, ease of use and open source nature. PhoneGap uses the web approach for app development using HTML, CSS and JavaScript and run on a mobile browser embedded on a thin native App wrapper available for all supported platform e.g. iOS, Android, Blackberry, Web OS, Symbian and Windows Mobile 6.5. The native device features are accessed via a device independent JavaScript API. PhoneGap lacks support for native UI components and dev tools. But it can be used with other UI reach libraries like Sencha Touch and JQuery Mobile to provide superior User Experience.
The table below shows which device features PhoneGap can access under different platform.
Titanium
Titanium is used for both cross platform mobile application development as well as development of desktop application. It is based on the cross compilation technique we discussed above. Before the launch of Titanium mobile SDK the cross platform mobile app was a distant dream and the only way was to create same app for different platform was rebuilding the complete app from scratch for different platform. So Titanium is the pioneer in cross platform mobile app development technology. Titanium mobile SDK supports over 5000 UI elements and hardware controls thus gives a superior user experience and gives a truly native app.
Titanium is currently supported under the two most widely used platform iOS and Android and support for blackberry will be introduced soon (currently in beta). The primary advantage is much faster performance, ease of use and built in UI elements and the disadvantage is, it currently supports only a few platforms.
The table below shows access to device native features under different mobile OS platform for Titanium.
Rhodes
Rhodes framework is based on the virtual machine technique of building cross platform mobile app. This provides a complete toolbox for developing end to end cross platform mobile apps. It uses Ruby to build the business logic and the UI is coded in HTML, CSS and JavaScript. This provides a templating language which helps in building portable UI. It uses JQTouch to provide animation capability in webkit based browser as well as native feel. Rhodes framework is supported under iOS, Android, Windows Mobile 6.5, Blackberry and Symbian. Main disadvantage of Rhodes is any update in the code requires a complete rebuild. It uses a not so popular programming language so popularity is less.
The table below shows access to device native features under different mobile OS platform for Rhodes.
Sencha Touch
Sencha Touch is world’s first cross platform JavaScript framework for developing mobile web app. It leverages the power of HTML5, CSS3 and JavScript to give superior App that gives the look and feel of native app. Sencha Touch is based on webkit browsers. The latest stable version is 1.1.0 and has support for iOS, Android and Blackberry. It has built in capability for GUI controls for use within mobile app and they are highly optimized for touch input. Using HTML5 it also provides support for offline applications using the cache manifest feature of HTML5. With the release of Sencha Touch 2 will have deeper integration with device API and can access core device features.
Conclusion
The Cross platform mobile apps solve the ardent task of creating same application multiple times for multiple platforms. So this is a viable option in many cases. However it has few shortcomings like the cross platform apps are good only for presentation type of Apps, But when it involves complex Enterprise App or rich 3D games, cross platform technique is not suitable. The only option then is creating native app separately for each platform you want your application to be available. Cross platform App uses feature common to many platforms so they are not capable of device API access, hence all features of the device cannot be used. Also most of these cross platform frameworks are catering to Android and iOS, so there are lot of rooms for development for support of other platforms.