Mobile app development with Xamarin

Mobile app development with Xamarin

Xamarin is a company founded in 2011by the same engineers that created Mono project, a free and open source to run Microsoft .NET applications cross-platform on Android,  iOS y GNU/Linux. Xamarin is a complete tool that allows you to develop cross-platform mobile apps. What makes Xamarin special is its capacity to translate your apps in C# into an executable code on iOS, Android and Windows Phone.

For beginners in this world, C# is a programming language developed by Microsoft, which is very popular with mobile apps .NET developers.

The development of iOS apps uses objective-C and for developing on Android we use Java. What makes Xamarin is to combine these programming languages through IDE Xamarin Studio, this is why we need to control C# to develop apps on iOS, Android and Windows Phone and have some notions of each platform.

funcionamiento xamarin

One of its main advantages is the reusing code. This means, when you develop an app you write a new and tested code; if this code is the same for all platforms in which you want your app, you don’t need re-write a new code but instead you can reuse it due to it is tested and not show errors, what guarantees a proper operation.  Otherwise, if we find any error code and we fix it in shared code, this bug fix will be integrated across the different platforms.  This solution will reduce significantly both development costs and time and also allows you to navigate across all three platforms easiest due to they share the same development environment.

Arquitectura Xamarin app

It’s very important to eliminate from reused code any native element related to user interface because it will only depend on the target platform. Also you should eliminate any filesystem integration, any platform-specific frameworks and license verifications. This is the reason why we will try to extract and decouple as much functionality as possible independently. Thanks to methods such as Inversion of Control (IoC) you can increase your shared code. Xamarin recommends to create applications that are written to share up to 90% of their code.

Código compartido

Another advantage is that Xamarin has thirds parties’ libraries comparable to that of native code. You can use a wide array of 3rd party code that has already been created. In addition to this, you can access to bindings for nearly the entire underlying platform SDKs in iOS, Android and Windows Phone through C#.

In short, Xamarin Studio (XS) offers you all the possible tools to built an app that works across all three mobile platforms of iOS, Android, and Windows Phone. As important information, Xamarin Studio is not free but you could get access to the full Xamarin Business feature set for 30 days.

On the other hand, within Xamarin Studio we can find Xamarin.Forms a useful tool that allows you to create user interfaces that can be shared across all three platforms. These user interfaces are rendered using the native controls of the target platform, allowing applications to preserve the suitable look and feel for each platform.

Xamarin.Forms are written in C# and their apps are able to use any of the APIs and some features like CoreMotion, PassKit, and StoreKit on iOS; NFC and Google Play Services on Android; and Tiles on Windows Phone. In other words, with this tool it is possible to create mobile apps that have parts of their UI created with Xamarin.Forms and other parts created with the native UI toolkit.

Xamarin.Forms apps architecture is the same as that of traditional cross-platform apps. The most used method is to implement Portable Libraries or Shared Projects to save the shared code, and then create specific applications for each platform that will consume this shared code. The following image is an example of how the traditional Xamarin approach is and how the approach would be with Xamarin.Forms.

Xamarin forms + Xamarin

You can choose between two methods to create user interfaces in Xamarin.Forms. The first way consists in creating it with source code using the API provided by Xamarin.Forms and the other one is to use Extensible Application Markup Language (XAML), a declarative markup language from Microsoft that describes user interfaces. The UI is identified in an XML file making use of the XAML syntax and the run time behaviour is defined in a separate code-behind file.

If you want to learn more about Xamarin and Xamarin.Forms , you can find more information in their websites.

Don’t hesitate to contact us if you have a cross-platform app idea, . We will help you in everything you need.

Follow us on Facebook, Google+, Linkedin and Twitter.
Facebook Google+ Linkedin Twitter