Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What framework does Xamarin use to create cross platforms apps?
Does it use .Net Framework?
Is it the same .Net Framework we use to create apps for Windows?
So, can i just port my existing .Net App to Android via Xamarin?

I just don't get exactly how Xamarin works, because i couldn't find something useful.
Posted

1 solution

Xamarin has "ported" a subset of the .NET framework to work with Android, iOS and OSX.  Recently, Microsoft has made available a new profile (Portable Class Library project) that ensures cross-platform compatibility across Xamarin (Android and iOS) and Windows Phone.

By "porting", I mean Xamarin exposes the Android and iOS APIs via C# bindings, allowing you to build apps using C#, and more easily share non-UI code across the different mobile platforms.  Xamarin Forms is an extension that makes it easier to share UI code across these platforms.  However, Xamarin Forms is best suited for simple apps.

See this link for more info: How does Xamarin work?[^]

/ravi
 
Share this answer
 
v2
Comments
Ziya1995 6-Apr-15 12:09pm    
1. Portable Class Library has no GUI.
2. Everything written in Xamarin should be Cross Platform and run on Windows desktop, IOS, Android and Mac.
But i see Xamarin.IOS and Xamarin.Android - they are separate.
I see Xamarin APIs and they are separate for IOS, Android, Mac.
What does it mean?

Can i write once in Xamarin GUI and run on all 4 platforms including Windows desktop?
Ravi Bhavnani 6-Apr-15 12:14pm    
1) Correct.  PCLs are used to build shared business logic.

2) No, everything written in Xamarin is NOT cross platform! Xamarin.IOS is the C# binding to iOS.  Xamarin.Android is the C# binding to Android.  This allows you to access the standard iOS and Android APIs from C#.

/ravi
Ravi Bhavnani 6-Apr-15 12:16pm    
> Can i write once in Xamarin GUI and run on all 4 platforms including Windows desktop?
No.  Windows desktop (WinForms/WPF) is not supported.

Essentially, only UI code written using Xamarin Forms is portable across iOS, Android and Windows Mobile.

/ravi
Ziya1995 6-Apr-15 12:29pm    
Is it native or my app created in Xamarin needs some Virtual Machine?
Ravi Bhavnani 6-Apr-15 12:47pm    
Xamarin generates IL which is packaged in the .apk (in the case of Android) and runs on top off Mono. The process of converting IL to a form consumable by Dalvik (and the newer Android VM) is transparent. For all practical purposes, the .apk generated by Xamarin is no different than one generated when building a native app.

IMHO, the nice thing about Xamarin is that it allows me to leverage my C# skills and the .NET framework. Caveat: I still need to know the Android API (which is not hard to pick up) in order to build Android apps. The same applies for iOS.

Edit: Xamarin Forms controls translate to native controls.

/ravi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900