In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what are the advantages of Xamarin". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "what are the advantages of Xamarin"?
Xamarin is a cross-platform development technology, which used to be charged, and it is said to be expensive, so the number of users is relatively small, and almost no one is interested in it in China. Later, Xamarin was acquired by Microsoft and is now open for free. I believe that the number of domestic users will increase greatly in the future, on the one hand, because free things are always popular, and on the other hand, Xamarin does provide a relatively powerful technology to support cross-platform development (the development here is mainly on Android and iOS, but it is actually more than that).
Nowadays, there are many cross-platform development solutions on the market, such as React Native, PhoneGap, IONIC and so on. Most of these aspects are based on HTML and JavaScript technologies. Naturally, there is nothing to say in terms of development efficiency, but these technologies are inferior to native development technologies in performance, and this is precisely the space where Xamarin can survive.
Xamarin claims that it can achieve performance as good as native technology, and may even surpass native technology in some ways, which I think refers to Android. My personal analysis, the reason may be like this. Xamarin uses C # for development (it seems to be OK to use F #, but I haven't tried it. It is said that F # is also very good, and I will learn later). The default method of C # is not virtual, that is, to rewrite a method in a subclass, it must be declared as virtual in the parent class, while java defaults that all methods are virtual methods, so C # can reduce this overhead. Secondly, it may be that Microsoft is also an established IT company after all, its optimization ability in system software is not to be underestimated, and the cool techs in its hands is also a lot, so it should be confident to say this. Of course, this is not the most important thing, as long as you can achieve similar native performance in most cases, it is very good.
Xamarin mainly has several technologies, Xamarin.Android, Xamarin.iOS and Xamarin.Forms, as well as Xamarin.UWP, Xamarin.Windows, Xamarin.WinPhone and so on, but in view of the current market share, the latter can be ignored for the time being.
Both Xamarin.Android and Xamarin.iOS essentially encapsulate native API with a layer of C #, so it will be very similar to native API in use. This wrapper will combine some of the syntax features of C # so that developers can enjoy the syntax candy of C #. Where Xamarin.iOS is the binary code compiled directly into ARM, so the execution efficiency must be very high. In contrast, Xamarin.Android is compiled into an intermediate language, Xamarin in the APK installation package will include a mono runtime, the code is done on the mono runtime and Android native runtime, it is conceivable that this requires some overhead, and will make the installation package much larger, but considering that the device's running space and storage space are growing at a high speed, this is not a particularly fatal disadvantage.
The most critical technology of Xamarin is not the above two, but Xamarin.Forms. This technology abstracts the GUI of IOS, android, UWP and other platforms uniformly. The developer only needs to write a set of code, and the compiler will map the interface to the original control at compile time, so as to obtain the appearance and performance of the native platform. This approach should be the most popular for developers, at least for me, and it has the least performance loss compared to the cross-platform approach that runs on the virtual layer. Of course, small wear doesn't mean no, and officials say Xamarin.Forms is not suitable for developing applications with particularly complex and frequent graphical interface operations. In this case, we can use Xamarin.IOS or Xamarin.Android to solve the problem, that is, Xamarin.Forms can be used in conjunction with Xamarin.IOS or Xamarin.Android in the same project. Take I am going to use Xamarin as an example. According to the characteristics of Xamarin, I use Xamarin.Forms as the setting interface of the input method to save the effort of repeatedly developing a set of interface and business logic, while using Xamarin.IOS and Xamarin.Android as the input method interface to maximize performance. At present, from the results of my experiment, this idea is feasible. Although my initial idea was to use Forms to do the input method interface, I found that the interface written by Forms could not be used in the input method interface (according to my experiment, the interface of Forms should only be used to make the interface of Activity, but not the interface of Service, or maybe I didn't know how to implement it), so I had to settle for second place, but now the result is good. After all, the input method interface itself has higher performance requirements, so it is naturally better to use a technology that is closer to the original code.
At this point, my intention to use Xamarin is clear, that is, I want to use it to achieve a cross-platform mobile input method, specifically the year-cold input method. Now the first thing I'm going to do is the IOS version, and then rewrite the Android version. If WindowPhone can improve in the future and open up the permission of the third release input method, then implementing a WindowPhone based on this code will not be a painstaking task. If you develop in the native language, then every platform will have to rewrite a set of code, which is too expensive, especially for individual developers, which is why Xamarin is so attractive to me.
Cross-platform has cross-platform convenience, and naturally there are cross-platform difficulties. Xamarin only provides a means of cross-platform development. If you want to make good use of this means and maximize the reuse of code, you need higher skills and more thinking. Therefore, I do not recommend Xamarin as a newcomer to development. Before that, it is best to have a deep understanding of one of the platforms and its development process.
Xamarin is now free, which is obviously part of Microsoft's mobile strategy. Due to the lack of its own operating system in the ecological environment, Microsoft is forced to promote the development of cross-platform technology, hoping to borrow from other platforms to feed itself. In my opinion, Microsoft's mobile operating system is unlikely to take a turn for the better, but this does not mean that Xamarin is hopeless as a technology. It is never uncommon to "plant flowers without willow". As long as you grasp the developers, the big tree of Microsoft will not fall. I believe Microsoft understands this, and as a developer, it is not necessary to worry too much about Microsoft crossing the river and breaking the bridge.
Thank you for your reading, the above is the content of "what are the advantages of Xamarin". After the study of this article, I believe you have a deeper understanding of what the advantages of Xamarin are, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.