Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Xamarin iOS and Android work?

I try to understand how Xamarin.iOS (MonoTouch) and Xamarin.Android (Mono for Android) work. I wrote a little App and looked into the .app and .apk file.

Inside of the .app file (iOS) are many .dll files. But why? On every page and post I read they say: The App is executed native and nothing is interpreted. Can somebody explain to me what the xamarin developer mean with "native"?

Inside of the .apk file is not a single .dll file..

like image 444
Tim Siefert Avatar asked Jun 19 '13 20:06

Tim Siefert


People also ask

Does Xamarin work with iOS and Android?

Xamarin. Forms is an open source mobile UI framework from Microsoft for building iOS, Android, & Windows apps with .

How does Xamarin iOS work?

Xamarin.iOS Xamarin uses Selectors to expose Objective-C to managed C# and Registrars to expose managed C# code to Objective-C. Selectors and Registrars collectively are called "bindings" and allow Objective-C and C# to communicate. For more information, see Xamarin. iOS architecture.

How Xamarin is used for native Android and iOS development?

Xamarin Forms enable fast prototyping with built-in UI libraries, adapted both to Android and iOS; Rich access to native APIs – just like in native apps, you can get access to the user's Bluetooth, camera, microphone. Features that use these API can be written in a specific language for faster performance.

Is Xamarin hybrid or cross-platform?

Cross-platform Xamarin is part of the vibrant . NET ecosystem, used by millions of developers worldwide. Share more than 75% of your code across platforms, for "write once, run anywhere" ease. Use your favorite frameworks, tools, and Xamarin's powerful libraries to access native APIs and 2D graphics from shared code.


1 Answers

The Xamarin definition of "native" includes but is not limited to:

  • Every line of C# code is compiled to machine code and then packed in .app. There is no JIT at runtime, as it is suppressed by AOT. More information can be found at

http://www.mono-project.com/AOT

(Note that Xamarin.Android still uses JIT, http://xamarin.com/how-it-works)

  • Access to platform native types / API is fully open, so you are not limited to a small set of API calls (if you use HTML5 / JavaScript, you know what kind of limitations are there).

  • The user interface you design is bound to the native API exposed by iOS (CocoaTouch) or Android (Skia). There is no intermediate layer to hurt performance or look and feel.

As to what is inside .ipa or .apk, who cares? Of course @Jason's comment shows us of some internal implementation details.

like image 120
Lex Li Avatar answered Sep 19 '22 21:09

Lex Li