Choosing the Right Mobile Development Framework

When choosing a mobile development you first need to decide what your goals are in the long run. There are two ends of the spectrum. The first being 100% cross-platform code sharing, with the second being native feel and performance.

Xcode is Apple's recommended IDE for app iOS development.  It uses Objective C or Swift as the programming language. Using these will get you a fast, native app without any loss of performance. When using Objective-C, your resulting binary will be smaller than if you use Swift.

Android Studio is Google's recommended IDE for developing on Android. It is currently a customized build of Intelli-J, but previously it was a customized bundle of Eclipse with extra plugins. These tools use Java as the programming language.

Visual Studio is Microsoft's recommended IDE for developing Windows Phone apps. Developers can use C# or Visual Bascis.net to build apps.

The three IDE's mentioned above each have their pros and their cons. The main pro is that there is official documentation from each of the Vendors on how to use the IDE, documentation on how to write code for the corresponding app development, and the least amount of bugs or missing features in the framework compared with third-party alternatives. The primary con is that there is no cross-platform code sharing. If you write your code in Xcode with Objective-C or Swift for iOS, you will not be able to re-use any of it for the Android version. Similarly, your Java code for Android won't be able to be re-used in an iPhone app.

Enter the world of cross platform frameworks


There are several frameworks for sharing code across platforms, but the three I will discuss here are Xamarin, Titanium/Appcelerator, PhoneGap,  Ionic Framework and Telerik Platform.

Xamarin uses C# for code-behind files and XAML for front-end development. The primary benefit of Xamarin is that you can write your code in C# and compile it natively for the three major mobile platforms. However, when writing UI code, that has do be done separately for each platform unless you use the Xamarin.Forms library, which is a dummied down cross-platform UI library. The package of UI components shipped with the library is fine for simple apps, but if you want to get more advanced, you'll have to make your own cross-platform UI components. Since Xamarin uses C#, it is strongly-typed, leading to less bugs over time in larger projects. Even though you write your code in C#, you still would benefit from having an understanding of how each different platform works, because any code that interacts with the platform itself, (like showing native popup dialogs) still uses the API specific to that platform, but in C#. Xamarin is free for Indie developers or smaller companies.

Titanium/Appcelerator uses JavaScript as the programming language, and it too compiles natively for all all three major mobile platforms. The last time I used it, however, I ran into strange behavior in the debugger and in the UI. I also found that when using the WebView UI component, it had limited functionality. It is my assumption that if the WebView has limited functionality, then other components must also.  It has been a couple of years though, so maybe things have progressed. However, since JavaScript is not strongly-typed, and since even the smallest license of Appcelerator comes at a fee, if I had to choose between Appcelerator and Xamarin, I would choose Xamarin.

PhoneGap is a framework that allows you to write your code in HTML and JavaScript or TypeScript. Your HTML and script files are shipped as part of the native app, but they are displayed in a webview. Because of the nature of being rendered via a webview, they cannot run at the same speed that a native app runs. Though, when done properly, the resulting app can still be usable enough to where the average user would not notice or care about the difference. Once primary challenge that has to be overcome when developing with PhoneGap is that the webview implements a 300 millisecond delay before it processes a tap event on a button or a link. You can either write your own code to take care of this issue, or you can get a library like FastClick to do it for you. You would also be responsible for coming up with your own "mobile-like" UI components, or finding a library like jQueryMobile to take care of that for you.

Ionic Framework is a conglomerate of an HTML5 UI framework along with a set of command line tools and online services. Ionic runs hand-in-hand with PhoneGap. The UI later is written in HTML5, and the scripting layer is written in JavaScript or TypeScript. Ionic 1 uses Angular 1, and Ionic 2 uses Angular 2. At the time of this writing, Ionic 2 is at beta 10. Ionic not only allows you to develop for the three major mobile platforms, but it also allows you to publish your app as a web app.

Telerik Platform is also a combination of a UI later which sits on top of Phonegap, along with other tools. When I compared Telerik's UI to a similar UI I built in Ionic 1, Telerik felt slower and more clunky.

With any third-party framework, I assume you are going to run into glitches here and there. However, out of Xamarin, Titanium/Appcelerator, and Ionic, I have seen the least amount of problems come from Xamarin.

Which path should you choose?


That depends on where you want to end up. 

Gold: If you have a very large budget, and it is critical that you have the most powerful, smooth, and efficient app as possible, and you need to guarantee that you will never run into a roadblock, and you do not care that it will cost you three times the price, then I recommend that you go with Xcode, Android Studio, and Visual Studio.  This avenue will cost you the most money in the beginning (because you will be developing essentially three different apps) as well as in the long run (since you will have to fix bugs potentially three different times). You will have to hire an Objective-C or Swift developer, a Java developer, and a C# Developer, or you will need to find someone who specializes in all three and hope that he does not get burned out having to write the app three separate times. You will need to have a Mac as well as a PC for compiling the apps. If your app has icons within the app (for things like adding users, or deleting items) you will also need a graphic designer to produce icons for each platform.

Silver: If you have a medium sized budget, but still want a native-feeling, smooth-running app, and are willing to take the chance that there might be some small feature, somewhere in the future that a third-party IDE does not offer, then I would recommend Xamarin. You will need to hire a C# developer. You will only need to write the majority of the app once, for code sharing across platforms. You will need a Mac as well as a PC. If your app has icons within the app (for things like adding users, or deleting items) you will also need a graphic designer to produce icons for each platform. There is someone who figured out how to use FontAwesome icons, but I haven't tried it how to see how well it works across platforms.

Bronze: If you are on a limited budget, and you are willing to give up the smoothness and power that comes with native, then I recommend Ionic 2 Framework over Telerik because of it's speed. You will want to hire a HTML5/TypeScript developer. You will need a Mac and a PC, unless you opt to use Ionic's cloud-build service. In the long run, assuming you don't run into glitches in the framework itself, you will be writing code that is 100% sharable across platforms. This includes app icons as well. Since Ionic uses FontAwesome icons which are cross-platform, you won't need to have a graphic designer create icons for each platform.

Comments

Popular posts from this blog

Parameters Sent by TinyWebDB in App Inventor for Android

Adobe® Flex® Combobox: Selecting an Item Without Using SelectedIndex