We interviewed Ariel Ben Horesh, who is one of our speakers at ConFoo Vancouver 2016. His presentation is titled “Can We Build Whatsapp with Xamarin and Azure in 60 Minutes? .” Ariel is a software architect and expert mobile developer. He is also the leader of .NET User Group and ALT.NET. He lives in Israel.
What are the challenges of developing for multiple mobile platforms?
Any mobile developer will say that to become an expert of a specific platform for example iOS or Android it takes much effort and resources. Developing for multiple platform at the same time will usually create separate teams and then, it's a managing challenge in various factors: Keep features aligned in each supported platform. Further more usually each platform has its own development language making it exceeding difficult to "move" developers between teams and more. It's also wasteful since it's very hard to share code and bug fixes, and you basically "pay" for each feature on any platform you support.
How does Xamarin solve the problem?
Xamarin is one technology that enables Cross-Platform development, in a nutshell, Xamarin itself compiles code to the native application package. It means that the application is running on the device in a similar way as if it was developed using the vendor specific tools such as Xcode, Android Studio, etc. Another alternative to cross-platform development is to use Web technologies such as HTML5, CSS3 and JavaScript to build agnostic application, those will run on a browser component built inside a regular application. For each approach there are pros and cons however it solves various problems, for example when we use Xamarin we will be using .NET API and languages such as C# or F#. By using similar framework and language you are able to share code and resources, you are able to move developers between teams since they are already proficient in the same language. The ability to share code increases when you use Xamarin.Forms, with that approach you are also able to define the views as well and still retaining the native look and feel of the application. This enables you to have 1 code base for the major 3 platforms: iOS, Android and Windows and write only once and target with this code all of those platforms. Xamarin also enables you to write platform specific code when needed.
When building with Xamarin, do developers sacrifice some native features?
They don't. Xamarin projects 100% of the native API to the Xamarin developer. They are also working with the platform vendors and release updates on the same day when the native vendor releases updates of the platform. With that said using 3rd party components built for specific platform is possible to be used by Xamarin, however it's not a simple process to enable this. Hopefully it will become simpler in the future.
Can the applications be customized for specific platforms?
Yes. Out of the box, when you use Xamarin you can either create a platform specific application. In that case you will need to create the views for each platform and then you are able to have any customization required. When you use Xamarin.Forms you push the abstraction higher and then you describe the view once using XAML. Xamarin.Forms automatically use the platform controls and look and feel, it means that when you require a Tabbed Page, it will look very different from iOS to Android, as an example. If you require further customization, you will probably need to use Xamarin.Forms feature known as Custom Renderer, this will enable you to write platform specific code and make use of the underlying platform API to create any customization you require.
Are there any tools that help develop Xamarin apps even faster?
Plenty, There are the tools provided by Xamarin itself: Inspector, Profiler, tools for gaming (CocosSharp, UrhoSharp, SkiaSharp), Test Cloud and Xamarin University. Inspector for example allows you to investigate the UI in runtime, check out the layout and apply manipulation on it. Other tools worth mentioning are:
Don't forget to register for your nearest ConFoo conference and follow us on Twitter for more blog posts.