Xamarin native Cross-platform overview (streamlined overview, hit the key.) PS: No image)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.