Going cross platform on mobile, part three: Cross platform development tools

There are many tool options available for facilitating cross platform development.  Which one you pick will depend on what skills and resources you have available to you and what kind of app you intend to develop.

Even if you’re just starting out in mobile development and are looking to adopt one of these tools from the outset, it is still worth considering taking the time to at least develop a simple app natively in both Android and iOS.  Why?  Firstly it will make it easier to understand what is going on under the abstraction layer that a cross platform mobile development framework provides.  Secondly it will also help you determine how much value a cross platform solution will offer you, in terms of development effort and the number of platforms you’re aiming to target.

App factory drag and drop “no coding required” solutions will provide efficiency through speed of upfront development, and may be the right decision for you if all you desire is a quick to market newsfeed app, a simple POC or something else of that ilk.  On the other hand cross platform IDE “code once, deploy many” approaches accommodate and require a more complex code-oriented development process, but are able to produce much more sophisticated products and will provide the return on investment once you begin to deploy over multiple platforms.  Sometimes, despite all the alternatives on offer, it may be that a native approach is still the better option after all.

In all cases you need to know your development and deployment strategy up front in order to choose accordingly.  Also remember to test your work on devices to get the truest reflection of performance, as it really is the only way you’re going to know for sure how your app will perform on the platforms you’ve targeted.

 

More choices than you can shake a smartphone at

As mobile app development matures, a mobile presence is becoming a necessity in more and more business sectors.  With that comes the increased need for cross platform solutions that meet a variety of needs, allowing a variety of apps to be developed in more cost efficient ways.

Truth be known there are now a lot of tools available for cross platform development, and they cover the whole spectrum of needs; tools that assist in the development of native apps based on a single source of code, tools for developing apps that leverage well known web technology skills, and we also have tools for non developers that allow quick creation of web and native apps in very, very short timeframes (these are functional, but don’t expect to win any awards for your app if you go down this particular path).

The chart below from research2guidance’s report on cross platform tools gives you a good idea of what’s available, and additionally orders them into developer awareness based on the findings of their survey:

Chart-for-blog-post

*Note – due to extremely low awareness, more than 50 tools included in the survey weren’t included in the chart.

Plenty to choose from then.  You can see that Adobe Air, Phonegap (Cordova), Xamarin and Unity 3D are the most well known, although I would add Titanium, Sencha Touch and Marmalade as the other main ones out of the list that I’ve come into contact with.

The survey of developers also highlighted the following opinions and feedback on cross platform development solutions (if interested you can download the full report directly from the research2guidance site):

  • Only 11 cross platform tools (out of the 90 cross platform tools identified by the report) are known by more than 20% of the app community surveyed.
  • For the majority of developers already using cross platform tools, these environments have become their primary development platform.  63% of cross platform tool users develop more than 50% of their apps using a tool.
  • Saving time is one of the main benefits of cross platform tools.  Up to 75% of users have indicated that they can reduce app development time by more than 40%.  The time saved increased with the number of platforms being targeted for deployment (peaking at 5-6 platforms).
  • Overall, cross platform tools are rated well by the developers that use them.  A high rating was indicated for platform coverage (83%), availability of pre-installed apps (57%), API cloud service (52%), access to device hardware features (64%) and support (63%).  The overall cost-performance of cross platform tools is rated by 85% of the users as high or very high.
  • However it was clear that app performance is seen as the main weakness of cross platform tools.  50% of all developers rate the performance of the apps that are being developed by cross platform tools as considerably lower than that of their native counterparts.
  • Despite the high user satisfaction with these tools and positive feedback indicated by the report, less than 5% of all apps available in today’s leading apps stores are being developed with the help of cross platform tools, suggesting the need for vendors to increase awareness amongst those that have not tried cross platform tools yet.
  • Corona and JQuery Mobile were rated to be the tools of lowest complexity, whilst Titanium and Marmalade were rated to be the highest in complexity.
  • In the benchmarking, users of Unity 3D and Xamarin could obtain the highest time-savings – in contrast, the lowest time savings were obtained by Marmalade and Titanium users.
  • The tools with the highest app quality were Xamarin, Unity 3D and Marmalade.

For me the above highlights the increasing desire for efficient cross platform development solutions.  It also indicates that, when deciding which tool is the right one for you, you need to be definite about what kind of app you’re developing and be clear on the development skills that you have to hand.  This will help you pick the right tool for the product you have in mind and avoid disappointment associated with unexpected tool complexity and below expectation performance.  Check out as many sources of information and opinion as you can in order to shortlist your options, and if you have the time available to trial run a selection then even better.

 

Information on three to start you off

Below is an overview of the three cross platform development frameworks we’ve looked at most recently.  They provide links to further reading and should give you a good starting place for your research:

Appcelerator Titanium

Appcelerator Titanium is an open, extensible development environment for creating native apps across different mobile devices and operating systems including iOS, Android, and BlackBerry, as well as hybrid and HTML5.  It includes an open source SDK with over 5,000 device and mobile operating system APIs, Studio – a powerful Eclipse-based IDE, Alloy – an MVC framework, and Cloud Services for a ready-to-use mobile backend.

There is a free Developer tier, and an Enterprise level (with Public Cloud and Virtual Private Cloud options) that offers more features – price on request (http://www.appcelerator.com/plans-pricing/).

Appcelerator Titanium allows you to build native mobile apps from a single code base using web development languages (HTML, JavaScript, CSS, Python and Ruby), removing the need to manage multiple developer toolkits, languages and methodologies.  App data can be stored in the cloud or on the device, and apps can take full advantage of hardware, e.g. camera and video capability.  Appcelerator apps go through a compilation and optimisation process that results in apps that should look, feel, and perform like native apps (as you are using the native UI components).  You use a cross platform mobile development custom API to build the app. This approach is different to PhoneGap or Xamarin:

  • With Xamarin you use a wrapper around the real native SDKs
  • With PhoneGap you use whatever you want to build an HTML5 web application.

With Titanium you write all of the code against their SDK – that includes UI components as well.  This means that when you write a Titanium application you can actually write a cross platform user interface as well, and the app is compiled down to a completely native application that uses the real native controls for the platform in question.

In reality though it’s not possible to completely build a cross platform app with a 100% code reuse because not everything has an equivalent across all platforms, e.g. iOS has the Navigation Controller that tracks what screens have been navigated through, but Android doesn’t.  So, some of your code needs to be conditional – you’re going to need code in parts of your app tailored to the specific platforms you’re supporting in order to get the very best results.  However, even at 70-80% code reuse the benefits are still apparent to Marijn Deurloo, CEO imagine:

“About 70-80% of our code can be reused across apps. That saves us a lot of time and a lot of skill.  It’s very hard to find different native skills and combine them in one team, but it is comparatively easy to educate people in JavaScript.”

Titanium has an MVC framework called Alloy that simplifies creating Titanium applications and removes the need to programmatically create all of the user interfaces.  You declare your user interface using an XML markup, then use controller classes to populate and interact with the UI.  There is also a style sheet approach that is similar to CSS.  The build process will also let you build a web application out of the same codebase.

An API repository marketplace offers the ability to buy and sell code to extend Titanium and there is an active developer community Q&A site for Titanium developers (http://developer.appcelerator.com/questions/newest) similar in tone to StackOverflow.

Finally, Titanium’s cloud offering lets you have access to their backend cloud services that allow you to create Facebook-like functionality without having to code your own backend.  The cloud services can be used to manage, authenticate and store data about users (e.g. social graphs, key value pairs etc.).

Book-wise, check out Appcelerator Titanium: Patterns and Best Practices

Work is currently being done on their next generation of Titanium called Ti.Next, which looks to improve performance and ease of development, as well as bring the IDE up to date.  Check out Jeff Haynie’s Thoughts on Ti.Next from July 2013.

PhoneGap (Cordova)

PhoneGap is a free and open source framework of JavaScript APIs that allows you to build web applications that are locally installed to the device with access to the native capabilities.

When you build an application using PhoneGap, you are essentially building a mobile web site for the device using HTML, CSS and JavaScript.  All layout rendering is done via web views instead of the platform’s native UI framework, but the resulting app is packaged for distribution like a native app and has access to the native device APIs.  From version 1.9 onward it became possible to freely mix native and hybrid code snippets.

The following chart shows the native libraries that are available to you through the PhoneGap JavaScript APIs:

pgfeat

http://phonegap.com/about/feature/

You develop a PhoneGap application, for the most part, like you would a cross platform mobile web site.  You can use any mobile framework you like, for example Sencha Touch, JQuery Mobile, etc. and have the potential to share just about all of your code across all target platforms since your application will be in HTML and JavaScript.  Bear in mind though that you will not be writing a native application in any sense of the word.  As your PhoneGap application runs in a web view it will be more like a web application than a native application.  The user interface you design will not use the native controls and will be subject to the limits and speed of the web view, which will not necessarily provide you with performance that matches the device’s web browser let alone native technology.

This means that you might have to write some platform specific code to make up for differences between the browsers, taking a hybrid approach to mix HTML with native elements to make the most of each (high interoperability and high functionality where it counts the most in the app).  You can basically assume though, that you will be able to share most of the code where beneficial.

Whatever environment you want to build in, you should be able to find a plugin for your IDE of choice.  There is also a facility called PhoneGap Build that allows you to upload your project, whatever environment you created it in, and build it automatically for other platforms.

Books:

Xamarin Tools

Unlike Titanium and PhoneGap, Xamarin is not free to use.  Companies or incorporated entities with more that 5 employees must purchase a Business or Enterprise plan: Business $999 per platform per developer, Enterprise $1899 per platform per developer

Xamarin tools allow you to develop an Android or iOS application with C#, and share a good amount of the code by using an abstraction on top of the real SDKs for iOS and Android (Xamarin.iOS and Xamarin.Android).  To get the most benefit it is good to have some knowledge of the iOS and Android platforms’ APIs.  Strictly speaking it does not provide a cross platform UI library, since each supported platform has its own different set of C# UI libraries with their own capabilities.  However, approaching software development using the MVC or MVVM patterns will allow you to write Model and Controller components that can be shared across all the platforms you’re supporting without any changes, leaving only the View component to be re-written for each platform.  With this approach it’s potentially possible to achieve 80-90% code reuse.

Xamarin has its own cross platform IDE called Xamarin Studio.  A recently introduced component store makes it easy to find reusable components directly from Xamarin Studio and plug them into your application.  Alternatively there is a plugin for Visual Studio.  You can even develop an iOS application from Visual Studio, but you will still need a Mac to perform the build (it uses a remote call to the Mac to perform the build).  As Microsoft and Xamarin continue to strengthen their integration you can expect Visual Studio support to continue improving.

If your in house team works predominantly with .Net/C#, then Xamarin offers you a means of leveraging that team’s existing knowledge (and codebase) of C# for development of iOS, Android and browser apps (and of course Windows Phone apps too).  Via the .NET CLR implementation, code can be compiled into modules of bytecode that are binary compatible across all of the supported platforms.

Book-wise you could consider Mobile Development with C#: Building Native iOS, Android, and Windows Phone Applications for a short intro to the topic, and Developing C# Apps for iPhone and iPad using MonoTouch: iOS Apps Development for .NET Developers, which is likely outdated in some aspects, but is still considered a good read by some I’ve spoken to.

 

The choice of approach is yours, but the goal is always the same

I hope you’ve found this three parter useful.  The overarching message is straightforward, even if it is not absolute: there is no right or wrong approach to mobile app development, as long as you put the needs of your product first.

Whatever solution you use for delivering your mobile presence, whichever tech stack best suits your needs and product, keep these core goals in mind: always build with the user in mind, build for speed and build for ease of use.  Build something you’re proud of.

Right now this is even more important when designing for mobile platforms using web centric technologies.  Worry less about mimicking native functioning and instead really focus on producing great UX and UI.  It should sit comfortably and function efficiently on mobile platforms in terms of processing power and screen real estate.  Until web technology can replicate native look and feel wholesale users will feel more comfortable with an experience that isn’t trying to deceive them – better to have an app centred on doing the job in hand efficiently and well, than to expend resource on pretending it’s something it isn’t.

Ideally if you’re developing mobile apps, taking the time to try some of the tools available for cross platform development is going to be the best thing you can do.  It will give you the first hand experience to clearly determine which, if any, fit the requirements of your upcoming projects.

Armed with knowledge of the market, knowledge of the types of app you can build and knowledge of the tools you can use to do so, you can make the right choices when it comes to building that next killer app.

Advertisements

One thought on “Going cross platform on mobile, part three: Cross platform development tools

  1. Pingback: Going cross platform on mobile | New Technology Development Team Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s