Register Login

Xamarin Interview Questions and Answers

Updated May 10, 2019

What is Xamarin?

Xamarin is a company that builds software. The main operation of Xamarin is to build mobile apps that work across platforms. The applications that Xamarin produce share their codebases and even has similar native features. A developer can download Xamarin tools for Visual Studio.

What are some advantages of Xamarin Development?

The benefits of Xamarin development are:

  • The user interface is simple and native.
  • Developers can use Xamarin to make apps across all platforms.
  • You can create apps for iOS, Windows, and Android, using the same codebase
  • Very few bugs
  • It has powerful community support.

What are some disadvantages of Xamarin Development?

Here is a look at some disadvantages of using Xamarin app development

  • Development of user interface in Xamarin is time-consuming.
  • Apps created through Xamarin tend to have a larger file size. Most of these apps tend to be between 3 MB and 15 MB in size in the store.
  • Even though the apps share codes across platforms, developers still need to create code linkage in the OS, which can be difficult.

What are the development approaches in Xamarin?

Xamarin has two approaches when it comes to app development. These are

  • Xamarin Forms- Forms are the approach of choice for developers who want to create one application across separate mobile platforms, namely, Windows, iOS, and Android.
  • Xamarin Native- Xamarin Native approach is suitable for developers who want to create separate versions of the same app for different platforms. Developers can use Xamarin.iOS, Xamarin.Android and Xamarin.Windows libraries to create applications for each particular platform.

What is the difference between Xamarin and Xamarin.Forms?

Xamarin is an app development tool to create mobile applications across platforms. Developers can use Xamarin.iOS, Xamarin.Android and Xamarian.Windows to create an app, based on the platform the app is being created for.

Xamarin.Forms, on the other hand, is a UI toolkit for app development. Developers can use it to create one native version of an app that runs across all mobile platforms.

What is Xamarin profiler?

The Xamarin profiler is a tool for developers to profile or keep an eye on the information about certain apps inside Visual Studio. With this tool, developers can analyze an app’s behaviour. Developers can use the Xamarin profiler to profile an application’s memory information and sample its statistics.

What are Xamarin insights?

Xamarin insight was a tool that allowed developers to identify and track any issues with their apps in real-time. They could also use this monitoring system to report these problems as well. Xamarin introduced Xamarin insights in October 2014. However, it was shut down on March 31, 2016. Now, developers can rely on the Visual Studio App Center for the same functionalities that Xamarin insights provided.        

What are Xamarin forms?

Xamarin Forms refers to a framework for building the user interface in mobile applications. Generally, developers have to write the UI separately for each mobile platform, even if the code base remains the same. This is time-consuming and difficult. Xamarin forms allow developers to create just one UI, which adapts itself across all of the mobile platforms, like Android, iOS, and Windows.

What is the extension of the class file in Xamarin?

The file extensions of Xamarin depend upon the class such as the Service class has the Android.App.Service as the name where Service is the extension. The View class has an extension of View and the class name is Android.Views.View.

How to add a service reference in Xamarin?

Service references can be added in Xamarin forms within portable projects. Inside the project, the AddServiceReference option can be used for adding a service reference. 

How to call API in Xamarin?

Xamarin allows developers to use .NET framework across iOS and Android. Developers can take advantage of this feature to invoke calls to web services. Here is the code that helps make API calls in Xamarin.

CODE

What is intent in Xamarin?

The intent is a functionality used for sending data from one activity to another. A developer can use intent to perform a runtime binding between all the codes of an application during its later stages. The intent is also vital for launching various activities because it connects and holds all of the activities together. If the developer creates passive data structures, intent can help hold the abstract description of the operation using these data structures.

How to use intent in Xamarin Android?

In order to start a new activity or intent, you need to use StartActivity. Using the code mentioned below will help you launch a new Xamarin.Android intent.

CODE

What is the difference between Xamarin and Android Studio?

The most important difference between Android Studio and Xamarin is in their build systems. Android Studio uses a tool called Gradle for building applications, while Xamarin relies on MSBuild for the same task. Other minor differences exist between the two IDEs, is the complexity. Android Studio has a complicated user interface whereas Xamarin is relatively simple to use.

What are the different Xamarin license terms?

Xamarin is free to use for all. However, developers need to adhere to the licensing terms of Microsoft Visual Studio. These terms are

  • An unlimited number of users can take advantage of Visual Studio only when it is being used in a classroom environment or for research purposes. The same term applies if the people using the IDE are working on an open source project.
  • An unlimited number of develops can use the software during the development and testing of device drivers for Windows operating system.
  • In the case of non-enterprise usage, 5 developers can use Visual Studio at any time. For enterprises, no employee can use it apart from academic, research or open source projects.

What are the programming languages that support Xamarin development?

Xamarin supports three programming languages in the development of mobile applications.

  • C#
  • F#
  • Visual Basic.NET

What is the role of XAML in Xamarin?

Xaml or extensible application markup language is a special tool that allows developers to define the user interface in Xamarin app development. It is vital in Xamarin but is not necessary for app development in Xamarin.Forms. Xaml works best with ModelView-ViewModel or MVVM architecture for an application.

What is prism in Xamarin?

Prism is a framework for the creation of XAML applications in Xamarin. These applications are loosely coupled, testable and easily maintainable. Prism contains a number of design pattern collections, which developers can use to write better code for mobile applications.

Explain Xamarin ContentPage?

ContentPage is the base that developers use for their pages in Xamarin. ContentPage displays one view and it encompasses most of the screen.

How to maintain different screen resolutions in Xamarin.Forms?

Some Layout containers can be used for adjusting the applications to different screen sizes. Absolute sizes must not be set for controls such as Grids and StackLayouts but relationships can be used so that the components adjust accordingly. For example, while creating rows and columns, the RowDefinition height can be set to Auto instead of some numeric value. 


×