Xamarin native Cross-platform: Native interface, native performance, native API (compared to H5);
1, C # can access Andrid, iOS native API, can also call C # system type, such as Syetem,system.io;
2, principle: Based on mono (on the Linux shelf one layer mono,. NET program can be run on the LIUNX system. Previously divided into mono andriod, mono touch two platforms, and later due to the popularity of mobile and some reasons, the name changed into Xamarin.
3, the technical basis:
Binding: When the Andriod, IOS version upgrade, the background through the binding of the native API into C # can invoke the API, that is, the implementation of 100% access to the native API, which is H5 do not have to use Cordova only access to some of the API, Reach less than 100%.
P/invoke (Platform invoke): Why can C # invoke platform-level code? For example, a desktop program can call the WIN32 program via P/invoke, and mono also calls the native API with C # code using P/invoke technology. It's a technology tradition, not a new technology, but porting from the desktop to the mobile phone.
4.
Native compilation mode (different from Cordova):
Andriod: The Java code is first compiled into an intermediate language, and when the Andriod deployment runs, the intermediate language is translated into machine language by the andriod virtual machine, i.e. Java is based on the virtual machine mechanism. Xamarin mimics this mechanism by implementing the virtual machine itself, which compiles C # code into an intermediate language and runs through Xamarin's own virtual machine when the Andriod program runs. The final result is also translated into native Andriod code to execute.
iOS: Since iOS is not allowed to run through the virtual machine mechanism, the program compiles the Ahead of the C # code into iOS machine code prior to compiling it, and is the same as native iOS when it is approved in the App Store. The audit does not pass because of code reasons.
Xamarin native Cross-platform overview (streamlined overview, hit the key.) PS: No image)