Should You Develop Native Cross-Platform Mobile Apps?
Should You Develop Native Cross-Platform Mobile Apps?
Learn why there are so many advantages to developing cross-platform applications, and the most popular frameworks to help get you started.
Join the DZone community and get the full member experience.Join For Free
The days when users were satisfied with only owning a single device are long gone. Today, businesses that invest in mobile applications need to think about countless mobile devices with different OS. If you want a seat at the table, your mobile application needs to support iPhones, Android phones, iPads and various other tablets, Windows Phone, Amazon Kindle, etc.
When asked for advice, developers are faced with a dilemma: developing a native mobile app or going cross-platform? The answer is not only up to them. Businesses know which type of device their customers are used to, and are ready to invest in a mobile app that needs to run smoothly in the world where Android and iOS dominate the market. However, developers can recommend one or the other, and we've outlined the benefits for both.
Introducing Cross-Platform Apps
Ideally, cross-platform apps function on multiple OS's with a single code base. We distinguish two types of these apps: Native and Hybrid "HTML5" cross-platform apps.
Creating Native Cross-Platform Applications
Big mobile OSs have their own SDKs for creating mobile apps. These Software Development Kits state their preferred programming languages. For example, for iOS, the languages supported by Apple are Objective-C and Swift, Swift being the most popular one. When it comes to Android OS, Java is the way to go, according to Google. Mobile applications created with these supported languages using the official SDK are referred to as "native apps."
Be that as it may, one can use Application Programming Interface or APIs provided by the native SDK in a different programming language, which the OS doesn't support. This is the idea behind creating cross-platform native apps. A third-party vendor selects a programming language and produces a unified API over the native SDK. With this API, supporting other OS with a single code base is possible. This vendor provides an Integrated Development Environment, an IDE which controls the process of producing the native app bundle for Android and iOS from the single cross-platform codebase.
As the app produced still utilizes the native APIs, the cross-platform native apps can attain near-native performance.
The State of Implementation Today
Although creating these applications is fairly easy, the state of implementation is not complete. Many mobile apps are heavy on Graphical User Interface (GUI) implementation side. Having in mind that the UI (User Interface) and UXD (User Interface Design) differ for both Android and iOS, it's a challenging task to create a uniform GUI. An application designed to work within the framework with all its limits will be successful, however, anything that doesn't fit will require additional hard work in writing platform-specific code.
For example, in Xamarin forms, a simple change such as custom colored borders to text field requires additional coding work. Xamarin Labs are working to provide better cross-platform UI components, and they just might do that by the time you're reading this article.
There is a very popular approach which involves writing web service calls and business logic using cross-platform libraries and writing GUI related code with platform-specific libraries. This allows for a higher percentage of the code to be reused.
The Most Used Native Cross-Platform Frameworks
Xamarin: Xamarin has been under the ownership of Microsoft since 2016. The platform prefers C# as a language for development and since many large companies have in-house C# programmers they tend to favor Xamarin as a great investment.
Why You Should Develop Cross-Platform Mobile Apps
Reusable code - Rough estimates are that around 70% of the code can be reused across-platforms.
Easier maintenance - If a bug appears in the common codebase, once it's fixed, it's fixed everywhere.
Budgeting - Since unit tests only need to be written once for the common code, the budget can be saved and repurposed to writing detailed unit tests. Maybe even practice test-driven development.
Availability - It's possible to use existing in-house developers rather than acquiring new talent.
Speed - Cross-platform apps are ideal for B2B use cases where time to deployment and use of resources are more important than sleek design.
Some Cons to Take Into Consideration
Native cross-platform app SDKs are not "there" yet. GUI needs to be re-coded many times to attain platform-specific look and feel.
Creating an app for multiple platforms with requirements for platform-specific UX is challenging. Each of them has defined their own human interface guidelines and it's difficult to support them with a single code base.
Mobile OSs are evolving on a daily basis, with more and more features added each year. This prompts the cross-platform SDK vendors to offer new versions of their SDK shortly after the release of a new Android or iPhone OS version. The app developers then need to work additionally to upgrade the app to newer versions of the SDK.
Is It Worth It?
Yes. Even though native app development is 100% compatible with the platform, ensuring smooth performance, there are use cases where native-cross platform apps can offer adequate performance at a lower price.
Opinions expressed by DZone contributors are their own.