Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin how it is getting the Native Look and Feel?

I am new to Xamarin. I have few confusion here.

Question:

  1. How does Xamarin get the Native Look and Feel of the UI Components?.
  2. Does Xamarin Provide their own Widgets [ like button, Layouts, ..].

Here is my understanding Correct me if I am wrong?.

1) Develop the UI [ button, layout...] by native SDK. For example iOS use Xcode. for Android ?.

2) Consider the button, when the button is pressed, the the code which is going to get executed is common across the platform.

3) So, Since UI are directly from their respective SDK, we get the Native Look and Feel.

Kindly correct me where I misunderstood?.

like image 740
Whoami Avatar asked Apr 02 '13 12:04

Whoami


People also ask

How is Xamarin native?

Xamarin Native uses the same tech stack for building native apps for different platforms. It's an optimal balance between delivering native user experience without having to hire two separate teams. Xamarin Native uses the same performance metrics as in Java development for Android or Swift for native iOS.

Is Xamarin really native?

Unlike interpreted solutions, such as Appcelerator Titanium, Xamarin is natively compiled, which makes it a go-to option for building high-performance apps with native look and feel. Based on . NET framework.

How does Xamarin compile to native code?

For Android, Xamarin leverages the JIT(Just In Time) compilation to create an optimized executable. Xamarin. Android applications run within the Mono execution environment. This execution environment runs side-by-side with the Android Run Time(ART) virtual machine.

Is Xamarin native or hybrid?

Developed by Microsoft, Xamarin is a hybrid mobile application platform based on the . NET environment. It allows developers and designers to create native Android, iOS, and Windows apps through a shared .


1 Answers

I think you are way off.

Xamarin provides C# and the .Net (Mono) runtime on iOS and Android. At the same time they expose the native APIs on each platform to C#. So they built a way for C# to call into Objective-C and Java (and vice versa).

This means you develop native UIs on each platform, and can share backend business logic between platforms. A Xamarin app can share somewhere between 50-75% of its code across platforms. There is no general sharing of the UI across platforms, since this would abstract away the native APIs.

To break it down:

Android

  • Use Xamarin Studio or Visual Studio to develop your C# backend code
  • Use Xamarin's Android designer to layout native Android XML layouts

iOS

  • Use Xamarin Studio or Visual Studio* to develop your C# backend code
  • Use XCode on a Mac to layout storyboard or XIB files for native iOS UI layout

Both options you can create your UI from code as well, but the native APIs will be different on each platform.

*A mac is needed to compile for iOS

like image 116
jonathanpeppers Avatar answered Jan 04 '23 12:01

jonathanpeppers