[ 35+ ] Xamarin Interview Questions & Answers [BEST & NEW]-2020
Xamarin Interview Questions and Answers

[ 35+ ] Xamarin Interview Questions & Answers [BEST & NEW]

Last updated on 04th Jul 2020, Blog, Interview Questions

About author

Prithivraj (Sr Technical Engineer )

He is a Proficient Technical Expert for Respective Industry Domain & Serving 6+ Years. Also, Dedicated to Imparts the Informative Knowledge's to Freshers. He Share's this Blogs for us.

(5.0) | 16547 Ratings 9143

C# is one of the top 5 languages that people use around the world and the app-building over the Xamarin platform is on rise. Xamarin is a prominent choice among developers and the reason behind it is — “ Seamless Functionality”. Launched in 2011, Xamarin offers code re-usability and sharing codes with other platforms while giving access to native API’s.

1) What is Xamarin?


Xamarin is a company that builds the software. The main operation of Xamarin is to build mobile apps that work on cross-platforms. It is used to build the UI for Android, iOS, and Windows operating system. Xamarin application shares the codebase. Xamarin’s feature is similar to the native application. A developer can download the Xamarin tools in Visual Studio.

2) What is the advantage of Xamarin Development?


Benefits of Xamarin Development are:

  • The user interface is simple and native.
  • Developers can use Xamarin to make cross-platform apps.
  • The chances of the bugs are less.
  • We can create an app for iOS, Android, and Windows using the same codebase.
  • Xamarin has powerful community support.

3) What are the disadvantages of Xamarin Development?


Disadvantages of Xamarin app Development are:

  • The development of user interfaces in Xamarin is Time-Consuming.
  • The apps created in Xamarin have a large file size. These apps are mostly between the 3 MB to 15 MB in size in the store.
  • Even apps share the code across the platform, but there is also a need for the developer to create the linkage in the OS, which is difficult for the user.

4) What are the development approaches in Xamarin?


Xamarin has two approaches for app development. These are

  • Xamarin.Forms: Forms are the choices for the developers who want to create one application for all the separate mobile platforms, which are Windows, iOS, and Android.
  • Xamarin Native: This approach is used in those scenarios when we want to create a separate version of the same App for different platforms. Developers can use Xamarin.iOS, Xamarin.Android and Xamarin.Windows libraries to create the applications for each particular platform.

5) What are the differences between the Xamarin and Xamarin.Forms?


The differences between the Xamarin and Xamarin.Forms are:

Xamarin is an app development tool to create cross-platform mobile applications.Xamarin.Forms is a UI toolkit to develop the application.
Developers can use Xamarin.iOS, Xamarin.Android and Xamarin.Windows to create the application which is based on the particular platform for which the apps are created.Developers can use Xamarin. Forms to create the one native version of the App which can run the entire mobile platform.

6) What is Xamarin Profiler?


Xamarin Profiler is a tool which is used by the developers to keep an eye on the information about the particular App inside the Visual Studio. With the help of Xamarin Profiler, developers can easily analyze the App’s behavior. We can use the profiler to track the application’s memory information and can sample its statistics.

7) What is Xamarin Insights?


Xamarin insight is a tool that allowed the developers to identify and track the issue with the apps in real-time. We can also use this for the monitoring system to report the problems. Xamarin introduced Xamarin Insight in October 2014. However, it was closed on March 31, 2016. In today’s time, developers can believe in Visual Studio App Center for the same functionality that is provided by the Xamarin Insights.

8) What is Xamarin.Forms?


Xamarin.Forms is a framework which is used to build the user interface in the mobile application. In the same codebase, developers have to write the UI separately for each platform. This is time consuming and difficult process. Xamarin.Forms allows the developer to create just one UI which can be used across all platforms like Android, iOS, and Windows.

9) Which programming language supports the Xamarin?


Xamarin supports three languages in the development of mobile applications:

Xamarin Interview Questions
  • C#
  • F#
  • Visual Basic.NET

10) What is the role of XAML in Xamarin?


XAML or Extensible Markup Language is a special tool that allows the developer to define the user interface in Xamarin app development. XAML has a vital role in Xamarin, but it is not necessary for app development in Xamarin.Forms. Xaml works with ModelView-ViewModel or MVVM architecture of an application.

11) What is Xamarin Studio?


Xamarin Studio is a standalone IDE for developing the cross-platform mobile application, which is based on the open-source project Monodevelop.

12) What are the differences between the Xamarin Studio and Visual Studio?


Both Xamarin Studio and Visual Studio are IDEs used to develop the Android, iOS, Class Library, Console, PCL, and Windows Phone application. Both Xamarin Studio and Visual Studio support F#.

Xamarin StudioVisual Studio
Xamarin Studio works on both Windows OS X environments.Visual Studio is available only for the windows environment.
On Windows, Xamarin Studio doesn’t support windows phone and iOS project.In Visual Studio, we can create any app.
Xamarin Studio on Windows supports only Xamarin.Android project.Visual Studio supports Xamarin.Android, Xamarin.iOS, and Xamarin.Windows project.

13) What is the lifecycle of Xamarin.Forms apps?


Xamarin.Forms is a platform to develop the cross-platform mobile applications by using the XAML for Front-End and C# for the backend of the application. In Xamarin.Forms application, we can share all code. Xamarin.Forms also give the 100% API coverage of Android and iOS native APIs. So that, we can develop native Android, iOS, and Windows apps.

When we create Xamarin.Forms application we will see four projects:

  • Portable Project: This is the project where we will write 95% of our application code, and this code is shared in all the three platforms.
  • Android: This is the project where we set the Android application icon and splash screen, and all the other code will come from the portable project.
  • iOS: In this project, we set the iOS application architecture and icon.
  • Universal Windows: Universal Windows Platform is the application platform

14) What are the types of data binding modes in Xamarin?


The different types of data binding modes are:

  • Default
  • One way: changes in the source affect the target
  • Two way: Changes in the source and destination affect each other

15) What is the difference between the Xamarin and Mono?


Xamarin is a powerful solution for building awesome apps.Mono is used in those cases when we want to build an app for a single platform. In that case, there is a need for a Native platform.
With the help of Xamarin, we can create Native apps for multiple platforms via the same IDE, APIs, and Language.Native mobile apps are built on Android, iOS.Java, and Windows.
Using Xamarin, we can skip the extra development time for each platform.Using Mono, we cannot skip the extra development time for each platform.
Xamarin apps are accessible for more comprehensive ranges at a lower cost.Mono apps are accessible for the broader ranges at a higher cost.

16) What are the different scenarios used in Xamarin.Forms?


The following are the different types of scenarios that are used in Xamarin.Forms:

  • View to View binding
  • Backward binding
  • Binding with the models
  • Binding with the collections

17) What is data binding in Xamarin?


Data Binding is a technique that is used to synchronize the source of the data with the user interface. When the data binding is done and the data or our business model changes, then it shows the changes automatically to the UI elements and vice versa.

18) What is the Xamarin test cloud?


The Xamarin test cloud allows us to test the mobile application on various devices. The Test cloud is also used for automated testing in many real devices simultaneously.

19) How to set up the Xamarin?


For Xamarin set up, there are four steps:

  • Download the Xamarin Installer
  • Run the installer
  • Configure it
  • Activation of Xamarin

20) What are the types of layout control in the Xamarin.Forms?


Different types of layout control in Xamarin.Forms are:

  • Stack Layout
  • ContentView
  • Frame
  • ScrollView
  • TemplateView
  • Absolute Layout
  • Grid
  • Relative Layout

    Subscribe For Free Demo

    21) What are the different kinds of Pages present in the Xamarin.Forms?


     The different types of pages present in the Xamarin.Forms are:

    • Content page- This type of page displays a single view, often a container such as a stack layout or the scroll view.
    • MasterDetail page- MasterDetailPage is a page that manages the information between the two related pages.
    • Navigation Page- Navigation page manages the navigation of the pages.
    • Tabbed Page- Tabbed Page helps the navigation of the children page using the tab.
    • Template Page- The Template page helps to display the content of the full page with a control template.
    • Carousal Page- This page allows the swipe gesture between the subpages, such as a gallery.

    22) What are the advantages of Xamarin?


    Benefits of Xamarin are:

    • We can deliver the native iOS, Android, and Windows app using the existing skills, and code (C#, XAML).
    • We can take full advantage of Native APIs with Xamarin Technology.
    • Xamarin Component Store allows us to add the high-quality components to our App directly from IDE, including controls, web service APIs, and more.
    • PCL/shared project makes the development easy for developers to share the same code base across different projects.

    23) What are the code-sharing techniques in Xamarin.Forms?


    There are two methods of sharing the code between the cross-platform applications:

    • Portable Libraries (PCL)
    • Shared Projects

    The goal of the code-sharing strategy is to support the architecture where multiple platforms can utilize a single code base.

    24) What is the difference between the portable class library and shared projects?


    Portable Class Library

    • We create Class Library in .Net to reuse our code or to make our code reusable with the same type of application only, but that might not work for some conditions. Here we assume, we have created the class library for WPF or any other kind of application. And if we want to access the same type of class library for Windows 8 or Windows phone application, then in this scenario, we can’t refer this as a class library.
    • We want the same application for all the platforms to make our life easy. We want the same application used on multiple platforms. Microsoft technology is growing day by day, and it covers every device. All types of applications we can build and validate within one framework on all types of platform Windows, Web, Mobile, or Tab.
    • PCL solves this problem. .Net 4.5 introduced the Portable Class Library (PCL) for developing the business logic in one location, and we can use this library end to end in all types of applications or all platforms (Windows, web, or Mobile) on .Net Framework.
    • The figure shows the flow of the Portable Class Library (PCL). All these applications run on the .Net Framework. All these applications have different environments and platforms, but they all can easily use the Portable Class Library. In other words, we can say that we only need to prepare the UI and do the DataBinding of our application for all the windows, web and mobile, because the same business logic can then use the entire platform.

    Shared Project

    A shared project is a project that contains standard code and linked to each specific platform library or App. It is compiled as a part of the platform-specific code. To develop a nice solution that is based on a shared project, there is a need to architect it to have the core features in the shared project. Here possibly, we may use partial classes, abstract classes, and interfaces to manage the objects which are specific for each platform in the platform-specific project. These kinds of projects are good when we are in a prototype phase because it is fast to implement the shareable project for the common code. We can use all the advantages of the platform-specific Framework.

    Shared Code can be branched base on the platform using compiler directive (e.g. #if_Android_,#if_iOS_,#if_Windows_Phone_App.etc.)

    • No output assembly
    • Refactoring operations, not update automatically.

    25) What are the advantages of XAML?


    The advantages of XAML are:

    • XAML gives a clean division of the application and its code. Thus, it enables a clear developer-design flow.
    • XAML is more crisp and precise than a similar code.
    • XAML has the parent-child hierarchy of user-interface objects with greater visual interface simplicity

    26) What are the Views?


    Views are known as control of widgets. They can be visual objects such as Label, Button, Entry, BoxView, ListView, TableView, etc. All the UI elements are the sub-classes of view.

    27) What is the difference between ListView And TableView?


    ListView and TableView controls are similar. We can take them as a single control. The major difference between them is how they layout the items.

    • ListView: ListView control displays the stacks of data vertically. It is just like a standard Listbox. We use this control to display the order of data in the list, especially the long list, that requires scrolling, like a list of email messages, a list of contacts, or search results.
    • TableView: TableView displays the stacks of data horizontally in rows. We use this control when we need more space for rich visualization of the item to be displayed.

    28) What are the types of the App which use Xamarin?


    The different types of apps which use the Xamarin are:

    • OLO- an online platform to order food.
    • The World Bank survey app- This App is used for the global survey.
    • Storyo- This App helps to create videos from the picture.
    • Freshdirect- This App is our friendly grocer.
    • Just Giving- a philanthropic interface.

    29) What are the different types of scenario used in Xamarin.Forms?


    The scenario used by the Xamarin.Forms are:

    • View to view binding
    • Backward bindings
    • Binding with the collections
    • Binding with the models

    30) What are the apps designed by Xamarin for Android?


    The apps designed by Xamarin for Android are:

    • The secret society
    • Parental Access
    • Toolwiz cleaner
    • iLearnForKids
    • Goal 2014 Football manager
    Course Curriculum

    Get Practical Oriented Xamarin Training to UPGRADE Your Skills

    • Instructor-led Sessions
    • Real-life Case Studies
    • Assignments
    Explore Curriculum

    31) Name the apps that were designed by Xamarin for iOS?


     The apps that were designed by Xamarin for iOS are:

    • QuickPLan- Project Plan HD
    • NewsPager
    • Apocalyspe Archer: Zombie invasion
    • Stone Skimmer: Skimming action game

    32) How Xamarin.Android applications work?


    Xamarin.Android applications depend on Microsoft’s Mono Virtual Machine. Mono is Microsoft’s open-source implementation of the .Net Framework, which is based on open source standards of C# and CLR. Mono was launched in the year 2001. It was created to allow the .Net applications to work on the Linux platform, but was later modified to support the development on various devices, including embedded systems.In Xamarin, Mono works in parallel with Android’s ART. On Android, most of the system facilities like Audio, Graphics, OpenGL, and Telephony are not available directly to the native applications. They can be added through the Android Runtime Java APIs, which is available in one of the Java.*namespaces or the Android.*namespaces. The native applications then interact with the exposed .NET APIs. These APIs then, through the Android Binding, call the Android runtime Java APIs.

    33) What is Fresh MVVM?

    Fresh MVVM is a super light MVVM framework which is designed specifically for Xamarin.Forms only. Its design is easy, simple, and flexible. It is easy to learn and uses the convention over configuration.

    Fresh MVVM is a little different from MVVM. FreshMvvm uses the concept of Page and PageModel instead of View and ViewModel.

    34) What is the difference between the MVVM Cross and MVVM Light?


    MVVM Cross: MVVM Cross is a .NET cross-platform MVVM framework. It allows us to make a cross-platform solution for platforms such as Xamarin. Forms, Xamarin.Android, Xamarin.iOS, Xamarin.Mac and WPF. It is an inactive state of development.

    MVVM Cross requires the application to be divided into two parts: Core and the UI.

    The Core part contains the View Models, Service, Models, and the Business logic, whereas the UI part consists of the different views and platform-specific code that interact with the core. The views are the View Screens, which contain the graphical content. In addition to Core and UI, the application may contain additional libraries for various functionalities.

    Features that are provided by MVVM Cross are:

    • An MVVM architecture pattern
    • A flexible Navigation system
    • Data binding to allow automatic binding with the source to target.
    • Platform-specific support
    • Inversion of Control Container
    • Dependency Injection engine

    Consequences of MVVM Cross are:

    • It has an excessive learning curve and lacks a Wiki for how to get started developing the apps.
    • MVVM Light: MVVM Light is another Framework that allows the creation of Enterprise-Grade apps using the MVVM Architectural pattern on Xamarin. MVVM Light enables the developer to create and develop MVVM applications on a variety of platforms like Xamarin. Forms, Xamarin.Android, Xamarin.iOS, UWP, and WPF. It allows us to separate the View from Model and hence write the testable and extensible applications. It does not support async.

    MVVM Light application is divided into the following parts:

    • View: It is a platform-specific user interface which is associated with the screen.
    • ViewModel: It exposes the data and related properties of the data.
    • ViewModel Locator: It registers custom ViewModels.

    35) What is the need of the Model-View-ViewModel (MVVM ) pattern in Xamarin?


    The Model-View-ViewModel can be used on all platforms. It intends to provide a clean separation between the user interface controls and their logic.

    • During the development process, developers and designers can work independently on their components. Designers can concentrate on the view, and if they are using Expression Blend, they can generate sample data. On the other hand, developers can work on the view model and model components.
    • Developers create the unit tests for the view model and can create the model for the view.
    • It is easy to redesign the UI of the application without touching the code because the view is implemented entirely in XAML. A new version of the view should work with the existing view model.
    • If there is any existing representation of the model that binds the existing business logic, this can be difficult or risky to change. In this scenario, the view model acts as an adapter for the model classes and enable us to avoid making any major changes to the code of the model.

    36) What is NuGet and how this can be useful in App development?


    NuGet is the most popular package manager for the development in .Net. It is present in Xamarin Studio 5 and Visual Studio. We can easily search and add package/third party libraries to the Xamarin.Forms using IDE.

    37) What is the HTTP client?


    HTTPClient helps the developers to connect with the external world through the internet using the REST-based services. HTTPClient class is used for sending the HTTP requests and receiving HTTP response from a resource, which is identified by URI. HTTPClient class present in System.Net.HTTP namespace.

    38) What is ResourceDictionary?


    ResourceDictionary is used to define the XAML Resources, which can be reused more than once throughout the Xamarin.Forms application.

    • Xaml Resources are the definition of objects which can be used more than once.
    • ResourceDictionary allows all the resource objects declared at one place.
    • We can define Styles, ControlTemplates, DataTemplates, Colors, and Converters into the ResourceDictionary.

    In XAML, resources can be accessed at the Element level (inside specific element), Page (inside page) level or Application Level (inside App.Xaml).

    39) What is the difference between Xamarin. Forms and Xamarin Native?


    Xamarin.Forms :

    Xamarin.Forms are used when:

    • the requirement of the code is less in the platform-specific scenario.
    • Code-sharing is more important than custom UI.
    • The UI is not complex.

    Xamarin Native:

    Xamarin Native is used when:

    • a lot of platform-specific code is required.
    • Custom UI is more important than code sharing.
    • When platform-specific APIs are used.

    40) What is the App.cs class?


    App.cs is the main class of the App which offers features like:

    MainPage: It helps us to set the initial page of the App.

    Properties Dictionary: It helps us to store the values across the state of the lifecycle.Static Current Property: It gives the instance of the current application object

    41) What is the lifecycle method of the Xamarin.Forms App?


    Lifecycle methods are the set of techniques which are executed when the application enters into a specific state. The ways are:

    • OnStart: This method will run when the application starts from the beginning.
    • OnSleep: This method will execute when the application goes into the background.
    • OnResume: This method will execute when the application comes in the foreground from the sleeping state.

    42) What is the purpose of XAML compiler (XALC)?


    Using the XAML compiler, we can directly compile XAMLs into intermediate (IL) language.


    • It performs the compile-time checking to find the error in XAML. At compile time it notifies the user about any mistake.
    • It removes the overheads and initialization time for XAML elements.
    • It doesn’t include the XAML file into the final assembly, and thus it reduces the assembly time.

    43) What is XAML namespace declaration?


    XAML namespace is the declaration of the namespaces on top of the XAML file. There are two declarations available within the root element when we create any new XAML UI. Here is the default declaration of the xmlns without any prefix:

    • xmlns=”http://xamarin.com/schemas/2014/forms”  

    The second declaration uses the x prefix:

    • xmlns:x=”http://schemas.microsoft.com/winfx/2009/xaml”  

    All declaration of the namespace which uses the prefix is a non-default declaration.

    Suppose we want to bind the ViewModel with XAML and that ViewModel is declared inside the namespace, “XamSample.ViewModels”.

    • xmlns:vm=”clr-namespace:XamSample.ViewModels; assembly=XamSample.ViewModels”  

    Then we can access the element from inside this namespace using VM prefix.

    44) What is the way of navigation from one page to another?


    After clicking on the button of the first page, we call the following method through which we can navigate from one page to another page.

    • await Navigation.PushAsync(new MySecondPageXaml(), true);  

    We have to use the “Navigation” page property which is available under the ContentPage class. This code is written in the coding page of the MainPage.XAML file.

    45) What is ViewCell?


    A ViewCell is a small individual element which represents a single item of the ListView or Table. A ViewCell is not a visual element, but it is a description of the template which creates the visual aspect.

    46) What are the types of Built-in cells?


    The types of built-in cells are:

    • TextCell: It is a cell that consists a Title/Primary text and a Detail/Secondary text label.
    • ImageCell: It is a text cell which includes the image component in the left.
    • SwitchCell: This cell contains Label and the toggle switch.
    • EntryCell: This cell contains the Label and single line of textbox which can be used to enter the data.

    47) What is the difference between ControlTemplate and DataTemplate?


    ControlTemplate: This template decides how the control should look. It defines the representation style for control.For example, A Button can contain Image and Text.

    48) What are the triggers? How many types of triggers are available?



    Triggers allow us to declare actions in XAML, which changes the appearance of the control when specific condition met for a particular property of the control.

    We can add triggers at control-level, page-level, or application-level in the resource dictionary. Here are the four types of triggers available. These are:

    • Property Trigger: This trigger executes when the property of the control set a particular value.
    • Data Trigger: This trigger is similar to a property trigger, but it uses the data binding.
    • Event Trigger: This trigger occurs when an event occurs on the control.
    • Multi Trigger: This trigger allows us to set the conditions of multiple triggers before the action occurs.

    49) What is hockey app?


    Hockeyapp offers the testing service for iOS, Android, and Windows phone.

    50) What is TestFlight?


     Apple is the owner of the TestFlight. This is the primary way of the beta test of our Xamarin.iOS apps.

    Course Curriculum

    Learn Xamarin Training Course for Beginners to Experts By Industry Trainers

    Weekday / Weekend BatchesSee Batch Details

    51) What are the types to create the Xamarin applications?


    Here, are the three ways to build the apps in Xmarin.

    • Xamarin.Forms  
    • Xamarin.Android  
    • Xamarin.iOS.

    52)What is the difference between Native App and Cross Platform APP?


    • Native App: If we want to develop native apps, we need to choose the specific native language (C#, Objective-C, Swift, and Java) for developing specific native app for Windows, Android, iOS.
    • Cross Platform App: This is the way to develop all three mobile apps using single code base wrapped in a native application layer, but it always requires customization of interfaces to native languages.

    53) Xamarin history?


    • Xamarin is a Microsoft-owned San Francisco, California based software company founded in May 2011 by the engineers that created Mono, Mono for Android and MonoTouch .
    • Novell had granted a perpetual license for Mono on july 2011 for MONO 
    • On May 16, 2011: Miguel de Icaza announced on his blog that Mono would be developed and supported by Xamarin,
    • December 2012, Xamarin released Xamarin.Mac which allows developers to build C#-based applications for the Apple OS X operating system and package them for publishing via the Apple App Store.
    • Xamarin 2.0 was released in February 2013 Xamarin.Android and Xamarin.iOS that make it possible to do native Android, iOS and Windows development in C#, with either Visual Studio or Xamarin Studio.
    • Xamarin.forms: Introduced in Xamarin 3 on May 28, 2014 and allows one to use portable controls subsets that are mapped to native controls of Android, iOS and Windows Phone.
    • On February 24, 2016: Microsoft announced it signed a definitive agreement to acquire Xamarin
    • On March 30, 2016: Microsoft acquired the xamarin. And made it for all with free of cost.

    54) Mono vs. Monodevelop vs Xamarin


    • Mono: It is a framework and an open source implementation of Microsoft’s .NET Framework based on the open standards of European Computer Manufacturer’s Association (ECMA) for the C# language and the Common Language Runtime. And Mono allows C# developers to write cross platform code targeting Windows, Mac OS X, Linux, Android, and iOS. 
    • MonoDevelop: It is an open source integrated development environment (IDE) for Linux, OS X, and Windows. Its primary focus is development of projects that use Mono and .NET frameworks.Xamarin: a subsidiary of Microsoft – is a company founded by the engineers who created Mono. Xamarin is the primary maintainer and commercial sponsor of Mono. It provides professional developer tools that make cross platform code easier to author, test, and maintain.

    55) What are the programming languages that support Xamarin Development?


    • Xamarin is unique in this space by offering a single language – C#, class library, and runtime that works across all three mobile platforms of iOS, Android, and Windows Phone (Windows Phone’s native language is already C#)
    • Also offers xaml support for creating user interface.

    56) Why Xaml in Xamarin.Forms?


    • XAML(Extensible Application Markup Language) allows developers to define user interfaces in Xamarin.Forms applications using markup rather than code.
    • XAML defines the visual appearance of a UI, and an associated code-behind file defines the logic. The UI design can be adjusted without necessarily making changes to the logic in code-behind. XAML in this role simplifies the workflow between individuals who might have a primary visual design responsibility and individuals who are responsible for app logic and information design.
    • XAML(Extensible Application Markup Language) allows developers to define user interfaces in Xamarin.Forms applications using markup rather than code.
    • XAML defines the visual appearance of a UI, and an associated code-behind file defines the logic. The UI design can be adjusted without necessarily making changes to the logic in code-behind. XAML in this role simplifies the workflow between individuals who might have a primary visual design responsibility and individuals who are responsible for app logic and information design.
    • XAML cannot contain code. All event handlers must be defined in a code file.
    • XAML cannot contain loops for repetitive processing. (However,ListView —can generate multiple children based on the objects in its ItemsSource collection.)
    • XAML cannot contain conditional processing (However, a data-binding can reference a code-based binding converter that effectively allows some conditional processing.)
    • XAML generally cannot instantiate classes that do not define a parameterless constructor. (However there is sometimes a way around this restriction.)
    • XAML generally cannot call methods. (Again, this restriction can sometimes be overcome.)

    58) What are the IDE’s we can use for Xamarin App Development?


    Xamarin Studio: This is Xamarin’s C# developer environment that runs on both Windows and Mac. Xamarin Studio has many of the features of Microsoft’s Visual Studio and uses exactly the same formats as Visual Studio: solutions (.sln) and C# projects (.csproj).Visual Studio: Xamarin offers a Visual Studio extension/plugin for visual studio 2012, visual studio 2013 update 1. And now Xamarin development is directly available from Visual studio 2015.

    59) What was the major advantage of Xamarin Development?


    • We can deliver native iOS, Android, and Windows apps using existing skills, teams, and code(C#, xaml )
    • We can take full advantage of Native API’s with Xamarin Technology . And Xamarin.Forms elements map to native controls and behaviors
    • Xamarin Component Store allows adding high-quality components to your app directly from your IDE, including controls, web service APIs and more.
    • PCL/ Shared projects makes very easy for developers to share the same code base across different projects.

    60) What are difference between Xamarin Studio and Visual Studio?



    • We can’t create Windows Phone, Windows & UWP from Xamarin Studio.
    • Xamarin Studio in Mac can allows you to develop iOS & Android apps.
    • Xmarin Studio in Windows can allows you to develop Android apps only. And it encourage Windows users to move to Visual Studio.
    • Xamarin for Visual Studio supports any VS 2015, VS 2013 Update 2 and Visual Studio 2012 with non-Express editions. And visual studio can’t install on Mac machine.
    • To test iOS app on Windows OS with VS, must be a Mac computer accessible on same network.
    • To develop Xamarin.Forms apps for the Universal Windows Platform (UWP) requires Windows 10 with Visual Studio 2015

    61) What are the life cycle’s of Xamarin.forms app development?


    Life-Cycle means a specific sequence of the application from start to finish of the application. So there are three important states in the life cycle of a Xamarin app development.

    • OnStart: Called when the application starts.
    • OnSleep: Called each time the application goes to the background.
    • OnResume: Called when the application is resumed, after being sent to the background.


    There is no method for application termination. Under normal circumstances (ie. not a crash) application termination will happen fom the OnSleep state, without any additional notifications to your code.

    62) How many ways we can create Xamarin applications?


    There are two ways to deliver native iOS, Android, and Windows apps using Xamarin Technology

    • Traditional Xamarin approach: This approach can provide direct access to platform-specific API’s. And we can create platform specific apps such as using Xamarin.iOS for iOS applications, using Xamarin.Android we can create Android applications.
    • Xamarin.forms: This 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. 

    63) When to use Xamarin.Forms vs Xamarin Native?



    • Apps that require little platform-specific functionality.
    • Apps where code sharing is more important than custom UI.


    • Apps that require specialized interactions.
    • Apps with highly polished design.
    • Apps that use many platform-specific APIs.
    • Apps where custom UI is more important than code sharing.

    64) What are different extension output files generated from xamarin.forms?


    If we run the Xamarin app, it can generate following application packages for different platforms

    • .xap/.Appx for windows phone 8, Windows, UWP
    • .ipa file for IOS
    • .apk file for Android

    65) What are the different application package running modes in Xamarin?


     When you compile an application, you usually choose between below two modes:

    • Debug: Debug mode pads the executable file with extra information used for debugging purpose. After your application is bug-free and feature-complete, there’s no longer any need to keep the debug information.
    • Release: Compiling in Release mode gives you a more compact (and even slightly faster) executable that doesn’t include unnecessary internal debugging symbols

    Note: Packages should be in release mode, which would be provided to an App store.

    66) How does Xamarin.Android(Mono for Android) work?


    On Android, Xamarin ships a fully functional implementation of the .NET runtime, called Mono, bundled with your app so that your code executes with all of the power of C# and .NET, including JIT-compilation, memory management, reflection, and the .NET base class libraries. Developers can use any native features by interacting with .NET class libraries that provide one-to-one mappings to all of the native APIs on Android.

    67) What is the difference between Xaml & axml in Xamarin Technology?


    • AXML and XAML are two different XML specifications.
    • AXML is just supported/available for Xamarin.Android.
    • XAML is the way Xamarin Forms could standardize Cross Platform UI based on XML specification.
    • XAML is the way Xamarin Forms could standardize Cross Platform UI based on XML specification.
    • If you are using native Xamarin Android you will do UI using axml, if using Forms then using XAML.

    68) How does Xamarin.IOS work?


    On iOS, Xamarin uses Mono, a fully functional implementation of the .NET runtime, to fully compile your app into a native ARM executable ahead of time (AOT) so that your code executes with all of the power of C# and .NET, including memory management, reflection, and the .NET base class libraries. Developers can use any native features by interacting with .NET class libraries that provide one-to-one mappings to all of the native APIs on iOS, while complying with Apple’s security restrictions which prevent execution of dynamically generated code on device.

    69) What is the project structure of Xamarin.Forms?


    If we create App with xamarin.forms project using xamarin studio or visual studio. Then created project will have bellow structure:

    • Shared: Shared Project containing the code common to all projects and it will be either PCL or Shared Project.
    • AppAndroid: Xamarin.Android application project.
    • AppiOS: Xamarin.iOS application project.
    • AppWinPhone: Windows Phone application project.
    • AppWindows: Windows application project.

    AppUWP: Universal Windows Platform application project.

    70) What are the different code sharing techniques in xamarin.forms?


    There are two alternative methods for sharing code between cross-platform applications:

    • Portable Libraries(PCL)
    • Shared Projects

    The goal of a code-sharing strategy is to support the architecture, where a single codebase can be utilized by multiple platforms.

    IOS Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

    71) Difference between Portable Class Library (PCL) & Shared Projects?


    Portable Class Library (PCL):

    • Produce libraries that can be shared across multiple platform.
    • Targeting specific platform includes interfaces
    • Refactoring operations always update.

     Shared Projects:– Shared code can be branched based on the platform using compiler directives( eg. using #if __ANDROID__, #if __IOS__, #if WINDOWS_PHONE_APP, #if WINDOWS_APP..etc)

    • No output assembly.
    • Refactoring operations ,not update automatically.

    72) What does Pages in Xamarin.Forms?


    The Page class is a visual element that occupies most or all of the screen and contains a single child. And pages in xamarin.forms are directly mapped to like below:

    • In iOS  it is a View Controller
    • In Windows Phone it is a Page.
    • In Android it is a Activity.

    73) What are the different kinds of Pages in Xamarin.Forms?


    Fortunately Xamarin.Forms support multiple page representations, And every representation is having its own purpose like below:

    • ContentPage: A Page that displays a single View, often a container such as a StackLayout or a ScrollView.
    • MasterDetailPage: A Page that manages two panes of information.
    • NavigationPage: A Page that manages the navigation and user-experience of a stack of other pages.
    • TabbedPage: A Page that allows navigation between children pages, using tabs.
    • TemplatedPage: A Page that displays full-screen content with a control template, and the base class for ContentPage.
    • CarouselPage: A Page allowing swipe gestures between subpages, like a gallery.

    74) What are the layout controls available in Xamarin.Forms?


    Layout is the process of sizing and positioning child elements in UI.

    • ContentPresenter: A layout manager for templated views. Used within a ControlTemplate to mark where the content to be presented appears.
    • ContentView: An element with a single content. ContentView has very little use of its own. Its purpose is to serve as a base class for user-defined compound views.
    • Frame: An element containing a single child, with some framing options. Frame have a default Xamarin.Forms.Layout.Padding of 20.
    • ScrollView: An element capable of scrolling if it’s Content requires.
    • TemplatedView: An element that displays content with a control template, and the base class for ContentView.
    • AbsoluteLayout: Positions child elements at absolute requested positions. User assigned anchors and bounds defines the position and size of the control.
    • Grid: A layout containing views arranged in rows and columns.
    • RelativeLayout: A Layout that uses Constraints to layout its children.

    StackLayout: A Layout that positions child elements in a single line which can be oriented vertically or horizontally. This layout will set the child bounds automatically during a layout cycle. User assigned bounds will be overwritten and thus should not be set on a child element by the user.

    75) What is Views?


     Views are commonly known as controls of widgets. And they can refer to visual objects such as Label, Button, Entry, Image, BoxView, ListView, TableView..etc. All UI elements are typically are sub-classes of View.

    76) What is is the difference between ListView & TableView?


    • The ListView and TableView controls are so similar, you can think of them as a single control. The major difference between the two is the manner in which they lay out their items, and it’s easy to change the layout so each control emulates the other.
    • The ListView control displays its data stacked vertically, much like a standard listbox. Use this control to display an ordered list of data, especially long lists that require scrolling like a list of email messages, a list of contacts, or search results.
    • The TableView control displays its data stacked horizontally in rows (although you can alter this behavior and have it displayed in columns first, as well). You use this control when you need more space for rich visualization of each item to be displayed.
    • One of the big differences is ListView provides you a ItemsSource and a Itemtemplate and TableView does not. So items must be added as children manually.

    77) How to draw rectangle in Xamarin.Forms?


    BoxView is used to draw a solid colored rectangle. So below source code can create Accent colored rectanlge with width ->200 & Height->100

    • <BoxView Color=”Accent”  WidthRequest =”200″  HeightRequest = “100”/> 

    78) What is the difference between Editor & Entry?


    Both views are helpful for user to enter text, but there is a small difference is Entry only has one line, whereas a Editor usually has multiple lines that allows user to press ENTER.

    79) What is Cell in Xamarin.Forms?


    Simple it is not a visual element, but it just describes a template for creating a visual element. And one important note is that Cells are elements designed to be added to ListView or TableView controls.

    80) What is difference between Entry and EntryCell in Xamarin.Forms?


    • Entry is a visual element, where user can enter single line text. 
    • EntryCell is not visual element, it is subtype of Cell and it describes a template for label and a single line text entry field. It is normally for use in a ListView or TableView.

    81) What is difference between Margin & Padding property?


    • Margin is applied to the outside of you element hence effecting how far your element is away from other elements.
    • Padding is applied to the inside of your element hence effecting how far your element’s content is away from the border.

    82) How to display alert in Xamarin.Forms?


    It is very common UI task is displaying an alert or asking a user to make a choice. So to display alert in Xamarin.Forms, we can use the DisplayAlert method on any Page like below:

    • DisplayAlert (“Alert”, “You have been alerted”, “OK”);

    83) What is difference between DisplayAlert and DisplayActionSheet?


    • Xamarin.Forms has two methods on the Page class for interacting with the user via a pop-up: DisplayAlert and DisplayActionSheet. They are rendered with appropriate native controls on each platform.
    • DisplayAlert presents an alert dialog to the application user with a single cancel, and it does not having importance to collect information from the user.      public Task DisplayAlert (String title, String message, String cancel
    • DisplayActionSheet displays a native platform action sheet, allowing the application user to choose from several buttons. Example: await DisplayActionSheet (“ActionSheet: SavePhoto?”, “Cancel”, “Delete”, “Photo Roll”, “Email”);  

    84) Why we need write platform specific code in Xamarin Forms?


    Xamarin Forms can almost provides 90-95% of share code for all three mobile platform projects (Windows, Android, iOS). However, there are going to be cases where you need to get at something that really isn’t generic, something that’s done a little differently on each platform. That could be something relatively significant (like a custom “renderer”) or something as simple knowing the platform-specific path for local storage, geolocation,text-to-speech..etc

    85) How to write platform specific code in PCL project of Xamarin.Forms?


    We already know compiler directives concept (#ifdef option) is not available in PCL . But in alternative we have majorly there are three ways to create platform specific code in PCL project.

    • DependencyService: It can allows apps to call into platform-specific functionality from shared code. This functionality enables Xamarin.Forms apps to do anything that a native app can do.
    • Device: It is a class contains a number of properties and methods to help developers customize layout and functionality on a per-platform basis. (Ex:Device.OnPlatform, Device.OS, Device.Idiom..etc)
    • Custom Renderers: By default each page, layout, and control in xamarin.forms are rendered differently on each platform, using a Renderer class that in turn creates a native control, arranges it on the screen, and adds the behavior specified in the shared code. But using Custom renderers, developers can be used for small styling changes or sophisticated platform-specific layout and behavior customization.

    86) How does DependencyService work in Xamarin.Forms?


    DependencyService can useful for accessing native mobile features (local storage, geolocation,text-to-speech..etc). But we need to follow below four steps to use DependencyService:

    • Interface: The required functionality is defined by an interface in shared code.
    • Implementation Per Platform: Classes that implement the interface must be added to each platform project.
    • Registration: Each implementing class must be registered with DependencyService via a metadata attribute. Registration enables DependencyService to find the implementing class and supply it in place of the interface at run time.
    • Call to DependencyService: Shared code needs to explicitly call DependencyService to ask for implementations of the interface.

    87) How does Custom Renderers work in Xamarin.Forms?


    Custom Renderers can be used for small styling changes or sophisticated platform-specific layout and behavior customization. But we need to follow below three steps:

    • Create a subclass of the renderer class that renders the native control.
    • Override the method that renders the native control and write logic to customize the control. Often, the OnElementChanged method is used to render the native control, which is called when the corresponding Xamarin.Forms control is created.
    • Add an ExportRenderer attribute to the custom renderer class to specify that it will be used to render the Xamarin.Forms control. This attribute is used to register the custom renderer with Xamarin.Forms.

    88) How to use Device.OnPlatform in xaml and C#?


    Device.OnPlatform is a generic method that has three optional parameters: iOS, Android, and WinPhone. It can be used to provide platform-specific values. For example if we want to set different padding values for different platform we can use like below:

    In Xaml:

    • <ContentPage.Padding> 
    • <OnPlatform x:TypeArguments=”Thickness” iOS=”0, 20, 0, 0″ Android=”0″ WinPhone=”0″/> //left and right padding: 0; top padding: 20 (only on iOS)  
    • </ContentPage.Padding>  

    In C#:

    • On page constructorPadding = new Thickness (0, Device.OnPlatform(20,0,0), 0, 0);  //left and right padding: 0; top padding: 20 (only on iOS)

    89) What are list of compiler directives available in Shared Asset Project(SAP) ?


     Compiler directives are only available in Shared projects and not in PCL. And these are useful to write platform specific code using C# preprocessor directives #if, #elif, #else, and #endif with conditional-compilation symbols defined for the three platforms, as list of compiler directives shown below:

    • __IOS__ for iOS
    • __ANDROID__ for Android
    • WINDOWS_UWP for the Universal Windows Platform
    • WINDOWS_APP for Windows 8.1
    • WINDOWS_PHONE_APP for Windows Phone 8.1

    For example, to get operating system in windows phone 

    • #if  WINDOWS_PHONE_APP  
    • EasClientDeviceInformation devInfo = new EasClientDeviceInformation(); 
    • versionLabel.Text = devInfo.OperatingSystem; //To get device operating system.
    •  #endif

    90) What are different type of Data Binding modes in Xamarin?


    Data binding connects two objects, called the source and the target. So the relationship between target and source is defined by members of the BindingMode enumeration and there is four kinds of binding modes are available in Xamarin.Forms.

    • Default (Optional & not considered)
    • OneWay — changes in the source affect the target (normal).
    • OneWayToSource — changes in the target affect the source.
    • TwoWay — changes in the source and target affect each other.

    Note: If you don’t specify anything, the default binding mode is OneWay

    91) What are the different scenarios to use Data Binding in Xamarin.Forms?


    Not only with data source, we can also use Data Binding concept in various scenarios like below:

    • View-to-View Bindings: This is the scenario, when we want to link properties of two views on the same page. In this case, you need to set the BindingContext of the target object using the x:Reference markup extension. 
    • Backwards Bindings: A single view can have data bindings on several of its properties.
    • Binding with Model: Here the scenario is like, a view property is binding with specific class object.*Binding with Collections: It is scenario, where we want to bind list of objects to view. For example ListView defines an ItemsSource property of type IEnumerable, and it displays the items in that collection

    92) How to make View-to-View Data Binding in Xamarin.Forms with Xaml?


    Sometimes we may need to link one property of view with another property of view. For example below Xaml program can describes the scenario is like when we want to control Opacity value of Lable with Silder control Value. 

    • <?xml version=”1.0″ encoding=”UTF-8″?> 
    • <ContentPage xmlns=”http://xamarin.com/schemas/2014/forms” xmlns:x=”http://schemas.microsoft.com/winfx/2009/xaml” x:Class=”CustomEntry.ViewtoViewBinding”>  
    • <StackLayout VerticalOptions=”Start” Padding=”20,70,20,0″>   
    • <Label Text=”Lable Opacity Demo” FontSize=”Large” VerticalOptions=”CenterAndExpand” HorizontalOptions=”Center”  Opacity=”{Binding Source {x:Reference Name=slider}, Path=Value}” />  
    • <Slider x:Name=”slider” VerticalOptions=”CenterAndExpand” />   
    • </StackLayout>  
    • </ContentPage>

    93) Why we need to use Model-View-ViewModel(MVVM) pattern in Xamarin?


    The Model-View-ViewModel pattern can be used on all XAML platforms. Its intent is to provide a clean separation of concerns between the user interface controls and their logic.


    • During the development process, developers and designers can work more independently and concurrently on their components. The designers can concentrate on the view, and if they are using Expression Blend, they can easily generate sample data to work with, while the developers can work on the view model and model components.
    • The developers can create unit tests for the view model and the model without using the view. The unit tests for the view model can exercise exactly the same functionality as used by the view.
    • It is easy to redesign the UI of the application without touching the code because the view is implemented entirely in XAML. A new version of the view should work with the existing view model.
    • If there is an existing implementation of the model that encapsulates existing business logic, it may be difficult or risky to change. In this scenario, the view model acts as an adapter for the model classes and enables you to avoid making any major changes to the model code.

    94) What is use of ICommand in Xamarin.Forms?


    • Typically, when you write an application without using the MVVM pattern, to manage the user’s interaction with the user interface (for example, he clicks on a button) you subscribe to a event handler: this way, a new method will be generated in code (C#) behind, which will contain the code that will be execute when the event is raised.
    • This approach is that it creates a strong connection between the View and the code: event handlers can be managed only in code behind, but you can’t simply move it to a ViewModel. The solution is to use commands, which are special objects (that implement the ICommand interface) that define the operation to perform when the command is executed.

    95) What is NuGet and how it can help in Xamarin App Development?


    NuGet is the most popular package manager for .NET development. It is built in to Xamarin Studio 5 and Visual Studio. You can easily search for and add packages/third party libraries to your Xamarin.Forms using either IDE.

    96) What does behaviors in Xamarin.Forms?


     Behaviors are very important and useful to add functionality to user interface controls without having to subclass them. Instead, the functionality is implemented in a behavior class and attached to the control as if it was part of the control itself. For example adding an email validator to an Entry, controlling an animation, adding an effect to a control.

    Xamarin.Forms supports two different styles of behaviors:

    • Xamarin.Forms behaviors: classes that derive from the Behavior or Behavior<T> class, where T is the type of the control to which the behavior should apply.
    • Attached behaviors: static classes with one or more attached properties

    97) What are uses of DataPages in Xamarin.Forms?


    Data pages allow developers to quickly and easily consume a supported data source and render it using built-in UI scaffolding that can be customized with themes.

    Note: Xamarin.Forms DataPages were announced at Evolve 2016

    98) How to increase rows & columns space of Grid in Xamarin.Forms?


    Yes, we can set space between rows in the Grid using RowSpacing. And also we can sets the distance between columns in the Grid using ColumnSpacing .

    • <Grid Name=”GridSpaceDemo” RowSpacing=”3″ ColumnSpacing=”2″  >  
    • <Grid.RowDefinitions>  
    • <RowDefinition Height=”Auto”/>  
    • <RowDefinition Height=”Auto”/>  
    • <RowDefinition Height=”Auto”/>  
    • </Grid.RowDefinitions>  
    • <Grid.ColumnDefinitions>  
    • <ColumnDefinition Width=”Auto”/>  
    • <ColumnDefinition Width=”Auto”/>  
    • <ColumnDefinition Width=”Auto”/>  
    • </Grid.ColumnDefinitions>  
    • <!–Grid child items–>  
    • </Grid>

    99) What is the difference between Modal pages and Modeless pages?


    Modal Page: We’ll use modal pages when your application needs some information from the user and you don’t want the user to return to the previous page until that information is provided. Below C# code is used to navigate to specific page name is DetailPage. 

    • async void ModelPageNavigation ()  
    • {     
    •     await Navigation.PushModalAsync (new DetailPage ()); //Navigate to Details Page  

    Modeless Page: The difference between modal and modeless pages mostly involves the user interface that the operating system provides Back button on the page to return back to the previous page.

    async void ModelessPageNavigation ()  

    •     await Navigation.PushAsync (new DetailPage ());
    • //Navigate to Details Page, will create Back button navigation page

    100) Define grid.


    Grid is a layout control in Xamarin.forms which displays informations in columns and rows.

    Are you looking training with Right Jobs?

    Contact Us
    Get Training Quote for Free