BT

Your opinion matters! Please fill in the InfoQ Survey!

Pros and Cons of Cross-Platform Mobile App Development

| Posted by Ritesh Patil Follow 0 Followers on Sep 13, 2016. Estimated reading time: 9 minutes |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

Key takeaways

  • Current implementation of cross-platform tools
  • Overview of popular cross-platform systems
  • How and where to benefit from cross-platform development
  • Common pitfalls and shortcomings of cross-platform apps
  • Comparison of different cross-platform approaches

 

The world has gone mobile. It has become a “must have” element for any organization, regardless of its size. Undoubtedly, some organizations can concentrate on only one mobile OS (operating system) and avoid all the other ones, yet it is important for many businesses to focus on a myriad of mobile devices with various operating systems. Gone are those days when you were satisfied with only having a mobile app. Today, it is important that the app must support Android gadgets, iPads, Windows Phone, Amazon Kindle, Tabs, BlackBerry, etc.

One of the most challenging situations for app developers is, whether to develop a native mobile app or go for cross-platform. Of course, as a business, you require dealing with different types of customers who possess different types of devices. Therefore, you'd need to have a mobile app that could work seamlessly on almost all the platforms (i.e. Android, iOS, Windows, etc.)

What are cross-platform apps? 

In ideal scenario, cross-platform apps work on multiple operating systems with a single code base. There are 2 types of cross-platform apps:

  1. Native Cross-Platform Apps
  2. Hybrid ‘HTML5’ Cross-Platform Apps

Native Cross-Platform Apps

Every major mobile operating system has its own SDK (Software Development Kit) to create mobile apps. These SDKs also have preferred programming languages which are supported by the OS vendor. For example, for iOS, Objective-C and Swift are the preferred programming languages supported by Apple, whereas for Android, Java is the preferred language supported by Google. Generally, apps created with these languages using the official SDK are called as “native apps”.

However, it is possible to use APIs (Application Programming Interface) provided by the native SDK, in other programming languages which are not supported by the OS vendor. This is how “cross-platform” native apps are created. Generally, a third party vendor chooses a programming language and creates a unified API on top of the native SDKs provided by the various OS vendors. Using this unified API, it is possible to support multiple operating systems with a single code base. The third-party vendor generally provides an IDE (Integrated Development Environment) which handles the process of creating the native application bundle for iOS and Android from the single cross-platform codebase.

Since, the final app produced still uses the native APIs, the cross-platform native apps can achieve near native performance without any visible lag to the user.

Current State of Implementation

Though creating cross-platform native applications is possible today, the current state of implementation is far from complete. Most of the mobile apps are heavy on the GUI (Graphical User Interface) implementation side. Almost all the critical business application logic resides on the server which is accessed by the mobile via web services.

Since the User Interface (UI) and User Experience Design (UXD) of iOS and Android are quite different from each other, it’s not an easy task to create a uniform GUI wrapper on top of it. Though Xamarin and others have put in significant work on this front, it is far from perfect. It works well if you design your application to live within the framework’s limitation, however, if you need anything that doesn’t fit with the framework’s vision, it requires a lot of work to implement and requires writing platform specific code. To give you an example, in Xamarin Forms, it takes a lot more work if your designer chooses to give custom colored borders to text fields. As this is not obvious to the designer, once you have settled in on the design, the programming team needs to put in a lot of efforts to pull off this seemingly simple design. Xamarin is working hard to provide more advanced cross-platform UI components under their Xamarin Forms Labs project. But many components of this project are still under beta status.

One popular approach taken in native cross-platform development involves writing business logic and web service calls using cross-platform libraries while GUI related code is written with platform specific libraries. Depending on the application, this can allow 30% to 60% code reuse.

Popular Native Cross-Platform Frameworks

  1. Xamarin: A California-based software company, which now is backed by Microsoft, founded in 2011. Xamarin uses C# as the main language for the cross-platform development. C# is a statically typed language with mature tooling and IDE support. Also, many big companies have C# programmers already in their in-house IT departments. So,  enterprises tend to regard Xamarin as a good investment.

  2. Appcelerator Titanium: One of the earliest players in this domain. They launched iOS support in 2009 while Android support was added in 2012. Appcelerator Titanium uses JavaScript as the main language for development and aims at bringing familiar web development paradigms to native mobile application development. However, it somehow didn’t capture the mainstream attention but lots of applications development is happening on top of it. Appcelerator also has a proprietary paid MBaaS (Mobile Backend as a Service), which it is pushing more. In the early days, Titanium had quite a few issues which were discussed widely in the blogosphere. This may also have hampered its adoption.

  3. NativeScript: Like Titanium, NativeScript aims at making web-like programming available to app development. NativeScript was announced by Telerik, a company which is famous for its suite of GUI components for enterprise applications in 2014. It uses JavaScript as the main development language. Native script also supports TypeScript, Angular and uses CSS for styling. Compared to the other technologies mentioned above, NativeScript is relatively new but it has a lot of potential.

  4. QT: QT is one of the oldest cross-platform desktop development libraries around, released 21 years ago, in the year 1995. They added support for cross-platform iOS and Android applications in 2013. QT uses C++ along with QML (Qt Meta Language or Qt Modeling Language- it’s a markup language similar to HTML) to create cross-platform applications. However, QT GUI components, by default, don’t follow the look and feel of iOS and Android. Also, C++ is not an easy programming language because of its huge syntax, manual memory management and standards compatibility issues. However, in the hands of experienced C++ programmers, QT can be quite productive.

  5. RubyMotion: RubyMotion is the main language for the development. One of the early players in this domain. When first announced in 2012, it was for iOS only, but supports both iOS and Android, since 2014. Rubymotion requires separate GUI code for iOS and Android, however, business logic can be reused across-platforms.

Hybrid ‘HTML5’ cross-platform Apps

Mobile apps are essentially GUI applications. Most mobile apps depend on backend web services for large parts of their business logic. Roughly speaking, in mobile apps, especially in the business process automation domain, almost 60% of the code deals with creating and managing the GUI.

iOS, Android and Windows Phone, all have a very advanced browser component in their SDKs. By leveraging this WebView component, programmers are able to use standard HTML5 web technologies to design and program parts of their application. So in the end, the application is composed of at least a native frame and HTML/JavaScript executed in a WebView – which is why they are called “hybrid”. Application features which need sensor input like geolocation, camera or lower level functions like accessing the file system usually use some JavaScript-to-native bridge provided by the hybrid application framework.

 The image below shows the architecture of a typical hybrid application:


Cordova / PhoneGap

Apache Cordova which was originally named as PhoneGap (launched in early 2009) is the most popular hybrid cross-platform framework. It supports most of the major modern smartphone operating systems. Since in hybrid cross-platform frameworks HTML and CSS are used to create GUI, almost all of it can be used across different operating systems. With libraries like framework7 (http://framework7.io/) it is also possible to support the underlying operating system's default look and feel using CSS-based themes.

In hybrid applications the HTML, CSS and JavaScript code is shipped along with the application. Therefore, there is no delay in loading the UI related code, like you would experience it when loading websites over the network. On modern powerful phones, it’s possible to create a snappy UI with HTML5 technologies. Especially for B2B apps, it’s possible to have 85-90% code reuse across-platforms with Cordova.

The image below which will help to put all the mobile app development options in single perspective:

To summarize, here are the pros and cons of the cross-platform mobile app development:

Pros of cross-platform mobile app development

  1. With careful planning around 50%-80% code reuse can be realized across-platforms. This results in faster development and reduced costs.

  2. Cross-platform development provides more benefits during the maintenance period. If a bug is found in a common codebase it needs to be fixed only once.

  3. Unit tests are required to be written only once for the common code, hence the saved budget can be used to write more thorough unit tests.

  4. It is possible to use existing programming talent rather than learning platform specific development language.

  5. Ideal for B2B apps and business process automation apps, where time to deployment and efficient utilization of resources is more important than sleek look and feel.

Cons of cross-platform mobile app development

  1. In general, phones are not as powerful as desktops when it comes to raw processing power. Many mid-level and entry level phones don’t have enough hardware power to perform smooth HTML5 animations. Because of this HTML5 hybrid apps can lead to sluggish UI on low and mid range phones.  Also since browser components have evolved with the operating systems, it’s relatively painful to support operating systems which are more than three years old.

  2. Rendering modern HTML and CSS which uses advanced features like gradients requires a lot of CPU and GPU resources. Thus, HTML5 based apps consume significantly more battery compared to native apps or native cross-platform applications.

  3. Usually, HTML5 hybrid apps depend on callback-style programming to communicate with native plugins, which makes the code unnecessarily complicated. Also for some tasks, this might lead to impractically slow solutions.

  4. Native cross-platform app SDKs are not mature yet. GUI needs to be coded multiple times to obtain platform specific look and feel.

  5. Many successful apps are developed as native apps (either Android or iOS) because designing and building an app for multiple platforms with platform-specific user experience is too difficult. This is due to all platforms defining their own human interface guidelines and supporting them with a single code base turns out to be very challenging.

  6. Mobile operating systems are evolving at a very rapid rate. Every year there are more and more features being added. This creates more work for the cross-platform SDK vendors who need to bring out new versions of their SDK within a short time after the release of a new operating system version. Sometimes, it also requires a lot of work on the developer’s part to upgrade an app to newer versions of the cross-platform SDK.

To conclude this in one line, even though native app development offers 100% platform compatibility and smooth performance, for B2B solutions and for business process automation projects, native cross-platform or HTML5 hybrid application development techniques can offer good enough performance in a more cost effective manner.

About the Author

Ritesh Patil is the co-founder of Mobisoft Infotech that helps startups and enterprises in mobile technology. He loves technology, especially mobile technology. He’s an avid blogger and writes on mobile application. He works in a leading android development company with skilled android app developers that has developed innovative mobile applications across various fields such as Finance, Insurance, Health, Entertainment, Productivity, Social Causes, Education, Taxi development and much more and has bagged numerous awards for the same.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

In the move to mobile people forgot the other approach by Shai Almog

Lightweight development like we did in Codename One. It's pretty much the only way to get WORA that doesn't compromise like hybrid web.

QT effectively takes this route as well and has proven some of it's abilities.

To all reading this, it's got wrong info by Trevor Chadwick

Xamarin has Complete coverage of all iOS and Android API's. At it's worst all business logic and data access is shared, but at our company, we used xamarin forms and shared 95% code cross platforms, and that includes a custom camera interface and overlay. We were able to shave 3 months off a 6 month development project and had Complete access to every platform api with no restrictions, and now that its free, xamarin should be the go-to development platform. No-Compromise.

React Native not on the list? by Dmytro Lapshyn

It's a bit surprising to see that React Native has not been mentioned in the article

Re: To all reading this, it's got wrong info by Ritesh Patil

We used Xamarin forms and shared 95% code cross platforms. Percentage code shared depends on the needs of your application. For B2C applications, the UI expectations are very high. The basic components in Xamarin Forms are not always sufficient.

To create custom components most of the times, one needs to write platform specific code (It is possible to write platform specific code in C#, but that doesn't mean it's reusable on both platforms). We did a social network type of app with Xamarin. The app had a lot of custom UI components, the code reuse we saw in that app was only 50-60%. For B2B apps and in house business process management apps, Xamarin is good. How much code reuse is possible, depends on the UI design and the type of the app you are developing.

Re: React Native not on the list? by Ritesh Patil

Hey,
Thank you for letting us know. Soon I will update in the post.

Re: To all reading this, it's got wrong info by Jason Steele

Also, Xamarin are more than "backed by Microsoft", they have been acquired and are fully owned by Microsoft.

I agree with Ritesh's comments, but would add that we use Xamarin.Android and Xamarin.iOS for B2C apps so that we have absolute control of the UI. Xamarin's SDKs provide 100% coverage of the platform SDKs.

Using an MVVM framework such a MVVMCross has helped us achieve code sharing of 80% across the two apps.

Nice info by mrunal khatri

Very nice information shared here. For cross platforms app i have a very good link bit.ly/2cyLSZV. Hope will be helpful to you. Thanks

Re: React Native not on the list? by Ajay Jadhav

I am also surprised that React-Native is not mentioned.

The Qt framework by tamir Israely

As mentioned here, Qt is a great option for cross-platform development. V-Play is based on the Qt framework but focuses on cross-platform mobile development . With V-Play you can Create Animated UIs, Enjoy Native UX, and Access Advanced Mobile Components. Integrate Plugins for Monetization, Analytics and User Engagement in Less Than 10 Minutes. Design and Release Cross-Platform Apps in Hours. Save Time and Money When You Develop with V-Play. v-play.net

So Adobe AIR is not even worth mentioning aha? by Young Gary

Or ...

App development by Peter Jackson

While go through the overall info, xamarin is the best one for cross platform mobile app development. But still i have confusion to pick the right medium for my app development project, Also I enquired one of the xamarin app development service here goo.gl/ZwRXA9

Measuring Pros & Cons of Cross-Platform by Dindayal Gupta

Good Insights Ritesh Pati. I loved it, hope to see similar more. I too share the opinion and believe that cross-platform is the future of mobile app development. Frameworks like Corodva and libraries like Ionic are equipped with a host of APIs and tools to allow developer add as many features to an app as they want. (Dindayal Gupta, Root Info Solutions).

Interesting Post by Hemang Rindani

It has been written and heard a lot about cross-platform mobile applications just to confuse a layman to select the best method tool for app development.

I wish the confusion will be resolved after looking at this article. Xamarin is an all time great platform along with PhoneGap which I feel is rightly mentioned in this article.

Thanks for a great post.

Re: In the move to mobile people forgot the other approach by Bruno Muniz

CN1 is not the only one. I use www.totalcross.com for several year and it really deliver WORA for iOS, Android and even desktops.

Thanks for the post. I read two articles by Alex Black

The benefits of cross platform are, firstly: time and cost saving. What is more -extended audeince and client base, easy launching…The native app is also an advantageous solution. User Experience, ample opportunities, gazillions of design options, etc. The pros and cons of each option are explained here in detail bit.ly/2qbOPJX and bit.ly/2oMKTKG

good article by Marcus Miller

Great article! With so many blogs discussing cross platform app development and the recent surge that we are witnessing today in the use of this time saving and comparatively inexpensive method, this article does stipulate the pros and cons in a very simple and concise way.

Nice material by Vadim Voronovskiy

It's a good idea to create an app that could work on almost all platforms. But as for me, native development has many more advantages, but there are areas in which cross-platform technologies are justified, such as the gaming sector and test projects. But the cross-platform development of mobile applications has many pros such as reduced time for development, immediate support and update of the product for all platforms at once and unified application logic. My opinion is based on this article written by my colleague John Barnett about the pros and cons of Xamarin which is widely used for cross-platform development: www.iflexion.com/blog/pros-cons-mobile-developm...

Re by Anastasia Yaskevich

Since the author draws a line between native cross-platform and hybrid development tools (which is, no doubt, a great advantage of this article), it would be logical to see the pros and cons of each type in separate sections as well.
Besides, now it looks like the cons of cross-platform development outweigh and outnumber the pros, yet most of the cons are those of HTML5 solutions, not ‘native cross-platform’ ones. Many of the advantages are sadly not mentioned too.
Generally, I agree with the author's final note, but by reading the last part of article I wouldn't have arrived at such a positive conclusion.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

18 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT