0% found this document useful (0 votes)
188 views18 pages

Xamarin Exordium Q A

This document provides an overview of Xamarin, a platform for developing fully native mobile applications for iOS, Android, and Windows with a shared code base using C#. It discusses Xamarin's role in cross-platform development by allowing developers to create native user experiences while sharing common code. The document also covers Xamarin development approaches, pros and cons of cross-platform development, major cross-platform tools, how Xamarin works for iOS and Android, and requirements for Xamarin development environments.

Uploaded by

harshit kuchhal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
188 views18 pages

Xamarin Exordium Q A

This document provides an overview of Xamarin, a platform for developing fully native mobile applications for iOS, Android, and Windows with a shared code base using C#. It discusses Xamarin's role in cross-platform development by allowing developers to create native user experiences while sharing common code. The document also covers Xamarin development approaches, pros and cons of cross-platform development, major cross-platform tools, how Xamarin works for iOS and Android, and requirements for Xamarin development environments.

Uploaded by

harshit kuchhal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Xamarin Exordium

Xamarin - Introduction
One of our main challenge in cross-platform mobile development is to create the user experience
that is equivalent to native app. At the same time, we would like to share the common code
across platforms to make our development process more efficient and profitable.
Here comes the real role of Xamarin in cross-platform mobile development. Xamarin is a
platform for developing fully native applications for iOS, Android, and Windows, with a
shared code base.
In this course, you will learn about the development approaches you can use with Xamarin and
learn how to configure your development environment. So you are ready to start learning how to
build mobile applications using Xamarin!

Cross-Platform Overview

Cross-platform applications are apps with a single code base which can be used to run on
different mobile platforms like Android, iOS, Windows.
The final product is an app that uses native APIs which can achieve almost native performance
without any performance issues visible to the user.

Pros of Cross Platform Mobile Development

 Faster Development

 Cost Effective

 Extensive code sharing

 Code can run natively on the device without a web wrapper.

 Direct access to device native APIs like Camera, Contact, Media etc.

 Provides native user interface (UI).

 Provides close to native performance.

Cons of Cross Platform Mobile Development

 Tools will have to catch up with the newer versions of mobile platform features.
 The future depends upon the policies defined by the mobile platform manufacturers.
 Platform limitations for some unique features
 Lack of UI code sharing capability
 Development teams have different Tools and Languages to master

Major Cross-Platform Tools

 NativeScript - An open source framework for building truly native mobile apps
with Angular, TypeScript or JavaScript.
 Xamarin - A Platform for developing fully native applications for iOS, Android and
Windows, with a shared code base using C#.
 React Native - Framework to build cross platform native mobile apps using JavaScript.

Power of Native

 Xamarin allows you to create native user experiences using platform-specific UI


elements.
 Xamarin.Forms tool converts app UI components into the platform-specific interface
elements at runtime.
 The performance metrics can be compared to those of Java for Android and Objective-C
or Swift for iOS.

Powerful C# language

Xamarin uses C# which is one of the modern, powerful languages. It has many improvements
over Objective-C and Java. It allows you to use a familiar syntax and sophisticated features like
generics, Linq and the parallel task library.

Seamless integration
Xamarin provides seamless integration of Objective-C, Java and C++ libraries. This provides the
ability to easily integrate with many third-party code bases which are in Java, Objective-C or C+
+.

Code Reusability
Xamarin offers 90% of code reusability by sharing common code in a single code base for
Android, iOS and Windows platforms

Cost effective and Time to Market

Xamarin.Mobile library offers a unified API to access common resources across all three
platforms and applications can be written to share up to 90% of their code. This casues a
significant reduction in both development costs and time to market for mobile developers which
targets iOS, Android and Windows - the three most popular mobile platforms.

Robust Compile Time Checking


Xamarin provides powerful compile time checking. This will reduce the run time errors and in
effect provide high quality applications.

Xamarin Overview

Xamarin is a Microsoft-owned San Francisco, California-based software company founded in


May 2011. It has a C#-shared codebase with which you can use Xamarin tools to write native
Android, iOS, and Windows apps with native user interfaces.You can also share code across
multiple platforms, including Windows and macOS.

Development Approaches
Xamarin provides two ways to build native apps.

 Xamarin.Native
 Xamarin.Forms

Xamarin Native (Xamarin.iOS and Xamarin.Android) provides direct access to platform-specific


APIs while Xamarin.Forms maximizes code sharing.

Native UI
Xamarin delivers high performance with device-specific experiences using native APIs to create
a good user interface and user experience.
 iOS - UIKit APIs to create user interface. Xamarin's iOS designer/ Xcode Storyboards
can be used for designing the UI.
 Android - Android.Views to create user interface. Xamarin’s UI designer can be used for
designing the UI.
 Windows - XAML for presentation layer, created in Visual Studio or Blend’s UI
designer.
 Mac - Storyboards to be used for the presentation layer, created in Xcode.
 Xamarin.Forms - XAML to create user interfaces that can be shared across platforms.
Xamarin delivers high performance with device-specific experiences using native APIs to create
a good user interface and user experience.

Separate Reusable Code


Since Xamarin provides OS specific UI layer, the reusable/shared code should be separated from
UI. The amount of code re-use will depend largely on how much code is kept in the shared core
and how much code is user-interface specific. Shared core can be any thing which does not
interact directly with the user.

Xamarin.Forms offering even more code reusability by providing the shared UI layer. XAML in
Xamarin.Forms can be used to create UI which can be shared across all the platforms.

Use C#

The underlying language of Xamarin is C# with the .NET framework.

C# is a modern language that includes significant improvements over Objective-C and Java such
as

 Dynamic Language Features


 Functional Constructs such as Lambdas , LINQ
 Parallel Programming features
 Sophisticated Generics and more.

MVC/MVVM pattern
Xamarin architecture uses a Model/View/Controller approach or a Model/View/ViewModel
approach where “Model” is separated from the rest. It is important to decide which parts of your
application will use the native user interface elements of each platform (iOS, Android, Windows,
Mac) and the business logic. Normally, the code is split into the Core and User Interface. The
two most prominent MVVM frameworks for Xamarin development are: MVVMCross and
MVVMLight.

Xamarin Development Approaches

Xamarin allows you to code in C# and share code across multiple platforms. However, the
implementation on each OS is very different.

 iOS - Xamarin's Ahead-of-Time (AOT) compiler compiles Xamarin.iOS applications


directly to native ARM assembly code.
 Android - Xamarin's compiler compiles down to Intermediate Language. Then the Just-
in-Time (JIT) is compiled to native assembly when the application launches.

The Xamarin compiler performs optimizations for mobile deployment such as linking away un-
used code.

Xamarin.Native (Xamarin.iOS &


Xamarin.Android)

Through this, user interfaces will be created using the platform-specific UI components and the
business logic will be shared throughout the project. A separate UI layer is required for each
platform - iOS, Android, Windows and Mac. This approach enables us to fine-tune the UI for
each platform.

Xamarin.iOS and Xamarin.Android are best for:

 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

Xamarin.Forms

Xamarin.Forms is a cross-platform UI toolkit that allows developers to easily create native user


interface layouts that can be shared across Android, iOS, and Windows Phone.

There are two techniques to create user interfaces in Xamarin.Forms.

The first technique is to create UIs entirely with C# source code.

The second technique is to use Extensible Application Markup Language (XAML), a


declarative markup language that is used to describe user interfaces.

Xamarin.Forms is best for:

 Data entry apps


 Prototypes and proofs-of-concept
 Apps that require little platform-specific functionality
 Apps where code sharing is more important than custom UI

How Does Xamarin Works for iOS & Android?


As you learned, Xamarin allows you to write apps in C#, and share the same code
across multiple platforms, but the interesting fact is that the actual underline
implementation on each OS is very different.

 iOS - Xamarin's Ahead-of-Time (AOT) Compiler compiles Xamarin.iOS


applications directly to native ARM assembly code.
 Android - Xamarin's compiler compiles down to Intermediate Language. Then
the Just-in-Time (JIT) compiled to native assembly when the application
launches.

The Xamarin compiler also performs many optimisations for mobile deployment such as
linking away un-used code.

How Does Xamarin Work for Windows?


For Windows, C# is compiled to IL and executed by the built-in runtime, and does not require
Xamarin tools.
Designing Windows applications following Xamarin’s guidance makes it simpler to re-use the
code on iOS and Android.
Note that the Universal Windows Platform also has a .NET Native option which behaves
similarly to Xamarin.iOS' AOT compilation.

Xamarin - Development Enviornment


NOTE: To develop for iOS on Windows computers there must be a Mac computer accessible on
the network, for remote compilation and debugging. This also works if you have Visual Studio
running inside a Windows VM on a Mac computer.

macOS Requirements

Using a Mac computer for Xamarin development requires the below software/SDK versions.

 Operating System - Recommended Operating system for Mac is OS X El Capitan


(10.11) or macOS Sierra.The minimum required version is OS X El Capitan (10.11).
 Xamarin.iOS - Recommended iOS version is iOS 10 SDK or above.
 Xamarin.Android - Recommended Android version is Android 6.0 / API level 23. You
can still target older Android versions while using the latest SDK, or you can build
against older versions of the SDK if required.
 Xamarin.Forms - Xamarin.Forms apps built on macOS can include iOS, Android, and
macOS projects, subject to the SDK requirements above.

Xamarin.Forms projects for Windows/UWP cannot be built on macOS.

 Xamarin.Mac - OS X El Capitan (10.11) SDK - The OS X El Capitan SDK ships with


Xcode 7.2; macOS SDKs ship with Xcode 8.

NOTE: Xcode can be installed (and updated) on developer.apple.com or via the Mac App Store.
Windows Requirements

Using a Windows computer for Xamarin development requires the below software/SDK
versions.

 Operating System -The recommended operating system for development is Windows


10. The minimum operating system version is Windows 7. Xamarin.Forms Windows
support requires Windows 8.1, and Xamarin.Forms UWP support requires Windows 10.
 Xamarin.iOS - Recommended iOS version is iOS 10 (installed on a mac). To build iOS
projects on Windows requires: Visual Studio 2013 or newer, and a Mac computer,
network accessible from the Windows computer, that conforms to the minimum
requirements for running Xamarin on macOS .
 Xamarin.Android - Recommended Android version is Android 6.0 / API level 23. You
can still target older Android versions while using the latest SDK, or you can build
against older versions of the SDK if required.
 Xamarin.Forms - Xamarin.Forms apps for iOS and Android can be deployed to the
relevant platforms as described above. Using Visual Studio also means you can test apps
for Windows and the Universal Windows Platform (on Windows 10) using Microsoft's
emulators. Windows apps can be tested directly on the development computer.
 Xamarin.Mac - Xamarin.Mac projects (macOS desktop apps) can be opened in Visual
Studio and compiled to check for errors, however Mac applications cannot currently be
built for distribution in Visual Studio. See the release notes on Xamarin.Mac support for
more information about the limitations of Mac projects in Visual Studio.

NOTES:
Xamarin for Visual Studio supports any Visual Studio 2015 or 2017 (Community, Professional,
and Enterprise) and non-Express editions of Visual Studio 2013 Update 2.

To develop Xamarin.Forms apps for the Universal Windows Platform (UWP) requires Windows
10 with Visual Studio 2015 or 2017.

Xamarin - Solution Overview


A typical Xamarin solution contains the following components.
 ProjectName.Core: A cross-platform application library (portable/shared) containing the
shared code.
 ProjectName.Android: A platform-specific project for Android apps.
 ProjectName.iOS: A platform-specific project for the iOS app. To run and debug the
app, you’ll need a Mac.
 ProjectName.WinPhone: A platform-specific project for the Windows apps.
 ProjectName.UITest: A testing project which enables Automated UI Acceptance Tests
written in NUnit to be run against iOS and Android apps. This helps programmers to
execute tests in C# and NUnit and validate the functionality of iOS and Android Apps.

Xamarin Exordium Course Summary


This lesson familiarised you with the Xamarin Basics, Why use Xamarin, Pros and Cons of
Xamarin, Setting up a Xamarin development environment and how to create an application using
Xamarin Native and Xamarin Forms.
Remember that:
 Xamarin is a cross platform tool for developing applications for different Mobile
platforms.
 The output of the Xamarin development is native application.
 Xamarin.Native is providing approximately 80% of code reusability and Xamarin.Forms
is providing approximately 100% code reusability.
 Xamarin.Forms is best for apps where code sharing is more important than custom UI
 Xamarin.iOS & Xamarin.Android are best for Apps with interactions that require native
behavior.
All the best for your coding endeavors!

It is possible to write wearable application using Xamarin.


Choose the correct answer from below options:-
(1)True
(2)False

Answer:-(1)True

Using Xamarin.Droid the Android-specific UI code can be shared with other platforms.

Answer:-False

A Windows PC is a must to develop code for Android Phone in Xamarin.


Choose the correct answer from below options:-
(1)False
(2)True

Answer:-(1)False

For Xamarin Forms based development for Android does not require Android Manifest file.
Choose the correct answer from below options:-
(1)True
(2)False

Answer:-(2)False

Xamarin mostly uses the _______ paradigm.

Answer:-MVVM

What are the development approaches in Xamarin


Choose the correct answer from below options:-
(1)Native and Forms
(2)None of the options
(3)MVP
(4)Hybrid approach

Answer:-(1)Native and Forms

iOS uses Ahead of Time Compilation to generate the executables


Choose the correct answer from below options:-
(1)False
(2)True

Answer:-(2)True

HTML5 and CSS3 are used in Xamarin.Forms for UI part.

Answer:-False

_________ is a cross-platform UI toolkit that allows developers to easily create native user
interface layouts that can be shared across Android, iOS, and Windows Phone.

Answer:-Xamarin Forms

What is the extension of the a class file in Xamarin


Choose the correct answer from below options:-
(1).m
(2).cpp
(3).cs
(4).java

Answer:-(3).cs

Method for sharing code between cross-platform applications


Choose the correct answer from below options:-
(1)PCL
(2)Shared Project
(3)All ABC
(4).Net Standard Libraries

Answer;-(3)All ABC

How does Xamarin increase the ROI ?


Choose the correct answer from below options:-
(1)No licensing fee
(2)No publishing or distribution headaches
(3)Multiple code bases for each platform
(4)Code reusability across platforms

Answer:-(4)Code reusability across platforms

Xamarin.iOS is available for Xamarin Studio on Windows.

Answer:-False

What is Xamarin Insights ?


Choose the correct answer from below options:-
(1)None of the options
(2)Analytics tool that answers vital questions about the health of your apps
(3)Xamarin cloud for testing
(4)Xamarin SDK for Android development

Answer:-(2)Analytics tool that answers vital questions about the health of your apps

Languages supported in Xamarin development


Choose the correct answer from below options:-
(1)C#
(2)Kotlin
(3)C# and F#
(4)java

Answer:-(3)C# and F#

What is the role of the UITest component in Xamarin workspace?

Answer:-Contains the unit tests written in NUnit and C#

Xamarin studio is a standalone IDE for crossplatform mobile application development based on
open source project ____
Choose the correct answer from below options:-
(1)Baxter
(2)AndroidStudio
(3)MonoDevelop
(4)Project moonshoot
Answer:-(3)MonoDevelop

What are the different Xamarin licence terms


Choose the correct answer from below options:-
(1)XAMARIN STUDIO COMMUNITY
(2)All the options
(3)XAMARIN STUDIO ENTERPRISE
(4)XAMARIN STUDIO PROFESSIONAL

Answer:-(2)All the options

Which mobile platform uses Just In Time Compilation ?


Choose the correct answer from below options:-
(1)All the options
(2)Windows
(3)Android
(4)iOS

Answer:-(3)Android

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy