Monday, July 18, 2016

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.

Monday, March 7, 2016

Compared: Xamarin vs Xcode - iOS App Size and Startup Speed

In Xamarin I created a Single View App targeted for iOS and Android with a Shared Library. I changed the scheme to Release and removed the button click logic from ViewController.cs since Xcode's doesn't start with any button click logic. I confirmed that debugging was not enabled by putting a breakpoint in the ViewDidLoad() event, and it never hit that breakpoint. The deployment target was set to iOS 9.2.

In Xamarin I created a Xamarin.Forms App targeted for iOS and Android with a Shared Library. I changed the scheme to Release. I confirmed that debugging was not enabled by putting a breakpoint in the App() method, and it never hit that breakpoint. The deployment target was set to iOS 9.2.

In Xcode I created a Single View App using Swift targeting Universal devices. I opened the Run scheme, changed it to use the Build Configuration of Release and unchecked Debug Executable. Under Options I unchecked Core Location, XPC Services, View Debugging, and Queue Debugging. I also added a UIButton to Main.storyboard since Xamarin's starts out with a button on the storyboard. I confirmed that debugging was not enabled by putting a breakpoint in the viewDidLoad() event, and it never hit that breakpoint. The deployment target was set to iOS 9.2.

In Xcode I created a Single View App using Objective C targeting Universal devices. I opened the Run scheme, changed it to use the Build Configuration of Release and unchecked Debug Executable. Under Options I unchecked Core Location, XPC Services, View Debugging, and Queue Debugging. I also added a UIButton to Main.storyboard since Xamarin's starts out with a button on the storyboard. I confirmed that debugging was not enabled by putting a breakpoint in the viewDidLoad() event, and it never hit that breakpoint. The deployment target was set to iOS 9.2.

File Size on my iPhone 6 Plus running iOS 9.2.1 (13D15)
  • Xamarin Native:  8.6 MB
  • Xamarin Forms: 32.9 MB
  • Xcode Swift: 17.0 MB 
  • Xcode Objective C: 340 KB 
Startup time before the main storyboard is displayed on my iPhone 6 Plus running iOS 9.2.1 (13D15)
  • Xamarin Native: Less than 1 second (with a Xamarin branded launch screen before that)
  • Xamarin Forms: Less than 1 second (with a Xamarin branded launch screen before that)
  • Xcode Swift: Less than 1 second (with a blank white launch screen before that)
  • Xcode Objective C: Less than 1 second (with a blank white launch screen before that)
I was using Xcode 7.2.1 (7C1002) and Xamarin 5.10.2 (build 56)

Saturday, March 5, 2016

Solved: Splash Screen for Xamarin.Forms Android Project


When launching a Xamarin.Forms apps for Android it starts out on a regular Activity while it prepares and launches the Forms activity. This delay is not very pretty and displays a regular android activity for maybe 2 seconds (on my Galaxy S6) before launching the intended Xamarin.Forms screen.

While it is probably not possible to speed up the load, there is something you can do about the look of the app while the Forms activity is loading: and that is to display a splash screen.

First I thought I could just add my own class, call SetContentLayout and be on my way, but even the process of loading a layout has a delay. It isn't two seconds like when loading a Xamarin Forms activity, but there is still a noticeable delay. What you really need, as Thomas Burkhart and Chris Stewart recommend is a splash screen.

Xamarin has sample code for implementing a splash screen in a Xamarin.Android project. This example code takes a graphic and stretches it across the whole splash screen.

Chris Stewart's example shows how you can center an icon in the middle of the splash screen instead of filling the screen with one graphic.

Saturday, February 20, 2016

Introducing Sensory Sand App for Android

I am pleased to announce the release of my latest app: Sensory Sand.

It is a relaxing sensory sand game using gravity and physics. The app has multi-touch support for dropping multiple streams of sand. Move the obstacles to make your own patterns to watch as the sand falls.

It is currently available for Android. The iPhone version is in the works.

Download Now for Android

Preview Video


Friday, February 12, 2016

Announcing Cost Per Square Metre Calculator for iPhone

I am pleased to announce the release of my latest app for iPhone: Cost Per Square Metre Calculator.

This app helps real estate agents and home buyers quickly and easily calculate the cost per square metre of a house.

Download it today for free on your iPhone!

Saturday, December 5, 2015

Introducing App Vendor - New Mobile Platform For Uniting App Developers With Investors

I am excited to announce the release of one of my latest apps: App Vendor.

App Vendor is a new platform designed for connecting software developers and investors.

What kind of software developers? Those who have already made and released apps but aren't able to take them to the next level due to either lack of time or financing.

What kind of investors? 2 kinds: 1) Development firms who would like to purchase ownership of existing apps that already have a user base to add to their own portfolio. 2) Entrepreneurs who would like to break into the app scene by buying the rights to an existing app rather than build one from scratch.

App Vendor does not process the purchase or sale of the apps. Instead the platform provides a means for developers to list their apps, investors to browse the listings, and provide a way for the investor to connect with the developer.

Currently the app is free. In the future there may be a paid option for premium functionality. Download the app and signup today!

Get App Vendor for iPhone or Android



Wednesday, October 21, 2015

Slo-Mo: Ionic 2 Alpha vs 1.1 Sliding Animation on iPhone

The Ionic team announced the alpha version of Ionic 2 yesterday. According to the article, Ionic 2 has a "new animation system" as well as "dramatically improved performance".

I recorded two videos in slow motion comparing the difference between sliding forward and back using the default templates for Ionic 1 and Ionic 2, as well as the built-in Settings app.  on the iPhone 6 running iOS 8.3 and the iPhone 4 running 7.1.2.

For each test app, I ran ionic run ios --device to install it onto the physical device.

The things I noticed in Ionic 2 are:
  1. On the iPhone 6, the sliding animation seems to be less choppy than on Ionic 1.
  2. After tapping a list item there is a longer delay than in Ionic 1 before the new screen starts sliding into view.
  3. On the iPhone 4, there is a noticeable blank-out flicker before sliding in the new view.
Watch my videos and see if you agree:


iPhone 6

iPhone 4



For reference, here is the ionic info output for each of the apps:

Ionic 1:

Cordova CLI: 5.3.3
Gulp version:  CLI version 3.9.0
Gulp local:  
Ionic Version: 1.1.0
Ionic CLI Version: 2.0.0-alpha.9
Ionic App Lib Version: 0.5.0-alpha.9
ios-deploy version: 1.5.0 
ios-sim version: 3.1.1 
OS: Mac OS X Yosemite
Node Version: v0.12.5
Xcode version: Xcode 7.1 Build version 7B91b

Ionic 2


Cordova CLI: 5.3.3
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Version: 2.0.0-alpha.30
Ionic CLI Version: 2.0.0-alpha.9
Ionic App Lib Version: 0.5.0-alpha.9
ios-deploy version: 1.5.0 
ios-sim version: 3.1.1 
OS: Mac OS X Yosemite
Node Version: v0.12.5
Xcode version: Xcode 7.1 Build version 7B91b