Writing code for mobile devices offers a unique set of challenges that require thoughtful consideration. By discussing some of these ideas, hopefully you can get some ideas how to approach your next mobile project.
When I first started out as a mobile app developer, I was constantly struggling with the question of how to build the best experience on the most devices with the least effort. A survey of my peers offered little help – usually I get a passionate overview of a favorite platform, but invariably we end up with the same outcome: “It depends.”
This answer, while frustratingly vague, is probably the best you’re going to get. Writing code for mobile devices offers a unique set of challenges that require thoughtful consideration. By discussing some of these ideas, hopefully you can get some ideas how to approach your next mobile project.
There are three standard approaches to developing mobile applications:
Native – Develop an application for each platform using the vendor development tools, the way God intended
Shared codebase – Use a common codebase to reuse some back-end business logic but develop user interfaces using a native approach
All of these approaches have improved rapidly over the past five years, to the point where each is a viable option. In the newest versions of their mobile OS’s, Apple and Google have vastly improved hybrid application performance by creating faster runtimes than ever before – effectively ushering in a new breed of hybrid app with performance much closer to their native counterparts. Web frameworks and libraries have also proliferated and improved substantially over the last five years. In addition, several shared codebase app frameworks (Titanium Appcelerator, Xamarin) have become successful and used in many high-profile apps. Even Apple and Google’s own native tools have become easier to use and more stable.
In many cases, timelines and development team experience may dictate what technologies you can use. Hybrid apps really shine for building rapid prototypes since there are many mature tools that are familiar to a large number of developers. As a result, it can be attractive to build hybrid first and jump to native only when (and if!) there is a need for more performance. In computer science, we talk about this in terms of premature optimization; defer the work of optimizing your solution until the last possible moment.
Developing fully native apps has an extremely intimidating barrier to entry. Developing apps for the three major platforms (Windows, iOS, Android) requires a development team with expert knowledge of at least three programming languages (C#, Objective-C/Swift, Java). Building this talented team can seem daunting at first, but after this initial learning curve, developers will typically be more efficient compared to hybrid. Take Xero for example, who switched from hybrid to native after the complexity of their HTML5 application made it impossible to iterate fast enough. We are seeing some of the complexity of HTML5 apps becoming more manageable as frameworks improve, however.
Shared codebase apps attempt to lower this barrier of entry by allowing developers to write apps in a language they are familiar with. While the initial learning curve may be lower, there is inevitably a point where the framework starts to get in the way; be it from unstable development environments, lack of community, or simply missing features. With that being said, I’ve been paying close attention to Xamarin (a shared codebase technology) and have watched as they’ve resolved many of these shortcomings. Xamarin also brings with it the awesome language features of C#, which makes writing apps considerably easier, especially to those developers (like me!) who know and love C#.
DevFacto’s Decision Process
At DevFacto, we consider three main criteria when evaluating this decision: Performance, UX, and Tool Preference. Apps should be uncompromising on these metrics. If an app is slow or the interface doesn’t suit the platform, users won’t find the app intuitive or engaging. If we don’t use the right technology, developers won’t be able to build, integrate, or maintain the app effectively.
I’d like to go into a little more detail about user experience. In particular, when designing your app, remember to respect the platform:
Good app design is one of those things where you know it when you see it. Intuitive interfaces and engaging experiences affect whether users love or hate the app. Since each platform has a well-defined and opinionated set of rules for how user interactions look and feel, users have subconscious expectations of how to use it. This includes simple things like the color of the status bar and the interaction a button has to touch. When an app breaks these conventions, it disrupts user’s intuition and forces them to think harder in order to complete a task.
Hybrid apps regularly eschew these conventions, mostly due to the difficulty of replicating a native app UI using web technology. Sometimes this is merited, like when a line of business app is expected to look and behave the same across multiple platforms. A business may want to create their own aesthetic and have consistency between each of the platforms instead of strictly adhering to conventions. However, any deviance should be used sparingly and done thoughtfully. Most importantly, this is not an excuse to avoid dedicated design time.
This is one key advantage of using native technologies since it will always naturally enable the most powerful experiences that are most familiar to users. By using a standard set of controls, developers leverage years of best-in-class user experience research from platform vendors. This is undeniably the route to take if you want to provide an uncompromising experience for your users.
There Is Hope
Hybrid, Native and Shared Codebase approaches can all succeed based on the important metrics: Performance, UX, and Tool Preference. The success of your app relies as much on your effort and experience as it does on the technology you choose. This should be a relief as well as a responsibility. Building mobile apps takes time and patience; when you get it right though, your investment pays off. Mobile apps can make business more effective, drive adoption and reduce training. If you carefully consider the platform, your app should also stand the test of time.