Mobility has become part and parcel of any organization. The size is or no relevance. Most businesses operate on myriad of mobile devices with various operating systems. In the past, business had only one app operating system and were happy with it. In recent years it has become imperative for business to have mobile app that is well supported by a plethora of OS such as Android, iPhone, Windows Phone, Amazon Kindle, Tabs, BlackBerry, etc. Cross platform mobile development fills this void.
This environment has posed a great challenge for app developers. They are in a dilemma, they have to choose between a native mobile app or cross-platform. One may have different types of customers who possess different types of devices. A developer has to develop apps that could work seamlessly on almost all the platforms (i.e. Android, iOS, Windows, etc.)
Mobile operating systems offer Software Development Kit (SDK) to create mobile apps. These are actually the preferred languages supported by the OS vendor. They are:
IOS – Objective C and now Swift 2, Google/Android – JAVA, Windows – C#
Cross platform mobile apps are designed to work across all these operating systems with minimal changes.
In general, third party vendor chooses a programming language and creates a unified API on top of the native SDKs provided by the various OS vendors. It is possible to support multiple operating systems with a single code base with this unified API. Integrated Development Environment given by the third-party vendor handles the process of creating the native application bundle for iOS and Android from the single ( almost) cross-platform code base.
As the app thus produced uses the native APIs, the cross-platform native apps can accomplish near native performance without any visible lag nowadays.
Current State of Implementation cross platform mobile development
Creating cross-platform native applications and implementation is smarter. Such mobile apps are heavy on the GUI (Graphical User Interface) implementation side i.e. business application logic resides on the server, which is accessed by the mobile phone via RESTful web services.
The User Interface (UI) and User Experience Design (UXD) of iOS is different from Android, thus making it slightly difficult to create a uniform GUI wrapper on top of it. It is heartening that Ionic and Xamarin and others are working on making it as easy as possible
Native cross-platform mobile 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
Apache Cordova / Adobe Phonegap is easily first in the list as the best performance apps can be built from these with all native features.
Flutter from Google is next now with native performance. Flutter’s widgets incorporate all critical platform differences such as scrolling, navigation, icons and fonts, and your Flutter code is compiled to native ARM machine code using Dart’s native compilers. Thus Flutter gives you full native performance on both iOS and Android.
Xamarin has now been bought by Microsoft. 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, big companies have C# programmers already in their in-house IT departments. These enterprises tend to regard Xamarin as a good investment for cross platform mobile development.
Appcelerator Titanium is an old player in this domain. They are supporting both Android and iOS. Appcelerator Titanium uses JavaScript as the main language for development and aims at bringing familiar web development paradigms to native mobile application development.
React Native from Facebook and also 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. 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.
QT: QT is an old cross-platform desktop development libraries. They support for cross-platform iOS and Android applications in 2013. In the hands of experienced C++ programmers, QT can be quite productive.
Cross platform mobile app development
Mobile apps are GUI applications. Most mobile apps depend on back end 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 , the webview in their SDKs.
Apache Cordova was originally known as PhoneGap bought by Adobe from Nitobi. It is the most popular hybrid cross-platform framework with a lot of Phonegap plugins. It supports all of the major modern smartphone operating systems.
Hybrid applications use HTML, CSS and JavaScript code 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.
Pros and Cons: Cross platform mobile development
Cross-platform mobile app development: Merits:
With good planning around 50%-80% code reuse can be realized across-platforms. This results in faster development and reduced costs.
Cross platform mobile development is more beneficial during the maintenance. Bugs are is found in a common code base it needs to be fixed only once. Much easier than say dealing with those xmls say in Android.
Unit tests are required to be written only once for the common functional web view codes.
Existing programming talent is more than enough rather than learning platform specific development language which is arduous to say the least.
Ideal for B2B apps and business process automation apps.
Cross platform mobile app development: Cons
In general, phones are not 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.
HTML and CSS use advanced features like gradients and require a lot of CPU and GPU resources. So, HTML5 based apps consume significantly more battery, although not nowadays, compared to native apps or native cross-platform applications.
HTML5 hybrid apps depend on callback-style programming to communicate with native plugins, which makes the code unnecessarily complicated.
The GUI needs to be coded multiple times to obtain platform specific look and feel.
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 differently and supporting them with a single code base turns out to be very challenging.
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 SDKs.
Though native app development offers 100% platform compatibility and may be smooth performance, for B2B solutions and for business process automation projects, cross-platform or hybrid application development techniques offer good performance in a cost effective manner and is smarter.