Build Cross-Platform Mobile App-XAMARIN


Launched in 2011, Xamarin is a platform used to develop cross-platform mobile apps. It works with the Mono framework to connect with the Application Program Interface (API) of common mobile device functions including camera, contacts and geo-location for Android, iOS and Windows operating systems. It helps the developers to build robust applications using the C# encoding language that runs on the .NET Common Language Infrastructure (CLI). Considered as a “write once, run everywhere” podium, Xamarin as mobile application framework has its negatives and positives.

How Does Xamarin Work?

Xamarin has two commercial products: Xamarin.Android and Xamarin.iOS. They both are built on top of Mono, an open-source variant of the .NET Framework based on the accessible .NET ECMA principles. Mono has been around almost as long as the .NET framework itself, and runs on nearly all possible platforms including Linux, FreeBSD, Unix, and Mac OS X.

On Android, Xamarin’s compiler assembles down to Intermediate Language (IL), which is then Just-in-Time (JIT) gathered to native assembly when the application takes-off. On iOS, Xamarin’s Ahead-of-Time (AOT) Compiler assembles Xamarin.iOS applications straight to native ARM assembly code.

In both frameworks, Xamarin applications utilize a runtime that inevitably handles things such as garbage collection, underlying platform interop, memory allocation, etc.

Mono.Android.dll and MonoTouch.dll

Xamarin applications are constructed against a subsection of the .NET BCL known as the Xamarin Mobile Profile. This profile has been created explicitly for mobile applications and packed in the Mono.Android.dll and MonoTouch.dll (for Android and iOS respectively). This is much like the way Silverlight (and Moonlight) applications are built averse the Silverlight/Moonlight .NET Profile. In actual fact, the Xamarin Mobile profile is same as the Silverlight 4.0 profile with a group of BCL classes added back.

In addition to the BCL, these .dlls include wrappings for almost the entire Android SDK and iOS SDK that permits you to raise the essential SDK APIs straight from C#.

Application Output

When Xamarin applications are assembled, the result is an Application Package, either .apk file in Android or an .app file in iOS. These files are identical from application packages built with the platform's defaulting IDEs and are deployable in the exact same way.

  • A single language is used to code for all platforms.
  • Performance: Xamarin performs speed. It is much faster to the existing cross-platforms.
  • It allows customization for users to create native look and feel for each platform.
  • It also provides full support to the hardware features like GPS, Camera, Accelerometer.
  • Coding for any platform can be done on one IDE: Xamarin IDE or Visual Studio.
  • It is a costly affair, a few hundred dollars per platform/ per developer.
  • There is a learning bent involved in using Xamarin. The developer needs to know C# and .net and also the platform framework / UI / Lifecycles that they are developing for. Also they need to learn the Xamarin Framework/ IDE.
  • It does not create Windows xp+ (desktop application). Though the desktop app can still be coded in .Net / C# normally.
  • Xamarin cannot use open source libraries that are prevalent on Android/ iOS. Though .Net has its stake of open source support
  • Since it is a paid product, it is hard to find support issues in a smaller ecosystem. Xamarin support can be relied on if developer issues/ bugs could come up with their tools.
The Predecessors:

PhoneGap is a framework which allows cross platform mobile development by using web technologies, HTML5, JavaScript, and CSS, as a substitute of native languages such as Objective-C and Java. The resultant applications are hybrid.

These cross-platform apps run inside a “container” (WebView on Android and UIWebView on iOS) and influence the device’s browser to reduce the HTML and process the JavaScript in the vicinity. Webkit is the browser engine that is used on Android, iOS and BlackBerry.

There were two constituents to PhoneGap:

  • A JavaScript API which is the interface between the HTML5/CSS code and the native functionality, such as camera, contacts and gps.
  • Native code which is entreated by the JavaScript APIs.
Compared Performances:

Native Performance: PhoneGap is a slow and value performing framework that works well on older Android devices and iPhone4. While Xamarin performs steadily on Android, iOS and Win phone devices.

Native UI: The PhoneGap platform has a general UI and does not have innate look for dissimilar platforms. Xamarin on the other hand offers the ability to create individual UI for different platforms.

Data Amount: In PhoneGap, it is challenging to display big amounts of data in the lists while in Xamarin, any amount of data can be displayed.

Launch Time: PhoneGap usually takes longer time to launch an app on a device whereas Xamarin provides option of high speed induction.

About Author

Ganesh Verma is an avid IT enthusiast with around 19 years of experience. Currently associated with Seasia Infotech, a CMMI level 5 organization he has demonstrated his techno managerial capabilities in orchestrating strategic goals and objectives of the organization and guidance to the project teams to deliver the same. He has been instrumental in building credibility, establishing rapport, and communication with stakeholders at multiple levels to maintain profitable business relationships with existing customers.

Related Topics
What Are the 10 Stages in the New Product Development Process?

Posted: May 26 2022

What Are the 10 Stages in the New Product Development Process?

New product development (NPD) is the process through which organizations bring a new or updated produ...

Jeevanjot Kaur

Jeevanjot Kaur

Web Scraping: Roadmap to The Process and Its Types

Posted: May 17 2022

Web Scraping: Roadmap to The Process and Its Types

Let’s say you want to write an article on the life of Steve Jobs. What do you do? You open Wikipedi...

Jeevanjot Kaur

Jeevanjot Kaur

Everything about OTT Streaming Services Like Netflix

Posted: Apr 05 2022

Everything about OTT Streaming Services Like Netflix

The past years have shown much in many contexts, and the world fell into hard times. The coronavirus ...

Smriti Sharma