Adopting Xamarin – Our Story

By July 19th 2016 9:27 am
Xamarin office shot

Xamarin! It’s an amazing technology that is getting off the charts because of the endless possibilities it provides regarding mobile development. It’s sole purpose is to bring three opposing markets in one place: iOS, Android and Windows Phone. And we must say, it does a great job at it!

Xamarin is able to produce code that is reusable between three completely different platforms, together with the option of publishing your Xamarin developed app on Play Store, App Store or Windows Store. Bringing C#/.NET at the doors of mobile development, it also includes integration with Visual Studio, which makes the transition to mobile development smooth and easy. It produces fully compliant .NET Portable Class Libraries, which are reusable between 3 completely different platforms. That saves up on development time, increases the  productivity and opens 3 different markets, while allowing the “ordinary” user to have access to the application on a operating system based on his own personal preferences.

Well, if you are reading until now, you can definitely feel our excitement regarding Xamarin.

It was some time ago, when we decided to get on the “Xamarin train wagon” and we did our math budget wise, the time needed for R&D, the topics on that we would touch on first. On paper it looked pretty amazing, since we had developers that were experienced in  C#/.Net, we had the time and most important we had a team that was extra motivated to “dive into” all that Xamarin as a technology brings, meanwhile taking into consideration not only the benefits, but also the challenges that would arise from starting our brand new mobile department.

Even though we have hit some obstacles on our way, we managed to get to a point of time when our mobile development goes as smooth as it can be.

We have defined the guidelines for architecture, optimization, the tools that we are using. We are able to make estimation of the time needed to develop, as much as we are able to estimate the R&D time. Yes, we still need R&D time, Xamarin has a bit of a learning curve, and not only that, but we do try use the Xamarin benefits to the maximum in order to provide the best features we can for our clients. Not only that, but we try to “dig in” into the Xamarin universe as deep as we can, so we can come on top with even better solutions for them and cool new add-ons that are compliant with their vision.

Until now, we have touched on Xamarin.Android, Xamarin.IOS and of course the infamous Xamarin.Forms. Xamarin.Forms is perfect for “basic” features and it allows the developers to produce code for the 3 platforms at a rate of 90% re-usability. And don’t let the “basic” part of our sentence fool you, Xamarin. Forms is damn well powerful devil. Still, when you really need to go into the native features of Android or iOS you have to go on a little bit of a different route using “pure” Xamarin.Android and Xamarin.iOS. And still even in this case, the percent of the code that we are able to reuse between the platforms goes very far depending on the requirements.

 

The Xamarin learning curve

We would recommend Xamarin for teams that are familiar with the .NET technologies. It is very easy to transition from .NET/C# development to Xamarin development. The syntax is completely same, so if you have developed in C#, the only thing that differs from the “usual” development for you is going to be the phone components that you need to add. But even for this, you can find thousands of “recipes” online and furthermore, you can check out the solutions made for the native platforms(Android, iOS) and just “translate” them to fit into the Xamarin world.

The thing that nobody wants to talk about

One of the main issues when working with Xamarin is the front-end development. The back end part was quite easy for us and as we mentioned previously,  the “switch” between C# development and Xamarin, back-end wise is quite easy and simple. But when you come to front-end, if you had front-end devs that have never worked in mobile development it gets quite tricky. Here, the learning curve is different since, unless you are using a web view(or the pandan to this in iOS a UIWebView) where you would render html code with css/javascript, you would have to start from ground zero. You have to keep in mind that your screens have to look perfect on all devices with different sizes, and the rendering has to be perfect on different phone brands and OS versions. Also, not only that but the design process is very specific also. It’s a different world for design in the web world and the mobile world!

How does Xamarin fits into my architecture? Think ahead!

Think of the mobile(Xamarin) part of your application as just the top layer from your application. When you start developing look at the bigger picture. If you are doing a web site for your client, go Web API all the way! Why? Xamarin applications should be “dum”. They should not have crazy logic nested inside them, so you need to use our favorite programming approach ever, that has the most romantic acronym ever, KISS(keep it simple, stupid!). You don’t want to kill the phone battery, and loose on performance when writing an app in Xamarin. So the “dumber” you make the app, the better! So, where does the web API fits into this story? If you are starting a web site for your client, and you plug a web api, that is the same api you can consume in the following Xamarin app. The BLL is the same, the DAL will be the same in most cases, so you will be able to reuse the same architecture you have previously created, and just “plug in” your Xamarin app on top of it!

Testing my app, how and what are we working on at the moment

Go out buy all the phones on market and get the biggest QA department ever! We scared you with the previous sentence didn’t we? Take a deep breath, there are better solutions for this don’t worry. First and foremost, you will have problems with different versions of OS(especially in the Android domain) and different brands of phones. That’s okay and it is expected. One way to cover this is to use the Xamarin Test Cloud. This will allow you to test on remote real devices and you can test on different versions, sizes and  brands of phones. And this is what we are working on at the moment. Manually deploying your app on the test cloud is not good enough for us. For every department we have implemented automated deployment and this will be the case for the mobile apps also! We are currently working to have an automatic deploy on the test cloud on every “push” of the new version of our app. As you have seen until now, we are all about time saving!

So to sum things up in the end.. We do strongly recommend Xamarin for mobile development. It is the way to go from simple apps, to more complex apps, since you have the option to go “native” with Xamarin.Android and Xamarin.iOS. We urge you to give it a chance if you have a team that has been working in .NET and you want to go mobile, use Xamarin if you want to dive into multi platform mobile development and use Xamarin if you want to save up on time. And if you are seeing this from the other side(the “client side”, as in you want to hire somebody to develop a mobile app or a web site for you), we recommend think ahead! If you want to have a web site, ask the team to use a web api! We can easily plug a Xamarin app on top of it. If you want only a mobile app, keep in mind that the architecture from developing the Xamarin app can be used to develop a web site, an admin site so that you can manage the users better and expand your app into something bigger.

Although Xamarin itself has a lot of room for improvement, we  do believe in the benefits of using them and the capability of our team.

Thank you for reading and hopefully we managed to clear some of the doubts you had about mobile development with Xamarin. Have a nice day!

Xamarin-logo.svg