Introduction to Cross-Platform Mobile Development
Date: Friday, March 16, 2018
Smartphones nowadays come in all shapes and sizes, but the differences do not end there. When you think about developing a mobile app, it is important to consider different mobile platforms available on the market. Your choice of mobile platform will determine the type of audience your app will reach. If you want to develop an app for only one platform it will target only the users of that platform, such apps are referred to as native apps. If you want the most coverage, you might think about making your app cross-platform. But let’s start from the beginning. What is the difference between native and cross-platform apps?
Native vs Cross-Platform
Native apps implement features of only one target platform using its platform specific programming language and framework. For example, Android applications are developed using Java programming language. On the other hand, the applications for iOS are programmed in Objective-C or Swift. Because the app is written for that one specific platform it can take advantage from all features of targeted operating system. The native applications can use device-specific hardware and software to ensure the best user experience.
Why your app should be cross-platform?
First of all, developing for only one platform will restrict the target audience of your application to that specific platform. Normally, the developers that wish to reach a bigger audience are forced to develop their apps for each platform separately. If your app is supposed to target two major platforms, iOS and Android, you have to create two apps in different languages and using different development environments. This approach is highly inefficient as it requires implementing the same functionality multiple times. What follows is the increasing maintenance costs, as you have to deal with two code bases, every change need to be carried out in both projects simultaneously.
Cross platform development is an alternative approach to native mobile development and it addresses above mentioned challenges. This approach lets you implement an application as a single code base that can be executed on a range of different platforms, avoiding code repetition and increasing productivity. It also reduces the maintenance costs as you have only one code base to worry about. But this approach can also create some problems when implementing a complex system. A common problem with cross-platform tools is that they are designed to build an application with most common features that are shared across all different platforms. In the case of simple projects, it might not cause any problems, but when the design of the application requires the platform specific features, the cross-platform tool might not be able to support this functionality.
So, what now?
Is there any middle ground between code reuse and achieving a look and feel of the true native apps? I think there is and it is called Xamarin, a cross platform development tool that uses C# programming language and allows for building mobile apps with native user interfaces and share the code across multiple platforms. More about Xamarin in my next post.