Which Cross-Platform Framework Should You Choose?
Which Cross-Platform Framework Should You Choose?
When it comes to cross-platform development for mobile, the most popular frameworks are Appcelerator Titanium, Xamarin and PhoneGap. But which one is right for you?
Join the DZone community and get the full member experience.Join For Free
With an aim to become competitive and responsive in the market, the mobile app development companies are trying to deliver apps on as many platforms as possible. However, they face tough times when it comes to sticking to the budget and matching with the speed of the competitors.
Since the mobile market is highly dictated by iOS, Android and Windows devices, if you want to develop a particular app, you may atleast need to develop it for these three devices/platforms unless you can afford to ignore one or all these platforms. We know the standard approach that companies follow for developing apps is native development. However, expecting speed and cost-efficiency in native development doesn’t make sense since it requires you to obtain respective SDKs and tools of each platform, hire developers of each platform, create multiple code bases and design UI/UX for each platform exclusively.
In these cases, it is more sensible to follow what modern companies and app developers do i.e. ‘write once and run anywhere’ with cross-platform development since it allows you to develop apps that can run on multiple platforms. With cross-platform development, you can reduce the cost of development below the threshold of the total sum of native development costs for each platform.
When it comes to cross-platform development for mobile, the most popular frameworks that come to one’s mind are Appcelerator Titanium, Xamarin and PhoneGap. All these frameworks solve the purpose of developing a single app for multiple platforms. However, there are vast technical, business and philosophical differences.
So which cross-platform development should you choose? Which framework is easier, better and supports your requirements?
Let us take a deep dive into all these three cross-platform frameworks and try to find out which one suits you best.
PhoneGap is an opensource and simplest cross-platform framework compared to Xamarin and Titanium. It allows creating mobile apps utilizing Web APIs, i.e. it wraps up web applications in a native app shell and then implements them on native stores for different platforms. It uses a cloud-based service called 'Build' with which you can compile apps for several operating systems without the need to install SDKs of each platform.
- Small and simple native API sets enable easy porting to different environments.
- Supports all platforms and operating systems which includes iOS, Android, Windows Phone 8, Blackberry, Firefox OS and Ubuntu.
- Lower performance of apps as the original codes of the app remains that of a web app and launches via a web browser. This means the performance of PhoneGap apps doesn’t come close to native apps
- Too many fragmented libraries and frameworks at a very basic level
- User interface of app varies depending on the quality of Web View rendered
- Better performance due to native API usage, which also gives access to elements and features of iOS and Android
- The look and feel of Titanium apps are better than apps built on other platforms as the UI is essentially native
- No support for third-party libraries
- Difficulty in developing complex applications
- Since it doesn’t use HTML5 and CSS, the animations and DOM elements are laggy and less responsive
Xamarin, originally called MonoTouch is another cross-platform framework that has picked up the development market with its own IDE. It works on C# within .NET framework and allows you to create native apps by utilizing native APIs and UIs of each platform.
Xamarin comes with Xamarin.Forms library which allows you to write native UIs for once and then share and convert them to platform-specific UIs. Xamarin currently supports iOS, Android and Windows platform. It also allows developing apps for Blackberry by compiling Android apps.
- Xamarin has TestCloud which allows you to test your apps automatically
- Provides 100% code reuse with Xamarin.Forms UI development using shared code base and logic. This saves a lot of time and resources
- Supports patterns like MVC and MVVM
- Xamarin.Android supports Google Glass devices, Android Wear, and Firephone
- Learning curve is relative. If your team knows C#, it is comparitively easy to get started with Xamarin
- Does not provide access to certain Android specific UI controls.
- Impacts load time as it has its own runtime
- Does not support sharing of codes outside Xamarin environment for native or HTML5 development
This is just a background analysis of the technical and business differences between PhoneGap, Titanium and Xamarin which clearly says – there is no perfect world. The selection still depends on the purpose, scope and resource availability.
Let us dig deeper and compare these three side-by-side rationally.
From the above comparison, it is clear that all the three platforms have their own share of features and support. All these frameworks are important in the mobile landscape.
As a company or developer, you should choose the one that meets the requirements and purpose of your solution. None of these are a wrong choice, however, one might be better than the other depending on your requirements.
Published at DZone with permission of Manmay Mehta . See the original article here.
Opinions expressed by DZone contributors are their own.